Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. {
  2.  
  3. cout << "Enter a two characters (one letter and one number): ";
  4. char major;
  5. int year;
  6. cin >> major;
  7.  
  8. string major_in, major_out;
  9. string year_in, year_out;
  10.  
  11. string a = "freshman";
  12. string b = "sophomore";
  13. string c = "junior";
  14. string d = "senior";
  15. string M = "Mathematics";
  16. string C = "Computer Science";
  17. string I = "Information Technology";
  18.  
  19. if (major_in == "M") major_out == M;
  20. else if (major_in == "C") major_out == C;
  21. else if (major_in == "I") major_out == I;
  22.  
  23. if (year_in == "1") year_out == a;
  24. else if (year_in == "2") year_out == b;
  25. else if (year_in == "3") year_out == c;
  26. else if (year_in == "4") year_out == d;
  27.  
  28. cout << major_out << endl;
  29.  
  30. return 0;
  31.  
  32. }
  33.  
  34. cout<<major_out ” “ year_out<< endl
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement