Advertisement
Guest User

Untitled

a guest
May 26th, 2015
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6.  
  7. string Destination;
  8. string Avsluta;
  9. int x;
  10.  
  11. cout << "Detta program ber\x84knar biljettpriset f\x94r dig som vill resa \ntill Kiruna eller Levi. Normalpriset till Kiruna \x84r 2400 kr, till Levi 2000 kr."<< endl;
  12. cout << "\nAnge resm\x86l: ";
  13. cin >> Destination;
  14. do{
  15. if (Destination == "Kiruna") {
  16. cout << "\nAnge \x86lder: ";
  17. cin >> x;
  18. if (x <= 17){
  19. cout << "\nResan kostar 1200kr";
  20. }
  21. else if (x > 17 && x < 65){
  22. cout << "\nResan kostar 2400kr";
  23. }
  24. else if (x > 64){
  25. cout << "\nresan kostar 600kr";
  26. }
  27.  
  28.  
  29.  
  30. }
  31. else if (Destination == "Levi") {
  32. cout << "\nAnge \x86lder: ";
  33. cin >> x;
  34. if (x <= 17){
  35. cout << "\nResan kostar 1000kr";
  36. }
  37. else if (x > 17 && x < 65){
  38. cout << "\nResan kostar 2000kr";
  39. }
  40. else if (x > 64){
  41. cout << "\nresan kostar 500kr"<< endl;
  42. }
  43.  
  44.  
  45.  
  46. }
  47. else{
  48. cout << "OBS! Ange korrekt resmx86l!";
  49. }
  50.  
  51. cout << "\n \nForts\x84tt med 'Enter' avsluta med 'q'. ";
  52. cin >> Avsluta;
  53.  
  54. }
  55. while(Avsluta.compare("q") != 0);
  56.  
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement