Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the Online Ct+ Compiler: https://www.onlinegdb.com/online ct+ compiler Delete all the existing code from main.cpp. You will write the code in the file main.cpp. An

image text in transcribed
image text in transcribed
image text in transcribed
Use the Online Ct+ Compiler: https://www.onlinegdb.com/online ct+ compiler Delete all the existing code from main.cpp. You will write the code in the file main.cpp. An online shop selling products calculates shipping charges on items purchased by each customer based on the membership's status and the number of items purchased as it follows. If the number of items purchased is less than 10, then the shipping charges are Dirhams 4 per item. if the number of items purchased is at least. 10, but less than 20 then the shipping charges are Dirhams 2 for each item bought if the number of items bought is at least 20. then the shipping charges are Dirhams 1 for each item bought. For customers with 'active' membership, there are additional deductions on the total shipping charges that are calculated based on the number of items bought as shown in the table below. There are no deductions on the total shipping charges for customers with inactive' membership status. Write a C++ program that calculates the total shipping charges a customer has to pay based on his/her membership status and the number of items bought. You may use either a blend of multiple (and probably nested iffelse statements) or iffelse in combination with switch statements. Safpple input / Output: Enter number of items purchased: 10 Enter memberahip status (A or a for active nembership, i or I for inactive membership:' a your membership is active. You have bought 10 items, shipping cost is Dirhams 18 Fiter number of items purchased: 25 Enter membership status (A or a for active membership, i or I for inactive membership: i. your membership is inactive. You have bought 25 items. shipping cost is Dirhams 25 your memborahip is inactive. You have bought 25 itens. shippind cost is Dirhams 25 Enter number of iteme purchased: 5 Enter memborship status (A or a for active memberahip, I or I for inactive membership: your memberahip is active. You have bought 5 items. shipping cost is Dirhams 19

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_2

Step: 3

blur-text-image_3

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

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions