Purchase Solution

Desk Check Algorithm

Not what you're looking for?

Ask Custom Question

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:
- Leaded gas: $4.00/gallon
- Unleaded gas: $4.50/gallon
- 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

If leaded gas only
Gallons_of_gas_purchased * cost_of_leaded_gas = cost_1
cost_1 * fedtax = cost_2
cost_2 * statetax = cost_3

If unleaded gas only
Gallons_of_gas_purchased * cost_of_unleaded_gas = cost_4
cost_4 * fedtax = cost_5
cost_5 * statetax = cost_6

If gas_n_go leaded
cost_2 + gas_n_go = cost_7
cost_7 * statetax = cost_8

If gas n go unleaded
cost_5 + gas_n_go = cost_9
cost_9 * statetax = cost_10

If full service leaded
cost_2 + fullservice = cost_11
cost_11 * statetax = cost_12

If full service unleaded
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 Leaded gas to 4.00

Initlalize Unleaded gas to 4.50

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
Read the input choice
Case of choice
1 Call LeadedGas()
2 Call UnleadedGas();
End case
end
//LeadedGas method
begin
Declare total
Calculate total= Leaded gas + Federal gas tax + Gas-n-Go service charge + Full-Service charge + State sales tax;
Return total
End

//method UnleadedGas
begin
Declare total
Calculate total= Unleaded gas + Federal gas tax + Gas-n-Go service charge + Full-Service charge + State sales tax;
Return total
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.

Purchase this Solution

Solution Summary

This solution provides a desk check algorithm.

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Basic Networking Questions

This quiz consists of some basic networking questions.

C# variables and classes

This quiz contains questions about C# classes and variables.

C++ Operators

This quiz tests a student's knowledge about C++ operators.