Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C language (printf not < >) The first thing the program needs to do is to display a menu, with the name of my

In C language (printf not <>)

The first thing the program needs to do is to display a menu, with the name of my business, the word Menu and a list of items and prices.

The price for my items is shown below. Put these amounts in constants and use the constants throughout the program:

Hot Dogs - $1.50

Chips - $.75

Drinks - $1.25

After displaying the menu, the program needs to ask the customer how many of each item they would like to purchase (Input)

Then the program needs to calculate the various amounts that will be displayed on the receipt (Process)

Finally, the program needs to display the receipt (Output). The receipt should show how many of each item was purchased and the amount for that many items. Then the receipt needs to show the sub-total for the bill. Tax is calculated based on the sub-total. We are currently charging 8% sales tax put that value in a constant and use the constant in the program. Calculate the amount of sales tax and display both the sales tax percent and the amount. Finally, display the total amount the customer must pay for their food and drinks, and tell them Thank you for your order!.

Hints:

The menu is just a set of printf() statements

Use a tab ("\t") to correctly place the 1st line of the menu (GEORGES HOT DOGS)

Use tabs and spaces to place the remaining lines of the menu (use spaces between the item name and the dash before the price)

Follow the 3 steps of the Information Processing Cycle Input, Processing, and Output

Have a blank line after the menu, another blank line between the inputs and the output, and another blank line after the total

Use a tab to separate the item name column from the item price column in the receipt

Use dashes (-) to create the lines above the sub-total and the total

Use "%%" to display the percent sign And remember:

All variable names must be at least 2 words and in lower camelCase

Constant names are written in ALL_CAPS

Format all amounts to 2 decimal places (dollar and cents)

Dont forget the dollar sign before the amount

Format the sales tax percentage to 1 decimal place, and dont forget the percent sign

Separate your program output from the Press any key with a blank line

Example Run: (The numbers in bold will be the users input)

GEORGE'S HOT DOGS

*** MENU ***

Hot Dog - $1.50 Chips - $0.75 Drink - $1.25

How many hot dogs would you like? 3 How many bags of chips would you like? 1 How many drinks would you like? 2

Hot Dogs (3) $4.50 Chips (1) $0.75 Drinks (2) $2.50 ------------- ------- Sub-Total $x.xx Tax (@8.0%) $x.xx ---------------- ------ Total $x.xx

Thank you for your order!

The example run shows EXACTLY how your program input and output will look.

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

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

Determine the amplitude and period of each function.

Answered: 1 week ago