Need help with Pseudocode!!

Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
Reply

Join Date: Jul 2008
Posts: 26
Reputation: 2fac323 is an unknown quantity at this point 
Solved Threads: 0
2fac323 2fac323 is offline Offline
Light Poster

Need help with Pseudocode!!

 
0
  #1
Oct 19th, 2009
I am confused by the question and having trouble designing the logic(pseudocode) for this problem, any help would be beneficial and appreciated..

Heartland Community College has a file of student records sorted by the hour of the student's first class on Mondays this semester. The hour of the first class is a two-digit number based on a 24-hour clock (for example, a 1pm class is recorded as 13). Besides the hour, each record contains the student's name and town of residence. Create the logic to produce a report that students can use to organize carpools. The report lists the names and phone numbers of students from the city of Huntley.(Note that some students come from cities other than Huntley; these students should not be listed on the report.) Start a new group for each hour of the day, including the hour in a header that precedes the group.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 181
Reputation: Paul.Esson is an unknown quantity at this point 
Solved Threads: 10
Paul.Esson's Avatar
Paul.Esson Paul.Esson is offline Offline
Junior Poster
 
0
  #2
Oct 20th, 2009
You could either sort the students into corresponding times before you start ( a little faster )

or iterate through the array of students 24 times, checking the time each time.

You want to sort the students into there corresponding times
so create arrays of students[24][MAX_STUDENTS]
Then iterate all students and then put each into there corresponding hours.

then you want to iterate through the times in the array 0 - 23 
 print the time index +1 
 then iterate through each student in that array (until no more students  are left )
 and print the name
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 18
Reputation: Chilton is an unknown quantity at this point 
Solved Threads: 2
Chilton Chilton is offline Offline
Newbie Poster
 
0
  #3
Oct 28th, 2009
You can create an array of structs that can hold those three pieces of data. Afterwards, sorting based on the hours can be done, starting with those from hour 0 - 23.
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the Computer Science Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC