Access over 20 million homework & study documents

search

Prg 210 Pseudocode - Rough Draft

Type

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:
Leaded Gas Purchase
# gallons of gas purchased | multiply | Price for leaded gas | amount 1
Read Gallons purchased
Get total amount
Read Price for Leaded
Get price_code
# gallons of gas purchased | multiply | federal tax | amount 2
Read federal tax
Get Total Amount
sales_tax = cost_price * 0.10
Get Price_code
# gallons of gas purchased | multiply | sales tax | amount 3
Read Sales tax
Get total amount
sales_tax = cost_price * 0.10
Get price_code
Amount 1 |add | Amount 2|add | Amount 3 |= Total Bill

Sign up to view the full document!

lock_open Sign Up
Initialize total_price to zero
total_price = cost_price * sales_tax
total_price ← cost_price + sales_tax
Unleaded Gas Purchase
# gallons of gas purchased | multiply | Price for unleaded gas | amount 1
Read Gallons purchased
Get total amount
Read Price for UnLeaded
Get price_code
# gallons of gas purchased | multiply | federal tax | amount 2
Read federal tax
Get Total Amount
sales_tax = cost_price * 0.10
Get Price_code
# gallons of gas purchased | multiply | sales tax | amount 3
Read Sales tax
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

Sign up to view the full document!

lock_open Sign Up
If Gas and Go or Full Service
Leaded Gas Purchase
# 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
Unleaded Gas Purchase
# 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

Sign up to view the full document!

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

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

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4