Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have my c++ code for the problem that is given below. But i need help to follow this instructions. I also need output when

I have my c++ code for the problem that is given below. But i need help to follow this instructions.

I also need output when the coupon is not used. There are no function prototypes. Also functions should appear at the end after the main body

in this exercise, you will modify the program that you createdin the chapter 6's lab 6-2. If necessary create a newproject named Intermediate21 oroject, and save it in the cpp8\Chap09 folder. copy the instructions from lab 6-2.cpp file into a source file named Intermediate21.cpp. Change the file name in the first commnet. Dodify the program so that it uses two value-returning functions: one to calculate and return the price of a medium pizza and the other to calculate and return the price of large pizza. In addition to the $2 coupon on the purchase of a large pizza. Sophia is now emailing a customers a $1 coupon on the purchase of a medium pizza. Test the program appropriately.

Here is the lab 6-2

image text in transcribed

Here is the code for this program:

#include #include using namespace std; double Medium() { char coupon = ' '; double price = 9.99; cout>coupon; if(toupper(coupon)=='Y') price -= 1; return price; } double Large() { char coupon = ' '; double price = 12.99; cout>coupon; if(toupper(coupon)=='Y') price -= 2; return price; } int main() { char size,coupon; double price =0.0; cout>size; size=toupper(size); if(size != 'M' && size != 'L') cout

Output:

M(edium) or L(arge) pizza? M $1 coupon (Y/N)? Y Price: $8.99

M(edium) or L(arge) pizza? L $2 coupon (Y/N)? Y Price: $10.99

This program is right but i need to include these things. Please help me.

I also need output when the coupon is not used. There are no function prototypes. Also functions should appear at the end after the main body

Lab 6-2 1 //Lab6-2.cpp displays the price of a pizza. 2 Created/revised by kyour name> on 5 #include 6 using namespace std; 8 int maino 9 f 10 char size 11 char coupon 12 double price 0.0 13 14 cout "Mcedium) or LCarge) pizza? 15 cin size; 16 size toupper (size) 18 if (size M' && size L') cout "Please enter either M or L end 19 20 else 21 22 if (size 'M') 23 price 9.99 else 25 large pizza 26 price 12.99 cout $2 coupon (Y/N)? 27 28 cin coupon; if (toupper (coupon) 'Y') 29 30 price 2; //end if 31 32 //end if

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions

Question

1. How do most insects respire ?

Answered: 1 week ago

Question

Who is known as the father of the indian constitution?

Answered: 1 week ago

Question

1.explain evaporation ?

Answered: 1 week ago

Question

Who was the first woman prime minister of india?

Answered: 1 week ago

Question

Explain the concept of going concern value in detail.

Answered: 1 week ago