QP2 - Hint: This will involve using an if statement. Also,...

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

View Full Document Right Arrow Icon
Quiz Program #2 Program Description You will add to your program from quiz program #1. In this program, instead of setting up constants for the price of lemon and sugar, add these as variables and read them in from the user, in particular, these two values will be entered in cents, not dollars. It's possible that when all is said and done, you will not have turned a profit. If this is the case, instead of outputting a statement similar to the following: Your profit for selling a pitcher of lemonade was $-3.00. you should output the following statement instead: Your loss for selling a pitcher of lemonade was $3.00.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Hint: This will involve using an if statement. Also, remember in the case of printing out your loss that you should not print a negative number. Sample Run (User input in bold and italics) What is the price of a lemon, in cents? 10 What is the price of a bag of sugar, in cents? 125 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