Explore BrainMass
Share

# Desk Check Algorithm

This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

This problem has three phases I need help with all three.

Here is the problem and below the problem is what I have and what I need more assistance with. I specifically need help with the 3rd point and any additional input for point 2.

Original problem is at the end of this post:

1. For each program module (component) that was in the simple algorithm that you developed last week, develop an algorithm in pseudo code that shows the tasks and subtasks of the module.

2. Desk check your algorithms using the following test values:
- Federal gas tax: \$0.10/gallon
- Gas-n-Go service charge: \$1.00
- Full-Service charge: \$2.00
- State sales tax: 5%

3. Create a desk check table to show the results of your desk check test.

Here is my simple algorithm

cost_1 * fedtax = cost_2
cost_2 * statetax = cost_3

cost_4 * fedtax = cost_5
cost_5 * statetax = cost_6

cost_2 + gas_n_go = cost_7
cost_7 * statetax = cost_8

cost_5 + gas_n_go = cost_9
cost_9 * statetax = cost_10

cost_2 + fullservice = cost_11
cost_11 * statetax = cost_12

cost_5 + fullservice = cost_13
cost_13 * statetax = cost_14

Here is step 1. (help from this site last week) ***Please add input if additions are needed

begin

Initlalize Federal gas tax to 0.10

Initlalize Gas-n-Go service charge to 1.00

Initlalize Full-Service charge 2.00

Initlalize State sales tax 0.05
Case of choice
End case
end
begin
Declare total
Calculate total= Leaded gas + Federal gas tax + Gas-n-Go service charge + Full-Service charge + State sales tax;
End

begin
Declare total
Calculate total= Unleaded gas + Federal gas tax + Gas-n-Go service charge + Full-Service charge + State sales tax;
end

***Need a desk check table for the above***

Original problem

develop a program that will calculate a customer's charges and total bill at the gasoline pump, taking into account the following:

o The per-gallon price for gas is determined by whether the customer purchases leaded or unleaded gasoline.

o A federal gasoline tax is applied to each gallon of gas, varying by whether the gas is leaded or unleaded.

o If the customers pump the gas themselves, there are no additional charges apart from state sales tax. If the customers do not pump the gas themselves, one of the following two service charges apply:

· Gas-n-Go charge: If the customer asks for Gas-n-Go (the station pumps the gas for the customer but performs no other service), a fixed service charge is applied to the bill. The charge does not vary by the amount of gas purchased; the price remains the same whether the customer purchases a half gallon of gas or 10 gallons.

· Full-Service charge: If the customer asks for Full-Service (the station pumps the gas, checks the oil, checks the air pressure in the tires, and cleans the car windows), a fixed charge is applied to the bill. The charge does not vary by the amount of gas purchased; the price remains the same whether the customer purchases a half gallon of gas or 10 gallons.

o A state sales tax is applied to the sum of all charges except for the federal gasoline tax.