SlideShare a Scribd company logo
1 of 9
Gas Pump Program
Team C
PRG-211
University of Phoenix
Due April 22, 2013
Jiming Liu
Gas Pump Program
Problem Statement
The required program will calculate charges incurred when a motorist uses an automated gas
pump. The system will need to take input from the user as to what type of gas they want. The have
options of regular and premium; charges per gallon should be calculated based on the user‟s selection.
The user should also be prompted for „Gas and go‟ or „Full Service‟. If the user selects „Full Service‟ or
„Gas and Go‟, a service charge is to be added for the attendant to pump the gas for the user. The user
must also have the option to pump the gas themselves without requesting additional service.
Top Level Algorithm
Input Data Module Processing Module Output Result
Module
Prompt User For:
SelectedGasType
SelectedServiceType
GasTypePremium
GasTypeRegularServiceChargeGasNGo
ServiceChargeFull
1. If
(SelectedGasType=”Premium”
and SelectedServiceType=”Full”)
Than
Set PurchaseAmt=GasTypePremium
+ ServiceChargeFull
Else If
(SelectedGasType=”Premium” and
SelectedServiceType=”GasNGo”)
Than
PurchaseAmt=GasTypePremium +
ServiceChargeGasNGo
Else If (SelectedGasType=”Regular”
and SelectedServiceType=”Full”)
Than
PurchaseAmt=GasTypeRegular +
ServiceChargeFull
Else If (SelectedGasType=”Regular”
and
SelectedServiceType=”GasNGo”)
Than
PurchaseAmt=GasTypeRegular +
ServiceChargeGasNGo
Else If
(SelectedGasType=”Premium” and
Write out:
GallonsPumped
PurchaseAmt
TotalPrice
SelectedServiceType=”None”) Than
PurchaseAmt=GasTypePremium
Else If
(SelectedGasType=”Regular” and
SelectedServiceType=”None”) Than
PurchaseAmt = GasTypeRegular
Else
Print “User input error. Please see
attendant”
2. Set SubTotal=PurchaseAmt *
StateSalesTax
3. Set TotalPrice=SubTotal +
(FedGasTax * PurchaseAmt)
Module Functions and Internal Structure
Service Selection
The main screen if not being used displays “Welcome to your neighborhood gas station!” The
system displays “Please select from the following: 1 – Gas and Go, 2 – Full Service, 3 – Self Service.”
If the user selects „gas and go‟ or „full service‟, the program will alert the station attendant and the pump
display reads “Please wait for station attendant” and the attendant will then finish fueling and making
selections.
Gas Selection
For service from attendant or if the user selects self-service, the display will read “Please select
gas type. 1-Premium or 2-Regular”. The program will store the user selection for use in later
calculations.
Pump Processing
The program will now display “Please remove nozzle and begin fueling.” Once calculations are
complete, the program adds the selected service charges for Full service or Gas and Go. Sales tax is
then calculated and added to this total. Finally, the system adds the untaxed federal gas tax based on the
type and amount of gasoline. Total is then calculated and displayed on the screen, along with “Have a
nice day!”
Program Pseudocode
1 //This program is designed to walk a customer through the purchase of service type and gasoline type
2 //then allowing the program to calculate the total based on those selections along with the federal
3 //and state taxes added in. (1.)
4 //Begin Main_Module (2.)
5 //This module declares all variables, sets prices, and calls all sub-modules.
6 Declare perGallonPriceRegular as integer
7 Declare perGallonPricePremium as integer
8 Declare serviceChargeFull as integer
9 Declare serviceChargeGasNGo as integer
10 Declare fedGasTax as integer
11 Declare salesTax as integer
12 Declare gallonsPumped as integer
13 Declare userSelection as string
14 Declare selectedServiceType as string
15 Declare selectedFuelType as string
16 Declare transactionTotal as string
17 Declare salesTaxSubtotal as string
18 Declare gasSubTotal as string
19 Declare selectedServiceType
20 Set perGallonPriceRegular=3.00
21 Set perGallonPricePremium=3.20
22 Set serviceChargeFull=2.00
23 Set serviceChargeGasNGo=1.00
24 Set fedGasTax=.10
25 Set salesTax=.05
26 Call Welcome_Message_Module
27 Call Service_Selection_Module
28 Call Fuel_Selection_Module
29 Call Calculations_Module
30 Begin Welcome_Message_Module (3.)
31 //Displays a short greeting for the customer at the chosen pump.
32 Write "Welcome to your neighborhood gas station."
33 End Welcome_Message_Module
34 Begin Service_Selection_Module (4.)
35 Write "Please select level of service."
36 Write "1-Full service, 2-Gas-n-Go, or 3-Self-service."
37 Input userSelection
38 If userSelection=1 Then
39 selectedServiceType="Full Service"
40 Write "The station attendant has been notified of your service request,
41 please stand by."
42 Else If userSelection=2 Then
43 selectedServiceType="Gas N' Go"
44 Write "The station attendant has been notified of your service request, please
45 stand by."
46 Else
47 selectedServiceType="Self Service"
48 End If
49 End Service_Selection_Module
50 Begin Fuel_Selection_Module (5.)
51 Write "Please select gas type: 1-Premium or 2-Regular"
52 Input selectedGasType
53 If selectedGasType=1 Then
54 Set dispGasType="Premium"
55 Set perGallonPrice=perGallonPricePremium
56 Else
57 Set dispGasType="Regular" And
58 Set perGallonPrice=perGallonPriceRegular
59 End If
60 Write "Please remove the pump and begin fueling."
61 Set gallonsPumped = 10
62 Write “Service Complete.”
63 End Fuel_Selection_Module
64 Begin Calculations_Module (6.)
65 Write "Your charges are as follows."
66 Set gasSubTotal=gallonsPumped * perGallonPrice //Calculate gas subtotal.
67 Write "Total charged for pumped gas:$" & gasSubTotal
68 Set fedTaxSubtotal=gallonsPumped * fedGasTax //Calculate gas tax before sales tax is applied.
69 Write "Federal gas tax:$" & fedTaxSubtotal
70 //Begin calculating transition total by starting with the service charge.
71 If selectedServiceType="Full Service" Then
72 Write selectedServiceType&":$"&serviceChargeFull
73 Set transactionTotal=serviceChargeFull
74 Else
75 Write selectedServiceType&":$"&serviceChargeGasNGo
76 Set transactionTotal=serviceChargeGasNGo
77 End If
78 Set transactionTotal=transactionTotal+gasSubTotal //Add gas subtotal to service charge. (7.)
79 Set salesTaxSubtotal = transactionTotal * salesTax //Calculate sales tax for gas and service.
80 Write "Sales Tax: $" & salesTaxSubtotal
81 Set transactionTotal=transactionTotal+salesTaxSubtotal+fedTaxSubtotal
82 //Add sales tax and fed tax to running total.
83 Write "Total Charges:$" &transactionTotal
84 Write "Have a nice day!"
Documentation of Tasks and Subtasks
Sequential numbers in the pseudo-code will correspond to this list.
1. Statement to give a quick overview of what the program sets out to accomplish.
2. This is the beginning of the main module where we declare our integers, floats, and strings. This puts in our
“Write” statements, “Sets” our figures with pricing and taxes to be added, and “Calls” the modules.
3. This quick message module will display at the pump when a customer initiates a fuel purchase.
4. This is the service selection module. It starts out with prompting the user on their service selection for either
full, gas n‟ go or self-service. Next, an If-Then-Else statement will walk the program through those selections to
make sure they are stored for the calculations module.
5. The user now chooses between premium and regular. Another If-Then-Else statement will walk the program
through the choices again and store them for later use in the calculations module.
6. The beginning of the calculations module will start with showing the customer their charges. The inputs the
program will take into consideration are Premium=$3.20/gal., Regular=$3.00/gal., Full service charge=$2.00, Gas
n‟ Go charge=$1.00, Federal gas tax= .10 cents/gal., and State tax charge= 5% or .05 for the purposes of the
pseudocode.
7. All the calculations are processed within this module to give the user their final value base on their previous
choices through a series of If-Then-Else statements and Set statements that involve the mathematical portion.
7
Desk Check for Team C Final Project gallonsPumped = 10 salesTax = .05
serviceChargeFull = 2.00
fedGasTax = .10
Inputs: User selects 'full service', pumps 10 gallons of premium gas. perGallonChargePremium = 3.20
Expected Output: gasSubTotal = ( 10 * 3.20 ) 32.00$
fedTaxSubtotal = ( 10 * .10 ) 1.00$
salesTaxSubtotal = ( (2.00 + 32.00) * .05 ) 1.70$
transactionTotal = ( 32 + 1 + 1.70 + 2.00) 36.70$
Line # userSelection selectedServiceType selectedGasType perGallonPrice gallonsPumped gasSubTotal fedTaxSubtotal transactionTotal salesTaxSubtotal Input/output
39 1
41 "Full Service"
54 1
57 3.2
63 10
68 32
69 "Total charged for pumped gas:$32.00"
70 1
71 "Federal gas tax:$1.00"
74 "Full Service :$2.00"
75 2
80 34
81 1.7
82 "Sales Tax: $1.70"
83 36.7
85 "Total charges:$36.70"
PASS
gallonsPumped = 10 salesTax = .05
serviceChargeFull = 2.00
fedGasTax = .10
Inputs: User selects 'full service', pumps 10 gallons of regular gas. perGallonChargeRegular = 3.00
Expected Output: gasSubTotal = ( 10 * 3.00 ) 30.00$
fedTaxSubtotal = ( 10 * .10 ) 1.00$
salesTaxSubtotal = ( (2.00 + 30.00) * .05 ) 1.60$
transactionTotal = ( 30 + 1 + 1.60 + 2.00) 34.60$
Line # userSelection selectedServiceType selectedGasType perGallonPrice gallonsPumped gasSubTotal fedTaxSubtotal transactionTotal salesTaxSubtotal Input/output
39 1
41 "Full Service"
54 2
60 3
63 10
68 30
69 "Total charged for pumped gas:$30.00"
70 1
71 "Federal gas tax:$1.00"
74 "Full Service :$2.00"
75 2
80 32
81 1.6
82 "Sales Tax: $1.60"
83 34.6
85 "Total charges:$34.60"
PASS
gallonsPumped = 10 salesTax = .05
serviceChargeGasNGo = 1.00
fedGasTax = .10
Inputs: User selects 'gas n' go', pumps 10 gallons of premium gas. perGallonChargePremium = 3.20
Expected Output: gasSubTotal = ( 10 * 3.20 ) 32.00$
fedTaxSubtotal = ( 10 * .10 ) 1.00$
salesTaxSubtotal = ( (1.00 + 32.00) * .05 ) 1.65$
transactionTotal = ( 32 + 1 + 1.65 + 1.00) 35.65$
Line # userSelection selectedServiceType selectedGasType perGallonPrice gallonsPumped gasSubTotal fedTaxSubtotal transactionTotal salesTaxSubtotal Input/output
39 2
45 "Gas n' Go"
54 1
57 3.2
63 10
68 32
69 "Total charged for pumped gas:$32.00"
70 1
71 "Federal gas tax:$1.00"
77 "Gas n' Go:$1.00"
78 1
80 33
81 1.65
82 "Sales Tax: $1.65"
83 35.65
85 "Total charges:$35.65"
PASS
8
gallonsPumped=10 salesTax= .05
serviceChargeGasNGo= 1.00
fedGasTax= .10
Inputs: User selects 'gas n' go', pumps 10 gallons of regular gas. perGallonChargeRegular= 3.00
Expected Output: gasSubTotal= (10 * 3.00) $30.00
fedTaxSubtotal= (10 * .10) $1.00
salesTaxSubtotal ( (1.00 + 30.00) * .05) $1.55
transactionTotal= ( 30 + 1 + 1.55 + 1.00) $33.55
Line # userSelection selectedServicetype selectedGasType perGallonPrice gallonsPumped gasSubTotal fedTaxSubtotal transactionTotal salesTaxSubtotal Input/output
39 2
45 "Gas n' Go"
54 2
60 3
63 10
68 30
69 "Total charged for pumped gas:$30.00"
70 1
71 "Federal gas tax: $1.00"
77 "Gas n' Go: $1.00"
78 1
80 31
81 1.55
82 "Sales Tax: $1.55"
83 33.55
85 "Total charges: $33.55"
PASS
gallonsPumped= 10
fedGasTax= .10
salesTax= .05
Inputs: User doesn't select and self service defaults, 10 gallons premium pumped. perGallonChargePremium= 3.20
Expected Output: gasSubTotal= (10 * 3.20) $32.00
fedTaxSubtotal= (10 * .10) $1.00
salesTaxSubtotal= (32.00 * .05) $1.60
transactionTotal= (32.00 + 1.00 + 1.60) $34.60
Line # userSelection selectedServicetype selectedGasType perGallonPrice gallonsPumped gasSubTotal fedTaxSubtotal transactionTotal salesTaxSubtotal Input/output
39 3
49 "Self Service"
54 1
57 3.2
63 10
68 32
69 "Total charged for pumped gas: $32.00"
70 1
71 "Federal gas tax: $1.00
80 33
81 1.6
82 "Sales Tax: $1.60"
83 34.6
85 "Total charges: $34.60"
PASS
gallonsPumped= 10
fedGasTax= .10
salesTax= .05
perGallonChargeRegular= 3.00
Inputs: User doesn't select and self service defaults, 10 gallons regular pumped.
Expected Output: gasSubTotal= (10 * 3.00) $30.00
fedTaxSubtotal= (10 * .10) $1.00
salesTaxSubtotal= (30.00 * .05) $1.50
transactionTotal= (30.00 + 1.00 + 1.50) $32.50
Line # userSelection selectedServicetype selectedGasType perGallonPrice gallonsPumped gasSubTotal fedTaxSubtotal transactionTotal salesTaxSubtotal Input/output
39 3
49 "Self Service"
54 2
57 3
63 10
68 30
69 "Total charged for pumped gas: $30.00"
70 1
71 "Federal gas tax: $1.00"
80 31
81 1.5
82 "Sales Tax: $1.50"
83 32.5
85 "Total charges: $32.50"
PASS
9
References
Bohl, M., & Ryann, M. (2008). Tools for structured and object-oriented design: An introduction to programming
logic (7th ed.). Upper Saddle River, NJ: Pearson Prentice Hall
Crews, T., & Murphy, C. (2009). A guide to working with Visual Logic. Boston, MA: Cengage Learning.
Drake, E., & Venit, S. (2011). Prelude to programming: Concepts and design (5th ed.). Boston, MA: Addison-
Wesley.
Gaddis, T. (2013). Starting out with programming logic and design (3rd ed.). Boston, MA: Addison-Wesley.

More Related Content

Similar to Gas pump program final

In use testing program for heavy-duty diesel engines and vehicles
In use testing program for heavy-duty diesel engines and vehiclesIn use testing program for heavy-duty diesel engines and vehicles
In use testing program for heavy-duty diesel engines and vehiclesWiroj Kaewkan
 
GuardMagic DAFS - Fuel level sensor adapter
GuardMagic DAFS - Fuel level sensor adapterGuardMagic DAFS - Fuel level sensor adapter
GuardMagic DAFS - Fuel level sensor adapterAlexandr Orlov
 
Justin trimmer cop2000 5-week 2_super supermarket pay calculator
Justin trimmer cop2000 5-week 2_super supermarket pay calculatorJustin trimmer cop2000 5-week 2_super supermarket pay calculator
Justin trimmer cop2000 5-week 2_super supermarket pay calculatorWintur
 
someone help Python programming After the loop ends, return the expe.pdf
someone help Python programming After the loop ends, return the expe.pdfsomeone help Python programming After the loop ends, return the expe.pdf
someone help Python programming After the loop ends, return the expe.pdfishratmanzar1986
 
CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT )
CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT ) CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT )
CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT ) Mauryasuraj98
 
Pump saveusermanual
Pump saveusermanualPump saveusermanual
Pump saveusermanualBao Kim
 
