Advertisement
Guest User

Beginning C++ programming with Frank on Udemy

a guest
Sep 19th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.01 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.    
  7.     int required_rooms {0};
  8.     const int tax_rate {6};
  9.    
  10.         cout << "Hello, Welcome to Andy's rooms to spare" << endl;
  11.         cout << "=======================================" << endl;
  12.         cout << "\nHow meny rooms do you require? ";
  13.        
  14.         cin  >> required_rooms;
  15.        
  16.         cout << "\nYou require: " << required_rooms << " rooms" << endl;
  17.        
  18.         double price_per_room {25.99};
  19.        
  20.         cout << endl;
  21.        
  22.         cout << "\nPrice per room: $" << price_per_room << endl;
  23.         cout << "\nCost for: " << required_rooms << " rooms $" << (required_rooms * price_per_room) << endl;
  24.         cout << "\nTotal Tax: $" <<  (required_rooms * price_per_room /100 * tax_rate) << endl;
  25.         cout << "\nTotal Price for " << required_rooms << " rooms: $" << (required_rooms * price_per_room) + (required_rooms * price_per_room /100 * tax_rate) << endl;
  26.         cout << "\nThis is vaild for " << 30 << " days" << endl;
  27.        
  28.         cout <<"\n=======================================";
  29.        
  30.         cout << endl;  
  31.    
  32.         return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement