Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

Question
The language is C++. The picture is my program and and the bottom it shows my output. I need the output to look like the other picture and the numbers on top includes the input for the number of people, the average slice each person would eat and the cost of each pizza. I want any number to work for this program so what exactly am i doing wrong that my output is coming out like that.
main.cpp
8
9 #include <iostream>
10 #include <iomanip>
11 #include <cmath>
12 using namespace std;
13
14 int main() {
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//Constants and Variables
int numOfPeople 0;
int pizza;
double avgSlices = 0.0, costOfPizza 0.0;
double TAX_RATE=0.07, DELIVERY_FEE = 0.2;
double subTotal = 0.0, total = 0.0, weekTotal = 0.0, tax = 0.0, fee = 0.0;
double deliveryCost = 0.0;
//Input for Friday
cin >> numOfPeople >> avgSlices >> costOfPizza >> pizza;
44 }
45
//Calculate
subTotal = (numOfPeople avgSlices costOfPizza) / 8;
tax = subTotal * TAX_RATE;
deliveryCost = tax+ DELIVERY_FEE;
total
subTotal + deliveryCost;
pizza = ceil((numOfPeople* avgSlices) / 8);
//Output for Friday
cout << "Friday Night Party" << endl;
cout << fixed << setprecision (2) << subTotal << tax << fee <<< total;
cout << fixed <<setprecision(0) << pizza;
cout << pizza <<< " Pizzas: "
subTotal << endl;
cout << "Tax: " << tax << endl;
cout << "Delivery:
cout << "Total: << total << endl;
return 0;
<< fee << endl;
input
Compiled Successfully. memory: 3568 time: 0.26 exit code: 0
Friday Night Party
34.122.390.0036.7144 Pizzas: 34
Tax: 2
Delivery: 0
Total: 37
ste
expand button
Transcribed Image Text:main.cpp 8 9 #include <iostream> 10 #include <iomanip> 11 #include <cmath> 12 using namespace std; 13 14 int main() { 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 //Constants and Variables int numOfPeople 0; int pizza; double avgSlices = 0.0, costOfPizza 0.0; double TAX_RATE=0.07, DELIVERY_FEE = 0.2; double subTotal = 0.0, total = 0.0, weekTotal = 0.0, tax = 0.0, fee = 0.0; double deliveryCost = 0.0; //Input for Friday cin >> numOfPeople >> avgSlices >> costOfPizza >> pizza; 44 } 45 //Calculate subTotal = (numOfPeople avgSlices costOfPizza) / 8; tax = subTotal * TAX_RATE; deliveryCost = tax+ DELIVERY_FEE; total subTotal + deliveryCost; pizza = ceil((numOfPeople* avgSlices) / 8); //Output for Friday cout << "Friday Night Party" << endl; cout << fixed << setprecision (2) << subTotal << tax << fee <<< total; cout << fixed <<setprecision(0) << pizza; cout << pizza <<< " Pizzas: " subTotal << endl; cout << "Tax: " << tax << endl; cout << "Delivery: cout << "Total: << total << endl; return 0; << fee << endl; input Compiled Successfully. memory: 3568 time: 0.26 exit code: 0 Friday Night Party 34.122.390.0036.7144 Pizzas: 34 Tax: 2 Delivery: 0 Total: 37 ste
10
2.6
The output is:
Friday Night Party
4 Pizzas: $42.00
Tax: $2.94
A
10.50
Delivery: $8.99
Total: $53.93
F2
9
F3
F4
%
5
expand button
Transcribed Image Text:10 2.6 The output is: Friday Night Party 4 Pizzas: $42.00 Tax: $2.94 A 10.50 Delivery: $8.99 Total: $53.93 F2 9 F3 F4 % 5
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education