Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Christian Ballard
- //COSC 1330
- //Problem 11 Calculates and displays the number of single rolls of wallpaper needed to cover a room
- #include <iostream>
- using namespace std;
- int main()
- {
- //Declarations
- double length = 0.0;
- double width = 0.0;
- double height = 0.0;
- double rollSqrft = 0.0;
- double numRolls = 0.0;
- double totalArea = 0.0;
- //Inputs
- cout << "What is the length of the room?" << endl;
- cin >> length;
- cout << "What is the width of the room?" << endl;
- cin >> width;
- cout << "What is the height of the room?" << endl;
- cin >> height;
- cout << "How many square feet will a single roll cover?" << endl;
- cin >> rollSqrft;
- //Calculations
- totalArea = (length+width+height)*rollSqrft;
- numRolls = (totalArea/rollSqrft);
- //Output
- cout << "Number of Single Rolls" << endl << numRolls << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment