Software Design
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreSoftware Design

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 20th, 2003, 11:35 AM
QuadMedic QuadMedic is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Behind you
Posts: 4 QuadMedic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hey all plzzz help .......

I must write this algorithm in pseudocode but I just can get it, it's an assignment question.

The manager of a speedy bus company needs to know how many people travel by bus to different regions, which have codes A, B and C. Accept the region code and number of passengers for every bus. A region code = Z, indicates the end of the data. Calculate the total number of passengers per region who used the bus during the day, and display the region totals. Also indicate which region had the lowest number of passengers on that day. Draw an IPO chart and write and algorithm in pseudocode to solve this problem.

Reply With Quote
  #2  
Old June 20th, 2003, 01:23 PM
infamous41md's Avatar
infamous41md infamous41md is offline
not a fan of fascism (n00b)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Feb 2003
Location: ct
Posts: 2,756 infamous41md User rank is Sergeant (500 - 2000 Reputation Level)infamous41md User rank is Sergeant (500 - 2000 Reputation Level)infamous41md User rank is Sergeant (500 - 2000 Reputation Level)infamous41md User rank is Sergeant (500 - 2000 Reputation Level)infamous41md User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 11 h 4 m 29 sec
Reputation Power: 26
a loop that accepts user input - stored in array of structs
-region code
-number of passenger for the bus
-terminated upon entry of 'Z'

a loop that moves thru the struct array
a switch statement that looks at teh region code and keeps totals for each region
*hope that helps

Reply With Quote
  #3  
Old June 20th, 2003, 01:25 PM
infamous41md's Avatar
infamous41md infamous41md is offline
not a fan of fascism (n00b)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Feb 2003
Location: ct
Posts: 2,756 infamous41md User rank is Sergeant (500 - 2000 Reputation Level)infamous41md User rank is Sergeant (500 - 2000 Reputation Level)infamous41md User rank is Sergeant (500 - 2000 Reputation Level)infamous41md User rank is Sergeant (500 - 2000 Reputation Level)infamous41md User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 11 h 4 m 29 sec
Reputation Power: 26
or even simpler, u can do all the processing in the first loop. depending on the user's input as to which region, add teh number of passengers to an accumlator, and increment teh counter for that acculator

Reply With Quote
  #4  
Old June 20th, 2003, 02:22 PM
QuadMedic QuadMedic is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Behind you
Posts: 4 QuadMedic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
huh............m8 i'm very new at this a first year student studying correspondence so i know nothing this is all i have

Code:

Amount_of_passengers

Display ‘’ Please enter the region code ’’
enter code
Display ‘’ Please enter the number of passengers for this region code ‘’
enter amount


not much hey.,.,...............i'm a noooooooooob

Reply With Quote
  #5  
Old June 20th, 2003, 02:56 PM
infamous41md's Avatar
infamous41md infamous41md is offline
not a fan of fascism (n00b)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Feb 2003
Location: ct
Posts: 2,756 infamous41md User rank is Sergeant (500 - 2000 Reputation Level)infamous41md User rank is Sergeant (500 - 2000 Reputation Level)infamous41md User rank is Sergeant (500 - 2000 Reputation Level)infamous41md User rank is Sergeant (500 - 2000 Reputation Level)infamous41md User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 11 h 4 m 29 sec
Reputation Power: 26
ok, sorry. lemme try again. the code that you have above, you will want to run that more than one time, yes? so if you create a loop that inputs the code and the amount, and then inside that loop you would look at the code entered, and depending on the code you would want to add teh number of passengers to some variable that is accumulating the number of passengers for each region, yes?

Reply With Quote
  #6  
Old June 20th, 2003, 03:15 PM
QuadMedic QuadMedic is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Behind you
Posts: 4 QuadMedic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ja yes that is it..................but it must not use a array, just a ''for'' command, but i'm not sure now to write the command.

for i = ............

Reply With Quote
  #7  
Old June 22nd, 2003, 07:00 AM
QuadMedic QuadMedic is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Behind you
Posts: 4 QuadMedic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thx for your help so far m8 ......... i really need it
does this look right so far.......

Code:
Amount_of_passengers

Display ‘’ Please enter the region code – enter Z to terminate the program ’’
enter code
do while code not = Z
enddo
sum = 0
for total = 1 to amount
Display ‘’ Please enter the number of passengers for this region code ‘’
enter amount

sum = sum + amount


my assignment must be in the 25 th and this is all that is holding me back.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreSoftware Design > Hey all plzzz help .......


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT