Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-29-2008, 05:07 AM
Clemenza1983's Avatar
Member
 
Join Date: Jan 2008
Location: Singapore
Posts: 24
Clemenza1983 is on a distinguished road
Send a message via MSN to Clemenza1983
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
ENDIF
__________________
Don Vito Corleone~I am gonna make you an offer you can't refuse
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pseudocode to java (HELP) lordrowin New To Java 1 02-02-2008 09:54 AM
Move to correct forum JavaJunkie1983 Introductions 7 01-23-2008 04:04 AM
Move to correct forum... Winarto Introductions 3 01-18-2008 04:00 AM
To correct forum Jman Introductions 3 01-18-2008 03:33 AM
Correct Number formatting paul New To Java 1 08-07-2007 05:59 AM


All times are GMT +3. The time now is 03:04 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org