Running head: TIP CALCULATION PROGRAM

Running head: TIP CALCULATION PROGRAM

Tip Calculation Program

Dale Lappin

IT210

July 13, 2012

Dan Reddy

TIP CALCULATION PROGRAM

Analysis Section:

1.
2.
3.
4.

Input:

Bill Amount
Tip Percent

Output:

Total Cost

Receive the input from the user
Calculate the tip amount
Calculate total cost
Display the results

(float: > 0.00)
(integer: > 0)

(float: > 0.00)

Input
Name: BillAmount
Type: float
Range: > 0.00

Name:
Type:
Range:
Name:
Type:
Range:
Name:
Type:
Range:

TipPercent
Integer
>0
TotalCost
float
> 0.00
TotalCost
float
> 0.00

Processes
1. InputData

2. CalculateCost

3.DisplayResults

Output
Name: BillAmount
Type: float
Range: > 0.00

Name:
Type:
Range:
Name:
Type:
Range:
Name:
Type:
Range:

TipPercent
Integer
>0
Totalcost
float
> 0.00
Totalcost (Display)
float
> 0.00

Design:

Main Module
Declare BillAmount as float
Declare TipPercent as integer

Call InputData
Call CalculateCost
Call DisplayResults
End Main Module

InputData
Write, “What is the amount of your bill?”
Input BillAmount

Write, “What percent will you be leaving as a tip?”
Input TipPercent
End InputData

CalculateCost
TotalCost = BillAmount * (TipPercent / 100)
End CalculateCost

DisplayResults
Display “The total cost including tip is $” TotalCost
End DisplayResults

Leave a Reply