Results 1 to 1 of 1
Thread: Is my Pseudocode correct?
- 01-29-2008, 05:07 AM #1
Is my Pseudocode correct?
Given a student file, you need to complete the following logical design task by using pseudo code:
1)Display the details of the students who are from Indonesia and study Multimedia
2)Show the total number of students of above student
3)Show the total number of female students in the file
4)show the average age of all the students
================================================== ========
PSEUDO CODE
1 INITIALIZE VARIABLES (TOTAL_STD_COUNT = 0, INDONESIA AND MULTIMEDIA = NATIONALITY AND SUBJECT, TOTAL_FEMALE_STD = 0, AVG_AGE = 0)
2 OPEN FILE “STD_FILE”
3 LOOP UNTIL END OF FILE
4 USER INPUT VARIABLES
5 DO
6 PROCESS A RECORD
7 ENDDO
8 DISPLAY RECORD (STD_NO, STD_NAME, GENDER, AGE, SUBJECT, NATIONALITY), TOTAL_STD_COUNT, TOTAL_FEMALE_STD, AVG_AGE
9 CLOSE STD_FILE
10 END
__________________________________________________ ____________
REFINEMENT OF STEP 6:
6.1 IF EVERY “NATIONALITY” AND “SUBJECT” MATCHES “INDONESIA” AND “MULTIMEDIA” THEN
ADD 1 TO TOTAL_STD_RECORD
ELSE
DISPLAY “NO RECORD FOUND”
ENDIF
6.2 IF EVERY “GENDER” MATCHES “FEMALE” THEN
ADD 1 TO TOTAL_FEMALE_STD
ELSE
DISPLAY “NO RECORD FOUND”
ENDIF
6.3 IF EVERY “AGE” IS GREATER THAN 0 THEN
ADD AGE TO TOTAL_AGE DIVIDE BY TOTAL_STD_COUN
ENDIFDon Vito Corleone~I am gonna make you an offer you can't refuse
Similar Threads
-
Pseudocode to java (HELP)
By lordrowin in forum New To JavaReplies: 1Last Post: 02-02-2008, 09:54 AM -
Move to correct forum
By JavaJunkie1983 in forum IntroductionsReplies: 7Last Post: 01-23-2008, 04:04 AM -
Move to correct forum...
By Winarto in forum IntroductionsReplies: 3Last Post: 01-18-2008, 04:00 AM -
To correct forum
By Jman in forum IntroductionsReplies: 3Last Post: 01-18-2008, 03:33 AM -
Correct Number formatting
By paul in forum New To JavaReplies: 1Last Post: 08-07-2007, 05:59 AM
Bookmarks