Zebra0.com

algorithms gaspriceGas Price Pseudocode

Gas Price Pseudocode

Algorithm

  1. Input the cost per liter in Euros: cost
  2. Input the conversion rate for Euros to dollars: exchange
  3. priceGallons=cost*3.78
  4. priceDollars=[priceGallon*exchage
  5. Output priceDollars

Pseudocode:

  1. declare the variables: cost, exchange, priceGallons, priceDollars
  2. prompt for cost
  3. input cost
  4. prompt exchange
  5. input exchange
  6. priceGallons=cost*3.78 (print out)
  7. priceDollars=[priceGallon*exchage
  8. Output priceDollars