Purchase Solution

Program Source Code for C#

Not what you're looking for?

Ask Custom Question

There are 2 parts to this request.

I need a program source code in C# for this algorithm and a high level view of the solution. Original info is at the end.

Algorithm:

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

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 program source code for C#.

Purchase this Solution


Free BrainMass Quizzes
Javscript Basics

Quiz on basics of javascript programming language.

Excel Introductory Quiz

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

Basic Networking Questions

This quiz consists of some basic networking questions.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.