# QP1 - second and third into doubles. 3) Calculates the...

This preview shows page 1. Sign up to view the full content.

Quiz Program #1 Program Description You are running a lemonade stand and want a program to determine the profit you will make from selling one pitcher of lemonade. Your costs are the cost of buying lemons and sugar. Namely, set up constants in your program as follows for these items: #define LEMON_PRICE 0.10 #define SUGAR_PRICE 1.25 #define CUPS_PER_PITCHER 8 (Note: These prices are in dollars.) Write a program that does the following steps: 1) Prompts the user for the following information: a) The number of lemons it takes to make a pitcher of lemonade. b) The number of bags of sugar it takes to make a pitcher of lemonade. c) The selling price of a cup of lemonade (in dollars) 2) Read in each piece of information into a separate variable. The first into an integer, the
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: second and third into doubles. 3) Calculates the profit made from selling a pitcher of lemonade, to two decimal places. (This can be broken down into calculating the income from selling a pitcher of lemonade and subtracting out the cost of making it.) 4) Prints out this value to the screen. Note: Steps 1 and 2 are intertwined. Sample Run (User input in bold and italics) How many lemons did you use to make your pitcher of lemonade? 10 How many bags of sugar did you use to make your pitcher of lemonade? 0.2 How much did you sell a cup of lemonade for, in dollars? 0.50 Your profit for selling a pitcher of lemonade was \$2.75....
View Full Document

## This note was uploaded on 06/09/2011 for the course COP 3223 taught by Professor Guha during the Spring '08 term at University of Central Florida.

Ask a homework question - tutors are online