The operating costing on hotel,hospital & transport
The operating costing on hotel,hospital & transportThe operating costing on hotel,hospital & transport
The operating costing on hotel,hospital & transporthemant sonawane
 
Teleflex manual
Teleflex manualTeleflex manual
Teleflex manualMauricio Grez
 
Malinin PDMA Presentation
Malinin PDMA PresentationMalinin PDMA Presentation
Malinin PDMA PresentationLen Malinin
 
Training Manual-MM-LCM v1.pdf
Training Manual-MM-LCM v1.pdfTraining Manual-MM-LCM v1.pdf
Training Manual-MM-LCM v1.pdfMudasir Islam
 
Discussion on modern trend in measurement, Combustion control,optimization.pptx
Discussion on modern trend in measurement, Combustion control,optimization.pptxDiscussion on modern trend in measurement, Combustion control,optimization.pptx
Discussion on modern trend in measurement, Combustion control,optimization.pptxkazi galib
 
Fuel Comparison Calculator User Manual
Fuel Comparison Calculator User ManualFuel Comparison Calculator User Manual
Fuel Comparison Calculator User ManualDoug Kripke
 
Scheduling of gas turbine compressor washing
Scheduling of gas turbine compressor washingScheduling of gas turbine compressor washing
Scheduling of gas turbine compressor washingIvan Gonzalez Castillo
 
Scheduling of gas turbine compressor washing
Scheduling of gas turbine compressor washingScheduling of gas turbine compressor washing
Scheduling of gas turbine compressor washingIvan Gonzalez Castillo
 
Warranty
WarrantyWarranty
Warrantydave adam
 
Java 102 intro to object-oriented programming in java - exercises
Java 102   intro to object-oriented programming in java - exercisesJava 102   intro to object-oriented programming in java - exercises
Java 102 intro to object-oriented programming in java - exercisesagorolabs
 
Intro to programing with java-lecture 3
Intro to programing with java-lecture 3Intro to programing with java-lecture 3
Intro to programing with java-lecture 3Mohamed Essam
 

Similar to Gas pump program final (20)

In use testing program for heavy-duty diesel engines and vehicles
In use testing program for heavy-duty diesel engines and vehiclesIn use testing program for heavy-duty diesel engines and vehicles
In use testing program for heavy-duty diesel engines and vehicles
 
GuardMagic DAFS - Fuel level sensor adapter
GuardMagic DAFS - Fuel level sensor adapterGuardMagic DAFS - Fuel level sensor adapter
GuardMagic DAFS - Fuel level sensor adapter
 
Justin trimmer cop2000 5-week 2_super supermarket pay calculator
Justin trimmer cop2000 5-week 2_super supermarket pay calculatorJustin trimmer cop2000 5-week 2_super supermarket pay calculator
Justin trimmer cop2000 5-week 2_super supermarket pay calculator
 
someone help Python programming After the loop ends, return the expe.pdf
someone help Python programming After the loop ends, return the expe.pdfsomeone help Python programming After the loop ends, return the expe.pdf
someone help Python programming After the loop ends, return the expe.pdf
 
CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT )
CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT ) CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT )
CAR PARKING SYSTEM USING VISUAL STUDIO C++ (OPERATING SYSTEM MINI PROJECT )
 
Pump saveusermanual
Pump saveusermanualPump saveusermanual
Pump saveusermanual
 
The operating costing on hotel,hospital & transport
The operating costing on hotel,hospital & transportThe operating costing on hotel,hospital & transport
The operating costing on hotel,hospital & transport
 
CONTROL STRUCTURE
CONTROL STRUCTURECONTROL STRUCTURE
CONTROL STRUCTURE
 
Teleflex manual
Teleflex manualTeleflex manual
Teleflex manual
 
Malinin PDMA Presentation
Malinin PDMA PresentationMalinin PDMA Presentation
Malinin PDMA Presentation
 
Training Manual-MM-LCM v1.pdf
Training Manual-MM-LCM v1.pdfTraining Manual-MM-LCM v1.pdf
Training Manual-MM-LCM v1.pdf
 
Discussion on modern trend in measurement, Combustion control,optimization.pptx
Discussion on modern trend in measurement, Combustion control,optimization.pptxDiscussion on modern trend in measurement, Combustion control,optimization.pptx
Discussion on modern trend in measurement, Combustion control,optimization.pptx
 
Fuel Comparison Calculator User Manual
Fuel Comparison Calculator User ManualFuel Comparison Calculator User Manual
Fuel Comparison Calculator User Manual
 
PJ2
PJ2PJ2
PJ2
 
Scheduling of gas turbine compressor washing
Scheduling of gas turbine compressor washingScheduling of gas turbine compressor washing
Scheduling of gas turbine compressor washing
 
Scheduling of gas turbine compressor washing
Scheduling of gas turbine compressor washingScheduling of gas turbine compressor washing
Scheduling of gas turbine compressor washing
 
Warranty
WarrantyWarranty
Warranty
 
Java 102 intro to object-oriented programming in java - exercises
Java 102   intro to object-oriented programming in java - exercisesJava 102   intro to object-oriented programming in java - exercises
Java 102 intro to object-oriented programming in java - exercises
 
Intro to programing with java-lecture 3
Intro to programing with java-lecture 3Intro to programing with java-lecture 3
Intro to programing with java-lecture 3
 
03b loops
03b   loops03b   loops
03b loops
 

More from Wendy Lile

Computer Science
Computer ScienceComputer Science
Computer ScienceWendy Lile
 
Databases & Challenges of a Digital Age
Databases & Challenges of a Digital AgeDatabases & Challenges of a Digital Age
Databases & Challenges of a Digital AgeWendy Lile
 
Cleaning up Texas air
Cleaning up Texas airCleaning up Texas air
Cleaning up Texas airWendy Lile
 
Web 2.0 Revisited - Final project
Web 2.0 Revisited - Final projectWeb 2.0 Revisited - Final project
Web 2.0 Revisited - Final projectWendy Lile
 
"Innovations" of copyright and intellectual properties
"Innovations" of copyright and intellectual properties"Innovations" of copyright and intellectual properties
"Innovations" of copyright and intellectual propertiesWendy Lile
 
"Innovations" of copyright and intellectual properties
"Innovations" of copyright and intellectual properties"Innovations" of copyright and intellectual properties
"Innovations" of copyright and intellectual propertiesWendy Lile
 
Unix linux vmacvwindowspptx2
Unix linux vmacvwindowspptx2Unix linux vmacvwindowspptx2
Unix linux vmacvwindowspptx2Wendy Lile
 
Website design and development part 1
Website design and development part 1Website design and development part 1
Website design and development part 1Wendy Lile
 
Interactive features
Interactive featuresInteractive features
Interactive featuresWendy Lile
 
Elias sitereview
Elias sitereviewElias sitereview
Elias sitereviewWendy Lile
 
Website evaluationpaperfinal
Website evaluationpaperfinalWebsite evaluationpaperfinal
Website evaluationpaperfinalWendy Lile
 
Succession and natural selection
Succession and natural selectionSuccession and natural selection
Succession and natural selectionWendy Lile
 
Population size
Population sizePopulation size
Population sizeWendy Lile
 
Mitigation strategies and solutions for energy conservation
Mitigation strategies and solutions for energy conservationMitigation strategies and solutions for energy conservation
Mitigation strategies and solutions for energy conservationWendy Lile
 
Energy resource plan
Energy resource planEnergy resource plan
Energy resource planWendy Lile
 
Energy resource challanges
Energy resource challangesEnergy resource challanges
Energy resource challangesWendy Lile
 
Business communication trends
Business communication trendsBusiness communication trends
Business communication trendsWendy Lile
 
Oral presentation
Oral presentationOral presentation
Oral presentationWendy Lile
 
Management case study
Management case studyManagement case study
Management case studyWendy Lile
 
Ethics awareness inventory
Ethics awareness inventoryEthics awareness inventory
Ethics awareness inventoryWendy Lile
 

More from Wendy Lile (20)

Computer Science
Computer ScienceComputer Science
Computer Science
 
Databases & Challenges of a Digital Age
Databases & Challenges of a Digital AgeDatabases & Challenges of a Digital Age
Databases & Challenges of a Digital Age
 
Cleaning up Texas air
Cleaning up Texas airCleaning up Texas air
Cleaning up Texas air
 
Web 2.0 Revisited - Final project
Web 2.0 Revisited - Final projectWeb 2.0 Revisited - Final project
Web 2.0 Revisited - Final project
 
"Innovations" of copyright and intellectual properties
"Innovations" of copyright and intellectual properties"Innovations" of copyright and intellectual properties
"Innovations" of copyright and intellectual properties
 
"Innovations" of copyright and intellectual properties
"Innovations" of copyright and intellectual properties"Innovations" of copyright and intellectual properties
"Innovations" of copyright and intellectual properties
 
Unix linux vmacvwindowspptx2
Unix linux vmacvwindowspptx2Unix linux vmacvwindowspptx2
Unix linux vmacvwindowspptx2
 
Website design and development part 1
Website design and development part 1Website design and development part 1
Website design and development part 1
 
Interactive features
Interactive featuresInteractive features
Interactive features
 
Elias sitereview
Elias sitereviewElias sitereview
Elias sitereview
 
Website evaluationpaperfinal
Website evaluationpaperfinalWebsite evaluationpaperfinal
Website evaluationpaperfinal
 
Succession and natural selection
Succession and natural selectionSuccession and natural selection
Succession and natural selection
 
Population size
Population sizePopulation size
Population size
 
