Write a program that prompt the user to enter 2 items, if the user purchases bread and butter he will have 16 % discount. If the user purchases butter and flour he will get 20% discount. Otherwise, there is no discount. Your program should accept only 2 items and each item to be purchased only 1 time. Item Name Bread Flour 1 2 3 Price 24 35 Butter 40 Sample run1: Please enter your 2 items: 1 3 Your purchase is: bread butter You should pay: 53.76 Sample run2: Please enter your 2 items: 2 3 Your purchase is: flour butter You should pay: 60.0 Sample run3: Please enter your 2 items: 1 2 Your purchase is: bread flour You should pay: 59.0 Sample run4: Please enter your 2 items: 2 2 An item can be purchased only 1 time Sample run5: Please enter your 2 items: 3 1 Your purchase is: butter bread You should pay: 53.76
Write a program that prompt the user to enter 2 items, if the user purchases bread and butter he will have 16 % discount. If the user purchases butter and flour he will get 20% discount. Otherwise, there is no discount. Your program should accept only 2 items and each item to be purchased only 1 time. Item Name Bread Flour 1 2 3 Price 24 35 Butter 40 Sample run1: Please enter your 2 items: 1 3 Your purchase is: bread butter You should pay: 53.76 Sample run2: Please enter your 2 items: 2 3 Your purchase is: flour butter You should pay: 60.0 Sample run3: Please enter your 2 items: 1 2 Your purchase is: bread flour You should pay: 59.0 Sample run4: Please enter your 2 items: 2 2 An item can be purchased only 1 time Sample run5: Please enter your 2 items: 3 1 Your purchase is: butter bread You should pay: 53.76
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter4: Control Structures I (selection)
Section: Chapter Questions
Problem 20PE: The cost of renting a room at a hotel is, say $100.00 per night. For special occasions, such as a...
Related questions
Question
Hello! Please I want this problem written in Java programming language
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 5 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,