fork download
  1. #include <iostream>
  2. int main()
  3. {
  4. int hours:
  5. int moneyperweek;
  6. int hourssalary;
  7. std::cout<<"This program will show much you made this week.";
  8. std::cout<<"Please input the amount of hours you worked.";
  9. std::cin>>hours;
  10. std::cout<<"Please tell me your hours salary.";
  11. //the user input for hourssalary
  12. std::cin>>hourssalary
  13. {
  14. if
  15. {
  16. (hours<=40)
  17. moneyperweek = hours = hourssalary;
  18. {
  19. else
  20. {
  21. moneyperweek = hourssalary = (hours - 40) * 1.5;
  22. //converts the hourssalary and hours to money per week.
  23. std::cout<<"This is your money per week"<<moneyperweek;
  24. {
  25. return 0;
  26. {
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:4:12: error: expected initializer before ':' token
   int hours:
            ^
prog.cpp:9:13: error: 'hours' was not declared in this scope
   std::cin>>hours;
             ^
prog.cpp:13:3: error: expected ';' before '{' token
   {
   ^
prog.cpp:26:2: error: expected '}' at end of input
  {
  ^
stdout
Standard output is empty