Sample Solution Algorithm to Determine Meal Charges

Topics: Algorithm, Mathematics, Output Pages: 3 (285 words) Published: January 19, 2012
Week 2 Activity – Meal Purchase

TCO #2– Given a simple business problem, design a solution algorithm that uses arithmetic expressions and built-in functions.

Your goal is to solve the following simple programming exercise. You have been contracted by a local restaurant to design an algorithm determining the total meal charges. The algorithm should ask the user for the total food purchase and the tip percent. Then, the algorithm will calculate the amount of a tip, a 7% sales tax, and the total meal charge (including tip). The food purchase, sales tax, tip amount, and total meal charge will need to be displayed to the customer.

Be sure to THINK about the logic and design first (IPO chart and pseudocode), then code the Visual Logic command line processing. Display all output using currency formatting (built-in Visual Logic function).

Advanced (optional): use a constants for the 7% sales tax.

When completed staple the following documents together neatly in 1,2,3,4 order:
This instruction sheet first
The IPO Chart, second
The Pseudocode, third
The Flowchart and output example last.

Point distribution for this application:
Meal Purchase
Points possible:
Points received
IPO Chart



Total Points

IPO Chart:

Enter Total Food Purchase Price

Calculate Food price
Add Tip %* Total Food Purchased
Add 7% tax * Total Food Purchased

Total Meal Charge


Begin mealPurchase

Total Food Purchased
Imput total Purchased Food Amount
Please enter the amount for tip percent
Imput tip percent
Set total tip = tip percent/ 100
Set total tip=total tip *
Total food purchased amount
Set total tax= sales tax/100
Set total tax= total tax* = total food purchased amount



Example Output after execution:
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • Algorithm Essay
  • Experiment to Determine the Presence of Electrostatic Charges Essay
  • Essay on algorithm
  • Algorithm Essay
  • Algorithms Essay
  • Solution ACC2200 Essay
  • Sample Essay
  • sample Essay

Become a StudyMode Member

Sign Up - It's Free