search

# Prg 210 Pseudocode - Rough Draft

Homework

### Rating

Showing Page:
1/3
Pseudocode: rough draft
If/then statement: If the customer pumps the gas themselves:
Customer purchasing leaded gasoline and the federal sales tax and pumping it themselves
Customer purchasing unleaded gasoline and the federal sales tax and pumping it themselves
A state sales tax is applied to the sum of all charges except for the federal gasoline tax.
Input
If gas only purchase:
# gallons of gas purchased | multiply | Price for leaded gas | amount 1
Get total amount
Get price_code
# gallons of gas purchased | multiply | federal tax | amount 2
Get Total Amount
sales_tax = cost_price * 0.10
Get Price_code
# gallons of gas purchased | multiply | sales tax | amount 3
Get total amount
sales_tax = cost_price * 0.10
Get price_code
Amount 1 |add | Amount 2|add | Amount 3 |= Total Bill

Initialize total_price to zero
total_price = cost_price * sales_tax
total_price ← cost_price + sales_tax
# gallons of gas purchased | multiply | Price for unleaded gas | amount 1
Get total amount
Get price_code
# gallons of gas purchased | multiply | federal tax | amount 2
Get Total Amount
sales_tax = cost_price * 0.10
Get Price_code
# gallons of gas purchased | multiply | sales tax | amount 3
Get total amount
sales_tax = cost_price * 0.10
Get price_code
Amount 1 |add | Amount 2|add | Amount 3 |= Total Bill
Initialize total_price to zero
total_price = cost_price * sales_tax
total_price ← cost_price + sales_tax

If Gas and Go or Full Service
# gallons of gas purchased | multiply | Price for leaded gas | amount 1
# gallons of gas purchased | multiply | federal tax | amount 2
# gallons of gas purchased |Add |Gas to Go service charge |Total | multiply | sales tax | amount 3
# gallons of gas purchased |Add | Full Service charge |Total | multiply | sales tax | amount 3
Amount 1 |add | Amount 2|add | Amount 3 |= Total Bill
# gallons of gas purchased | multiply | Price for unleaded gas | amount 1
# gallons of gas purchased | multiply | federal tax | amount 2
If # gallons of gas purchased |Add | Gas to Go service charge |Total | multiply | sales tax | amount
3
If # gallons of gas purchased |Add | Full Service charge |Total | multiply | sales tax | amount 3
Amount 1 |add | Amount 2|add | Amount 3 |= Total Bill

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Review
Review

Anonymous
Excellent resource! Really helped me get the gist of things.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4