Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C language not C++ Write a modular C program for a take-out store that sells 5 items. The program will a) Ask for the

image text in transcribed
image text in transcribed
Using C language not C++
Write a modular C program for a take-out store that sells 5 items. The program will a) Ask for the customer's name b) Display a menu of five item names and the unit prices. c) Accept a customer's order of at least one item and its quantity. A customer may order any number of items and in any sequence from the menu. The customer quits his order list by typing a sentinel value. d) Print the order list stating the customer's name, each item ordered, its unit price, quantity ordered, RM ordered, and the total amount to be paid. The program will must have AT LEAST i a 1D array to store the customer's name, declared in main0, ii) a 2D array to store the item names, declared (and initialized) as a global identifier ii) a 1D array to store the unit prices of the items, declared (and initialized) as a global identifier a2D array, named ordersMade[Il, to store the customer's orders i.e. the item number or menu choice chosen (first column) and its quantity ordered (second column), declared in GetOrders). Note: iv) A customer can ordered more than one item (not necessarily in the sequence as listed in the menu). However, he can only order an item one time. Hence, he carn order at most all 5 items. Each item ordered must be stored its item number and quantity ordered in ordersMadeUlI. a1D array, named amtRMII, to store the amount in RM of each item ordered. This array is to be declared in CalculateAmt0) a constant defined for the GST rate of 6% v) vi) The program must contain the following functions: 1. main0 Asks for the customer's name and store in a 1D array .Calls DisplayMenu(). No parameter is required. .Calls GetOrders) with customer's name array as its parameter 2. DisplayMenu) Displays the menu of item names and the unit prices. No value is returned to main 3. GetOrders() .Prompts and gets the menu choice and quantity ordered from the customer Stores each menu choice and quantity into ordersMadelll to store customer's orders. .Repeat asking for the customer's next order untill the customer stops his order list Calls CalculateAmt(). Its parameters are ordersMadeIl, customer's name array, and number of items ordered. Displays the total amount ordered, GST amount, and total amount to be paid Displays a "thank you" at the bottom of the bill

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

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions