954,506 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Need help with Pseudocode!!

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.

2fac323
Light Poster
26 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 

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
Paul.Esson
Junior Poster
181 posts since Feb 2005
Reputation Points: 21
Solved Threads: 10
 

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.

Chilton
Junior Poster
106 posts since Oct 2009
Reputation Points: 34
Solved Threads: 16
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You