Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- using namespace std;
- int main() {
- int garden();
- //Lawn
- int lawnLength;
- int lawnWidth;
- int lawnTime = 20;
- cout << "Length of lawn required: "; // Asks for the length
- cin >> lawnLength; // Writes to variable
- cout << "Width of lawn required: "; // Asks for the width
- cin >> lawnWidth; // Writes to variable
- int lawnArea = (lawnLength * lawnWidth); //Calculates the total area
- cout << endl << "Area of lawn required is " << lawnArea << " square meters"; //Prints the total area
- cout << endl << "This will cost a total of " << (lawnArea * 15.50) << " pounds"; //Prints the total cost
- cout << endl << "This will take a total of " << (lawnArea * lawnTime) << " minutes" << endl << endl; //Prints total time
- //Concrete Patio
- int concreteLength;
- int concreteWidth;
- int concreteTime = 20;
- cout << "Length of concrete required: "; // Asks for the length
- cin >> concreteLength; // Writes to variable
- cout << "Width of concrete required: "; // Asks for the width
- cin >> concreteWidth; // Writes to variable
- int concreteArea = (concreteLength * concreteWidth); //Calculates the total area
- cout << endl << "Area of concrete required is " << concreteArea << " square meters"; //Prints the total area
- cout << endl << "This will cost a total of " << (concreteArea * 20.99) << " pounds"; //Prints the total cost
- cout << endl << "This will take a total of " << (concreteArea * concreteTime) << " minutes" << endl << endl; //Prints total time
- //Wooden Deck
- int woodenDeckLength;
- int woodenDeckWidth;
- int woodenDeckTime = 30;
- cout << "Length of wooden deck required: "; // Asks for the length
- cin >> woodenDeckLength; // Writes to variable
- cout << "Width of wooden deck required: "; // Asks for the width
- cin >> woodenDeckWidth; // Writes to variable
- int woodenDeckArea = (woodenDeckLength * woodenDeckWidth); //Calculates the total area
- cout << endl << "Area of wooden deck required is " << woodenDeckArea << " square meters"; //Prints the total area
- cout << endl << "This will cost a total of " << (woodenDeckArea * 15.75) << " pounds"; //Prints the total cost
- cout << endl << "This will take a total of " << (woodenDeckArea * woodenDeckTime) << " minutes" << endl << endl; //Prints total time
- //Rectangular Pond
- int rectangularPondLength;
- int rectangularPondWidth;
- int rectangularPondTime = 45;
- cout << "Length of rectangular pond required: "; // Asks for the length
- cin >> rectangularPondLength; // Writes to variable
- cout << "Width of rectangular pond required: "; // Asks for the width
- cin >> rectangularPondWidth; // Writes to variable
- int rectangularPondArea = (rectangularPondLength * rectangularPondWidth); //Calculates the total area
- cout << endl << "Area of rectangular pond required is " << rectangularPondArea << " square meters"; //Prints the total area
- cout << endl << "This will cost a total of " << (rectangularPondArea * 25.00) << " pounds"; //Prints the total cost
- cout << endl << "This will take a total of " << (rectangularPondArea * rectangularPondTime) << " minutes" << endl << endl; //Prints total time
- //Water Features
- int waterFeatures;
- int waterFeaturesTime = 60;
- cout << "Number of water features required: "; // Asks for the amount of water features needed
- cin >> waterFeatures; // Writes to variable
- cout << endl << "Number of water feature(s) required is " << waterFeatures << " water feature(s)"; //Prints the total area
- cout << endl << "This will cost a total of " << (waterFeatures * 150.00) << " pounds"; //Prints the total cost
- cout << endl << "This will take a total of " << (waterFeatures * waterFeaturesTime) << " minutes" << endl << endl; //Prints total time
- //Garden Lights
- int gardenLights;
- int gardenLightsTime = 10;
- cout << "Number of garden lights required: "; // Asks for the amount of water features needed
- cin >> gardenLights; // Writes to variable
- cout << endl << "Number of garden light(s) required is " << gardenLights << " garden light(s)"; //Prints the total area
- cout << endl << "This will cost a total of " << (gardenLights * 5.00) << " pounds"; //Prints the total cost
- cout << endl << "This will take a total of " << (gardenLights* gardenLightsTime) << " minutes" << endl << endl; //Prints total time
- //Quotation
- string quotation;
- cout << "Do you want to save a quotation? " << endl; //Asks if they want to save a quotation
- cin >> quotation; //Saves if they want to save a quotation or not
- if (quotation == "yes")
- // open a file in write mode.
- ofstream outfile;
- outfile.open("quotations.txt");
- // write inputted data into the file.
- outfile << data << endl;
- outfile << data << endl;
- // close the opened file.
- outfile.close();
- // cout << "Quotation saved." << endl;
- //else
- // cout << "Quotation not saved." << endl;
- //cin.ignore( numeric_limits<streamsize>::max(), '\n' );
- //cin.ignore( numeric_limits<streamsize>::max(), '\n' );
- //return 0;
- //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement