Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USE C++ AND DO NOT USE AND IF OR ELSE STATEMENTS USING C++ For THIS you CANNOT use any if else statement. You have to

image text in transcribed

USE C++ AND DO NOT USE AND IF OR ELSE STATEMENTS

USING C++ For THIS you CANNOT use any if else statement. You have to use switch case statements to solve it. Hint: It's not possible to check a condition in switch case. You can use mathematical operations to get a single value and use switch case Example 155/151_(High Price) Problem Definition: Write a program to decide the price group of a book. The user can type the price of a book. Your program has to decide which group the book belongs to. High price group consists of books which cost more than $150 Low price group consists of books which cost less than $50. Everything else belongs to the mid-price group Add necessary text before input for making the program user-friendly Sample Input: 151 Sample Output: This book belongs to the high price group Sample Input 50 Sample Output: This book belongs to the mid price group. Sample Input 34 Sample Output: This book belongs to the low price group For Extra Credit: The user can input the prices of multiple books separately. The program has to decide the price group for each book. After displaying the price group of a book user will enter 'c to continue with the program or 'e' to exit the program. The program will continue as long as the user does not choose to exit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

Students also viewed these Databases questions