fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6.  
  7. int HoursTaken, StudyHours, HoursSpent; // Seting integer names for the 2 var.
  8.  
  9.  
  10. cin >> HoursTaken; // Input value for student hours taken
  11. cout << "How many credit hours are you taking this semseter? " << HoursTaken << endl; // Out puts a question for the user to input an answer
  12.  
  13. StudyHours = HoursTaken * 3; // How many hours to study
  14.  
  15. cout << "Hours you need to study in a week: " << StudyHours << endl << endl; // outputs hours needs to study for the user
  16.  
  17.  
  18. cin >> HoursSpent;
  19.  
  20. StudyHours = StudyHours - HoursTaken;
  21.  
  22. cout << "How many hours do you spend studying in a week? " << HoursSpent << endl;
  23.  
  24. cout << "How many hours you should adjust: " << StudyHours << endl;
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. return 0;
  32. }
Success #stdin #stdout 0s 4252KB
stdin
2
3
stdout
How many credit hours are you taking this semseter? 2
Hours you need to study in a week: 6

How many hours do you spend studying in a week? 3
How many hours you should adjust: 4