Advertisement
Guest User

Untitled

a guest
Dec 19th, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.98 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <fstream>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. int garden();
  9.                    
  10.     //Lawn
  11.     int lawnLength;        
  12.     int lawnWidth;
  13.     int lawnTime = 20; 
  14.  
  15.     cout << "Length of lawn required: "; // Asks for the length
  16.     cin >> lawnLength; // Writes to variable
  17.     cout << "Width of lawn required: "; // Asks for the width
  18.     cin >> lawnWidth; // Writes to variable
  19.     int lawnArea = (lawnLength * lawnWidth); //Calculates the total area
  20.     cout << endl << "Area of lawn required is " << lawnArea << " square meters"; //Prints the total area
  21.     cout << endl << "This will cost a total of " << (lawnArea * 15.50) << " pounds"; //Prints the total cost
  22.     cout << endl << "This will take a total of " << (lawnArea * lawnTime) << " minutes" << endl << endl; //Prints total time
  23.  
  24.     //Concrete Patio
  25.     int concreteLength;        
  26.     int concreteWidth;
  27.     int concreteTime = 20; 
  28.  
  29.     cout << "Length of concrete required: "; // Asks for the length
  30.     cin >> concreteLength; // Writes to variable
  31.     cout << "Width of concrete required: "; // Asks for the width
  32.     cin >> concreteWidth; // Writes to variable
  33.     int concreteArea = (concreteLength * concreteWidth); //Calculates the total area
  34.     cout << endl << "Area of concrete required is " << concreteArea << " square meters"; //Prints the total area
  35.     cout << endl << "This will cost a total of " << (concreteArea * 20.99) << " pounds"; //Prints the total cost
  36.     cout << endl << "This will take a total of " << (concreteArea * concreteTime) << " minutes" << endl << endl; //Prints total time
  37.  
  38.     //Wooden Deck
  39.     int woodenDeckLength;          
  40.     int woodenDeckWidth;
  41.     int woodenDeckTime = 30;   
  42.  
  43.     cout << "Length of wooden deck required: "; // Asks for the length
  44.     cin >> woodenDeckLength; // Writes to variable
  45.     cout << "Width of wooden deck required: "; // Asks for the width
  46.     cin >> woodenDeckWidth; // Writes to variable
  47.     int woodenDeckArea = (woodenDeckLength * woodenDeckWidth); //Calculates the total area
  48.     cout << endl << "Area of wooden deck required is " << woodenDeckArea << " square meters"; //Prints the total area
  49.     cout << endl << "This will cost a total of " << (woodenDeckArea * 15.75) << " pounds"; //Prints the total cost
  50.     cout << endl << "This will take a total of " << (woodenDeckArea * woodenDeckTime) << " minutes" << endl << endl; //Prints total time
  51.  
  52.     //Rectangular Pond
  53.     int rectangularPondLength;         
  54.     int rectangularPondWidth;
  55.     int rectangularPondTime = 45;  
  56.  
  57.     cout << "Length of rectangular pond required: "; // Asks for the length
  58.     cin >> rectangularPondLength; // Writes to variable
  59.     cout << "Width of rectangular pond required: "; // Asks for the width
  60.     cin >> rectangularPondWidth; // Writes to variable
  61.     int rectangularPondArea = (rectangularPondLength * rectangularPondWidth); //Calculates the total area
  62.     cout << endl << "Area of rectangular pond required is " << rectangularPondArea << " square meters"; //Prints the total area
  63.     cout << endl << "This will cost a total of " << (rectangularPondArea * 25.00) << " pounds"; //Prints the total cost
  64.     cout << endl << "This will take a total of " << (rectangularPondArea * rectangularPondTime) << " minutes" << endl << endl; //Prints total time
  65.  
  66.     //Water Features
  67.     int waterFeatures;         
  68.     int waterFeaturesTime = 60;
  69.  
  70.     cout << "Number of water features required: "; // Asks for the amount of water features needed
  71.     cin >> waterFeatures; // Writes to variable
  72.     cout << endl << "Number of water feature(s) required is " << waterFeatures << " water feature(s)"; //Prints the total area
  73.     cout << endl << "This will cost a total of " << (waterFeatures * 150.00) << " pounds"; //Prints the total cost
  74.     cout << endl << "This will take a total of " << (waterFeatures * waterFeaturesTime) << " minutes" << endl << endl; //Prints total time
  75.  
  76.     //Garden Lights
  77.     int gardenLights;          
  78.     int gardenLightsTime = 10; 
  79.  
  80.     cout << "Number of garden lights required: "; // Asks for the amount of water features needed
  81.     cin >> gardenLights; // Writes to variable
  82.     cout << endl << "Number of garden light(s) required is " << gardenLights << " garden light(s)"; //Prints the total area
  83.     cout << endl << "This will cost a total of " << (gardenLights * 5.00) << " pounds"; //Prints the total cost
  84.     cout << endl << "This will take a total of " << (gardenLights* gardenLightsTime) << " minutes" << endl << endl; //Prints total time
  85.  
  86.     //Quotation
  87.     string quotation;
  88.  
  89.     cout << "Do you want to save a quotation? " << endl; //Asks if they want to save a quotation
  90.     cin >> quotation; //Saves if they want to save a quotation or not
  91.  
  92.     if (quotation == "yes")
  93.     // open a file in write mode.
  94.    ofstream outfile;
  95.    outfile.open("quotations.txt");
  96.  
  97.    // write inputted data into the file.
  98.    outfile << data << endl;
  99.    outfile << data << endl;
  100.  
  101.    // close the opened file.
  102.    outfile.close();
  103.  
  104.  
  105.  
  106.  //   cout << "Quotation saved." << endl;
  107.     //else
  108.  //   cout << "Quotation not saved." << endl;
  109.  
  110.  
  111.     //cin.ignore( numeric_limits<streamsize>::max(), '\n' );
  112.     //cin.ignore( numeric_limits<streamsize>::max(), '\n' );
  113.     //return 0;
  114.     //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement