Advertisement
khisby

[Soal4]Cylinder's_color_code_name

Oct 9th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.12 KB | None | 0 0
  1. // Khisby Al Ghofari, 06.2017.1.06852, Kelas B
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     string letter,color,gas;
  9.     cout << "\n===============================================\n";
  10.     cout << "Welcome To \n";
  11.     cout << "Application Cylinder's Color Code Name and Gas\n";
  12.     cout << "=================================================\n \n";
  13.  
  14.     cout << "Choose your Cylinder Gas Color\n";
  15.     cout << "Orange, Brown, Yellow, Green \n\n";
  16.     cout << "Input the first letter of cylinder color : ";
  17.     cin >> letter;
  18.  
  19.     if(letter == "o" or letter == "O"){
  20.         color = "Orange";
  21.         gas = "Ammonia";
  22.     }else if(letter == "b" or letter == "B"){
  23.         color = "Brown";
  24.         gas = "Carbon Monoxide";
  25.     }else if(letter == "y" or letter == "Y"){
  26.         color = "Yellow";
  27.         gas = "Hydrogen";
  28.     }else if(letter == "g" or letter == "G"){
  29.         color = "Green";
  30.         gas = "Oxygen";
  31.     }else{
  32.         cout << "Your input is invalid";
  33.         return 0;
  34.     }
  35.  
  36.     cout << "\n\nThe color of your letter code is " << color << " and the gas is " << gas << "\n\n\n";
  37.  
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement