fork download
  1. #include <iostream>
  2.  
  3. #define some_missing_condition false
  4.  
  5. int main()
  6. {
  7. if (some_missing_condition) {
  8. // Choosing program to run
  9. int programChoice;
  10. std::cout << "Which program would you like to run?" << std::endl;
  11. std::cout << "Enter 1 for celcius to farenheit converter" << std::endl;
  12. std::cout << "Enter 2 for speed, distance and time calculator\n> ";
  13. std::cin >> programChoice;
  14. if (programChoice == 1) {
  15. // Temperature converter program
  16. double ctemp, ftemp;
  17. std::cout << "Please enter a celcius temperature\n> ";
  18. std::cin >> ctemp;
  19. ftemp = (ctemp * 1.8) + 32;
  20. std::cout << ctemp << " = " << ftemp << " degrees farenheit" << std::endl;
  21.  
  22. // End 1
  23. return 0;
  24. } else if (programChoice == 2) {
  25. std::string sdtchoice;
  26. std::cout << "WIP!" << std::endl;
  27. std::cout << "Do you want to find speed, distance or time?" << std::endl;
  28. std::cout << "Type S, D or T\n> ";
  29. getline(std::cin, sdtchoice); // Why does it skip this bit and go to end 2 below?
  30. if (sdtchoice == "S") {
  31. std::cout << "Test\n";
  32. double dvalue1, tvalue1;
  33. std::cout << "Please enter a value for Distance\n> ";
  34. std::cin >> dvalue1;
  35. std::cout << "Please enter a value for Time\n> ";
  36. std::cin >> tvalue1;
  37.  
  38. int totalvalue1 = 0;
  39.  
  40. std::cout << dvalue1 / tvalue1 << std::endl;
  41. std::cout << totalvalue1 << std::endl;
  42.  
  43. // End 2 // Program skips to here
  44. return 0;
  45. }
  46. } else
  47. std::cout << "Invallid entry" << std::endl;
  48.  
  49. // End 3
  50. return 0;
  51. }
  52. else {
  53. std::cout << "Incorrect" << std::endl << "Program closing" << std::endl;
  54.  
  55. // End 4
  56. return 0;
  57. }
  58. }
  59.  
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
Incorrect
Program closing