Problem

Assuming the user enters 6 in response to the question, what will the following program...

Assuming the user enters 6 in response to the question, what will the following program display on the screen?

#include

using namespace std;

#define GREETING1 "This program calculates the number "

#define GREETING2 "of candy pieces sold."

#define QUESTION "How many jars of candy have you sold? "

#define RESULTS "The number of pieces sold: "

#define YOUR_COMMISSION "Candy pieces you get for commission: "

#define COMMISSION_RATE .20

int main()

{

const int PIECES_PER_JAR = 1860;

int jars, pieces;

double commission;

cout << GREETING1;

cout << GREETING2 << endl;

cout << QUESTION;

cin >> jars;

pieces = jars * PIECES_PER_JAR;

cout << RESULTS << pieces << endl;

commission = pieces * COMMISSION_RATE;

cout << YOUR_COMMISSION << commission << endl;

return 0;

}

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT