fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. string fullName;
  7. int employeeID;
  8. string department;
  9. double salary;
  10. int experience;
  11. int isFullTime; // 1 = Yes, 0 = No
  12. char gender; // M/F/O
  13.  
  14. // Input section (all with cin)
  15. cout << "Enter full name (one word): ";
  16. cin >> fullName;
  17.  
  18. cout << "Enter employee ID: ";
  19. cin >> employeeID;
  20.  
  21. cout << "Enter department (one word): ";
  22. cin >> department;
  23.  
  24. cout << "Enter salary: ";
  25. cin >> salary;
  26.  
  27. cout << "Enter years of experience: ";
  28. cin >> experience;
  29.  
  30. cout << "Is full-time? (1=Yes, 0=No): ";
  31. cin >> isFullTime;
  32.  
  33. cout << "Enter gender (M/F/O): ";
  34. cin >> gender;
  35.  
  36. // Output section
  37. cout << "\n--- Employee Profile ---\n";
  38. cout << "Full Name: " << fullName << endl;
  39. cout << "Employee ID: " << employeeID << endl;
  40. cout << "Department: " << department << endl;
  41. cout << "Salary: " << salary << endl;
  42. cout << "Experience: " << experience << " years" << endl;
  43. cout << "Full-time Status: " << (isFullTime ? "Yes" : "No") << endl;
  44. cout << "Gender: " << gender << endl;
  45.  
  46. return 0;
  47. }
Success #stdin #stdout 0s 5320KB
stdin
Aryan
1025
ECE
55000.75
2
1
M
stdout
Enter full name (one word): Enter employee ID: Enter department (one word): Enter salary: Enter years of experience: Is full-time? (1=Yes, 0=No): Enter gender (M/F/O): 
--- Employee Profile ---
Full Name: Aryan
Employee ID: 1025
Department: ECE
Salary: 55000.8
Experience: 2 years
Full-time Status: Yes
Gender: M