The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages - More
> Software Design
|
Hey all plzzz help .......
Discuss Hey all plzzz help ....... in the Software Design forum on Dev Shed. Hey all plzzz help ....... Software design forum discussing design principles and non-language specific algorithms. Get help with logic, algebraic, or relational concepts.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

June 20th, 2003, 10:35 AM
|
|
Junior Member
|
|
Join Date: Jun 2003
Location: Behind you
Posts: 4
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.
|

June 20th, 2003, 12:23 PM
|
 |
not a fan of fascism (n00b)
|
|
Join Date: Feb 2003
Location: ct
|
|
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 
|

June 20th, 2003, 12:25 PM
|
 |
not a fan of fascism (n00b)
|
|
Join Date: Feb 2003
Location: ct
|
|
|
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
|

June 20th, 2003, 01:22 PM
|
|
Junior Member
|
|
Join Date: Jun 2003
Location: Behind you
Posts: 4
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
|

June 20th, 2003, 01:56 PM
|
 |
not a fan of fascism (n00b)
|
|
Join Date: Feb 2003
Location: ct
|
|
|
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?
|

June 20th, 2003, 02:15 PM
|
|
Junior Member
|
|
Join Date: Jun 2003
Location: Behind you
Posts: 4
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 = ............
|

June 22nd, 2003, 06:00 AM
|
|
Junior Member
|
|
Join Date: Jun 2003
Location: Behind you
Posts: 4
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.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|