2 Replies - 610 Views - Last Post: 12 January 2012 - 08:39 AM Rate Topic: -----

Topic Sponsor:

#1 ITdad1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 12-January 12

can someone let me know if I am missing something in this code? thanx&

Posted 12 January 2012 - 08:30 AM

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
Is This A Good Question/Topic? 0
  • +

Replies To: can someone let me know if I am missing something in this code? thanx&

#2 D_MeNtEd  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 32
  • Joined: 27-August 10

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
Was This Post Helpful? 1
  • +
  • -

#3 ITdad1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 12-January 12

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
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1