This is in pseudocode and I would like to know if it is correct.This pseudocode segment is intended to describe computing the number of miles per gallon you get with your automobile.
start
input milesTraveled
input gallonsOfGasUsed
set milesPerGallon = milesTraveled + gallons
output milesPerGallon
start
2 Replies - 610 Views - Last Post: 12 January 2012 - 08:39 AM
Topic Sponsor:
#1
can someone let me know if I am missing something in this code? thanx&
Posted 12 January 2012 - 08:30 AM
Replies To: can someone let me know if I am missing something in this code? thanx&
#2
Re: can someone let me know if I am missing something in this code? thanx&
Posted 12 January 2012 - 08:34 AM
It would have to be
set milesPerGallon = milesTraveled / gallonsOfGasUsed
set milesPerGallon = milesTraveled / gallonsOfGasUsed
#3
Re: can someone let me know if I am missing something in this code? thanx&
Posted 12 January 2012 - 08:39 AM
Thanks, D_MeNtED! I appreciate the quick response. But I have one last question:This pseudocode segment is intended to describe computing the per day cost of your rent in a 30-day month. I just want to make sure it is correct bcuz now I have to convert it to a flowchart
start
output rent
set costPerDay = rent + 30
input cost
stop
start
output rent
set costPerDay = rent + 30
input cost
stop
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|