Lab Exercise 3 COMP 248 Due date: Today, at the end of the lab period. Read this entire document before beginning your l
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Lab Exercise 3 COMP 248 Due date: Today, at the end of the lab period. Read this entire document before beginning your l
Question: Today you are commissioned to write a Java program that will prompt for and read 3 double values as d1, d2, and d3 that are entered by the user and determine what discount the user may have. Be sure to use the same format and wording as in the sample runs in the table below. Note that for each user, only one type of discount would apply. 1) If the total purchase amount (d1+d2+d3) is greater or equal to $200, display "You can enjoy 15% off." 2) If 1) does not satisfy, check if the total purchase amount is greater or equal to $180, if so display "You can enjoy 12%." 3) If both 1) and 2) do not satisfy, continue to check if any of d1, d2, and d3 is greater than or equal to 100, if so, display "You can enjoy 10% off.". 4) If all of 1), 2) and 3) do not satisfy, continue to check if the sum of any two prices is greater than or equal to $150, if so display "You can enjoy 8% off.”. 5) If all the above discount criteria do not satisfy, then display "No discount!". The box below illustrates how your program should behave and appear. REMEMBER in the output: • is a space and is a new line. Text in green is user input Enter the prices: 1002020 Enter the prices: 01001001001 고 You can enjoy º 15% off. You can enjoy º 10% off. Enter the prices: 075.75.10 Enter the prices: 10.10.10 니 No discount ! You can enjoy .8% off. Enter the prices: 060060060 You can enjoy 12% off.
Lab Exercise 3 COMP 248 Due date: Today, at the end of the lab period. Read this entire document before beginning your lab. The Comp248LabManual is available on the Lab page of the course website. For this lab you are required to fulfill all requirements exactly as described in this provided document, no less, no more.