Mitigation strategies and solutions for energy conservation
Mitigation strategies and solutions for energy conservationMitigation strategies and solutions for energy conservation
Mitigation strategies and solutions for energy conservation
 
Energy resource plan
Energy resource planEnergy resource plan
Energy resource plan
 
Energy resource challanges
Energy resource challangesEnergy resource challanges
Energy resource challanges
 
Business communication trends
Business communication trendsBusiness communication trends
Business communication trends
 
Oral presentation
Oral presentationOral presentation
Oral presentation
 
Management case study
Management case studyManagement case study
Management case study
 
Ethics awareness inventory
Ethics awareness inventoryEthics awareness inventory
Ethics awareness inventory
 

Recently uploaded

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 

Recently uploaded (20)

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 

Gas pump program final

  • 1. Gas Pump Program Team C PRG-211 University of Phoenix Due April 22, 2013 Jiming Liu
  • 2. Gas Pump Program Problem Statement The required program will calculate charges incurred when a motorist uses an automated gas pump. The system will need to take input from the user as to what type of gas they want. The have options of regular and premium; charges per gallon should be calculated based on the user‟s selection. The user should also be prompted for „Gas and go‟ or „Full Service‟. If the user selects „Full Service‟ or „Gas and Go‟, a service charge is to be added for the attendant to pump the gas for the user. The user must also have the option to pump the gas themselves without requesting additional service. Top Level Algorithm Input Data Module Processing Module Output Result Module Prompt User For: SelectedGasType SelectedServiceType GasTypePremium GasTypeRegularServiceChargeGasNGo ServiceChargeFull 1. If (SelectedGasType=”Premium” and SelectedServiceType=”Full”) Than Set PurchaseAmt=GasTypePremium + ServiceChargeFull Else If (SelectedGasType=”Premium” and SelectedServiceType=”GasNGo”) Than PurchaseAmt=GasTypePremium + ServiceChargeGasNGo Else If (SelectedGasType=”Regular” and SelectedServiceType=”Full”) Than PurchaseAmt=GasTypeRegular + ServiceChargeFull Else If (SelectedGasType=”Regular” and SelectedServiceType=”GasNGo”) Than PurchaseAmt=GasTypeRegular + ServiceChargeGasNGo Else If (SelectedGasType=”Premium” and Write out: GallonsPumped PurchaseAmt TotalPrice
  • 3. SelectedServiceType=”None”) Than PurchaseAmt=GasTypePremium Else If (SelectedGasType=”Regular” and SelectedServiceType=”None”) Than PurchaseAmt = GasTypeRegular Else Print “User input error. Please see attendant” 2. Set SubTotal=PurchaseAmt * StateSalesTax 3. Set TotalPrice=SubTotal + (FedGasTax * PurchaseAmt) Module Functions and Internal Structure Service Selection The main screen if not being used displays “Welcome to your neighborhood gas station!” The system displays “Please select from the following: 1 – Gas and Go, 2 – Full Service, 3 – Self Service.” If the user selects „gas and go‟ or „full service‟, the program will alert the station attendant and the pump display reads “Please wait for station attendant” and the attendant will then finish fueling and making selections. Gas Selection For service from attendant or if the user selects self-service, the display will read “Please select gas type. 1-Premium or 2-Regular”. The program will store the user selection for use in later calculations. Pump Processing The program will now display “Please remove nozzle and begin fueling.” Once calculations are complete, the program adds the selected service charges for Full service or Gas and Go. Sales tax is then calculated and added to this total. Finally, the system adds the untaxed federal gas tax based on the
  • 4. type and amount of gasoline. Total is then calculated and displayed on the screen, along with “Have a nice day!” Program Pseudocode 1 //This program is designed to walk a customer through the purchase of service type and gasoline type 2 //then allowing the program to calculate the total based on those selections along with the federal 3 //and state taxes added in. (1.) 4 //Begin Main_Module (2.) 5 //This module declares all variables, sets prices, and calls all sub-modules. 6 Declare perGallonPriceRegular as integer 7 Declare perGallonPricePremium as integer 8 Declare serviceChargeFull as integer 9 Declare serviceChargeGasNGo as integer 10 Declare fedGasTax as integer 11 Declare salesTax as integer 12 Declare gallonsPumped as integer 13 Declare userSelection as string 14 Declare selectedServiceType as string 15 Declare selectedFuelType as string 16 Declare transactionTotal as string 17 Declare salesTaxSubtotal as string 18 Declare gasSubTotal as string 19 Declare selectedServiceType 20 Set perGallonPriceRegular=3.00 21 Set perGallonPricePremium=3.20 22 Set serviceChargeFull=2.00 23 Set serviceChargeGasNGo=1.00 24 Set fedGasTax=.10 25 Set salesTax=.05 26 Call Welcome_Message_Module 27 Call Service_Selection_Module 28 Call Fuel_Selection_Module 29 Call Calculations_Module 30 Begin Welcome_Message_Module (3.) 31 //Displays a short greeting for the customer at the chosen pump. 32 Write "Welcome to your neighborhood gas station." 33 End Welcome_Message_Module 34 Begin Service_Selection_Module (4.) 35 Write "Please select level of service." 36 Write "1-Full service, 2-Gas-n-Go, or 3-Self-service." 37 Input userSelection 38 If userSelection=1 Then 39 selectedServiceType="Full Service" 40 Write "The station attendant has been notified of your service request, 41 please stand by." 42 Else If userSelection=2 Then
  • 5. 43 selectedServiceType="Gas N' Go" 44 Write "The station attendant has been notified of your service request, please 45 stand by." 46 Else 47 selectedServiceType="Self Service" 48 End If 49 End Service_Selection_Module 50 Begin Fuel_Selection_Module (5.) 51 Write "Please select gas type: 1-Premium or 2-Regular" 52 Input selectedGasType 53 If selectedGasType=1 Then 54 Set dispGasType="Premium" 55 Set perGallonPrice=perGallonPricePremium 56 Else 57 Set dispGasType="Regular" And 58 Set perGallonPrice=perGallonPriceRegular 59 End If 60 Write "Please remove the pump and begin fueling." 61 Set gallonsPumped = 10 62 Write “Service Complete.” 63 End Fuel_Selection_Module 64 Begin Calculations_Module (6.) 65 Write "Your charges are as follows." 66 Set gasSubTotal=gallonsPumped * perGallonPrice //Calculate gas subtotal. 67 Write "Total charged for pumped gas:$" & gasSubTotal 68 Set fedTaxSubtotal=gallonsPumped * fedGasTax //Calculate gas tax before sales tax is applied. 69 Write "Federal gas tax:$" & fedTaxSubtotal 70 //Begin calculating transition total by starting with the service charge. 71 If selectedServiceType="Full Service" Then 72 Write selectedServiceType&":$"&serviceChargeFull 73 Set transactionTotal=serviceChargeFull 74 Else 75 Write selectedServiceType&":$"&serviceChargeGasNGo 76 Set transactionTotal=serviceChargeGasNGo 77 End If 78 Set transactionTotal=transactionTotal+gasSubTotal //Add gas subtotal to service charge. (7.) 79 Set salesTaxSubtotal = transactionTotal * salesTax //Calculate sales tax for gas and service. 80 Write "Sales Tax: $" & salesTaxSubtotal 81 Set transactionTotal=transactionTotal+salesTaxSubtotal+fedTaxSubtotal 82 //Add sales tax and fed tax to running total. 83 Write "Total Charges:$" &transactionTotal 84 Write "Have a nice day!"
  • 6. Documentation of Tasks and Subtasks Sequential numbers in the pseudo-code will correspond to this list. 1. Statement to give a quick overview of what the program sets out to accomplish. 2. This is the beginning of the main module where we declare our integers, floats, and strings. This puts in our “Write” statements, “Sets” our figures with pricing and taxes to be added, and “Calls” the modules. 3. This quick message module will display at the pump when a customer initiates a fuel purchase. 4. This is the service selection module. It starts out with prompting the user on their service selection for either full, gas n‟ go or self-service. Next, an If-Then-Else statement will walk the program through those selections to make sure they are stored for the calculations module. 5. The user now chooses between premium and regular. Another If-Then-Else statement will walk the program through the choices again and store them for later use in the calculations module. 6. The beginning of the calculations module will start with showing the customer their charges. The inputs the program will take into consideration are Premium=$3.20/gal., Regular=$3.00/gal., Full service charge=$2.00, Gas n‟ Go charge=$1.00, Federal gas tax= .10 cents/gal., and State tax charge= 5% or .05 for the purposes of the pseudocode. 7. All the calculations are processed within this module to give the user their final value base on their previous choices through a series of If-Then-Else statements and Set statements that involve the mathematical portion.
  • 7. 7 Desk Check for Team C Final Project gallonsPumped = 10 salesTax = .05 serviceChargeFull = 2.00 fedGasTax = .10 Inputs: User selects 'full service', pumps 10 gallons of premium gas. perGallonChargePremium = 3.20 Expected Output: gasSubTotal = ( 10 * 3.20 ) 32.00$ fedTaxSubtotal = ( 10 * .10 ) 1.00$ salesTaxSubtotal = ( (2.00 + 32.00) * .05 ) 1.70$ transactionTotal = ( 32 + 1 + 1.70 + 2.00) 36.70$ Line # userSelection selectedServiceType selectedGasType perGallonPrice gallonsPumped gasSubTotal fedTaxSubtotal transactionTotal salesTaxSubtotal Input/output 39 1 41 "Full Service" 54 1 57 3.2 63 10 68 32 69 "Total charged for pumped gas:$32.00" 70 1 71 "Federal gas tax:$1.00" 74 "Full Service :$2.00" 75 2 80 34 81 1.7 82 "Sales Tax: $1.70" 83 36.7 85 "Total charges:$36.70" PASS gallonsPumped = 10 salesTax = .05 serviceChargeFull = 2.00 fedGasTax = .10 Inputs: User selects 'full service', pumps 10 gallons of regular gas. perGallonChargeRegular = 3.00 Expected Output: gasSubTotal = ( 10 * 3.00 ) 30.00$ fedTaxSubtotal = ( 10 * .10 ) 1.00$ salesTaxSubtotal = ( (2.00 + 30.00) * .05 ) 1.60$ transactionTotal = ( 30 + 1 + 1.60 + 2.00) 34.60$ Line # userSelection selectedServiceType selectedGasType perGallonPrice gallonsPumped gasSubTotal fedTaxSubtotal transactionTotal salesTaxSubtotal Input/output 39 1 41 "Full Service" 54 2 60 3 63 10 68 30 69 "Total charged for pumped gas:$30.00" 70 1 71 "Federal gas tax:$1.00" 74 "Full Service :$2.00" 75 2 80 32 81 1.6 82 "Sales Tax: $1.60" 83 34.6 85 "Total charges:$34.60" PASS gallonsPumped = 10 salesTax = .05 serviceChargeGasNGo = 1.00 fedGasTax = .10 Inputs: User selects 'gas n' go', pumps 10 gallons of premium gas. perGallonChargePremium = 3.20 Expected Output: gasSubTotal = ( 10 * 3.20 ) 32.00$ fedTaxSubtotal = ( 10 * .10 ) 1.00$ salesTaxSubtotal = ( (1.00 + 32.00) * .05 ) 1.65$ transactionTotal = ( 32 + 1 + 1.65 + 1.00) 35.65$ Line # userSelection selectedServiceType selectedGasType perGallonPrice gallonsPumped gasSubTotal fedTaxSubtotal transactionTotal salesTaxSubtotal Input/output 39 2 45 "Gas n' Go" 54 1 57 3.2 63 10 68 32 69 "Total charged for pumped gas:$32.00" 70 1 71 "Federal gas tax:$1.00" 77 "Gas n' Go:$1.00" 78 1 80 33 81 1.65 82 "Sales Tax: $1.65" 83 35.65 85 "Total charges:$35.65" PASS
  • 8. 8 gallonsPumped=10 salesTax= .05 serviceChargeGasNGo= 1.00 fedGasTax= .10 Inputs: User selects 'gas n' go', pumps 10 gallons of regular gas. perGallonChargeRegular= 3.00 Expected Output: gasSubTotal= (10 * 3.00) $30.00 fedTaxSubtotal= (10 * .10) $1.00 salesTaxSubtotal ( (1.00 + 30.00) * .05) $1.55 transactionTotal= ( 30 + 1 + 1.55 + 1.00) $33.55 Line # userSelection selectedServicetype selectedGasType perGallonPrice gallonsPumped gasSubTotal fedTaxSubtotal transactionTotal salesTaxSubtotal Input/output 39 2 45 "Gas n' Go" 54 2 60 3 63 10 68 30 69 "Total charged for pumped gas:$30.00" 70 1 71 "Federal gas tax: $1.00" 77 "Gas n' Go: $1.00" 78 1 80 31 81 1.55 82 "Sales Tax: $1.55" 83 33.55 85 "Total charges: $33.55" PASS gallonsPumped= 10 fedGasTax= .10 salesTax= .05 Inputs: User doesn't select and self service defaults, 10 gallons premium pumped. perGallonChargePremium= 3.20 Expected Output: gasSubTotal= (10 * 3.20) $32.00 fedTaxSubtotal= (10 * .10) $1.00 salesTaxSubtotal= (32.00 * .05) $1.60 transactionTotal= (32.00 + 1.00 + 1.60) $34.60 Line # userSelection selectedServicetype selectedGasType perGallonPrice gallonsPumped gasSubTotal fedTaxSubtotal transactionTotal salesTaxSubtotal Input/output 39 3 49 "Self Service" 54 1 57 3.2 63 10 68 32 69 "Total charged for pumped gas: $32.00" 70 1 71 "Federal gas tax: $1.00 80 33 81 1.6 82 "Sales Tax: $1.60" 83 34.6 85 "Total charges: $34.60" PASS gallonsPumped= 10 fedGasTax= .10 salesTax= .05 perGallonChargeRegular= 3.00 Inputs: User doesn't select and self service defaults, 10 gallons regular pumped. Expected Output: gasSubTotal= (10 * 3.00) $30.00 fedTaxSubtotal= (10 * .10) $1.00 salesTaxSubtotal= (30.00 * .05) $1.50 transactionTotal= (30.00 + 1.00 + 1.50) $32.50 Line # userSelection selectedServicetype selectedGasType perGallonPrice gallonsPumped gasSubTotal fedTaxSubtotal transactionTotal salesTaxSubtotal Input/output 39 3 49 "Self Service" 54 2 57 3 63 10 68 30 69 "Total charged for pumped gas: $30.00" 70 1 71 "Federal gas tax: $1.00" 80 31 81 1.5 82 "Sales Tax: $1.50" 83 32.5 85 "Total charges: $32.50" PASS
  • 9. 9 References Bohl, M., & Ryann, M. (2008). Tools for structured and object-oriented design: An introduction to programming logic (7th ed.). Upper Saddle River, NJ: Pearson Prentice Hall Crews, T., & Murphy, C. (2009). A guide to working with Visual Logic. Boston, MA: Cengage Learning. Drake, E., & Venit, S. (2011). Prelude to programming: Concepts and design (5th ed.). Boston, MA: Addison- Wesley. Gaddis, T. (2013). Starting out with programming logic and design (3rd ed.). Boston, MA: Addison-Wesley.