RETURN IntInput END End of function by validating integer The user did not

Return intinput end end of function by validating

This preview shows page 16 - 22 out of 66 pages.

RETURN IntInput } END // End of function by validating integer // The user did not enter the correct range // To return error message and when user key in the correct input 34.Validate ofMarks() { 16
Image of page 16
double Marks Marks = ofDouble() WHILEDO(Marks<0 || Marks>100) { DISPLAY("Please type the marks [between 0 to 100].") Marks = ofDouble() } ENDDO RETURN Marks } 17
Image of page 17
4.2. The menu function The student portal menu has the functions to use the pseudocode by decomposing and define the requirement. 1 st requirement is to make new menu for the user to select the function. INPUT PROCESSES OUTPUT Choice Solute - SET Choice - CHECK Choice - Prompt for Solute - Check Solute - CASE 1: QUIT/EXIT the program - CASE 2: ADD Student_Record - CASE 3: DISPLAY Student_Record - CASE 4: DISPLAY Student average score - CASE 5: DISPLAY NumberOfStudents_above and NumberOfStudents_below average - CASE 6: DISPLAY Distribution of Grades - CASE 7: Search Student_Record by StudentID - CASE 8: SEARCH Student_Record by StudentName - CASE 9: DISPLAY the highest and second score - CASE 10: SORT by StudentID and DISPLAY - CASE 11: Sort by Last Name and display - CASE 12: Calculate and display the standard deviation FUNCTION of select solute 18
Image of page 18
4.2.1 Pseudocode DISPLAY Menu 1. WHILEDO Choice==True // Start of the program 2. PROMPT Solute 3. CHECK Solute 4. DOWHILE Choice // Choice is true to maintain loop until the user exit the program DISPLAY”1: Student Portal Menu” DISPLAY”2: Add the student detail” DISPLAY”3: Display the student detail and grades” DISPLAY”4: Display the student average score” DISPLAY”5: Display number of student obtain equal or above the average overall mark and number of student obtain an overall mark below the average overall mark” DISPLAY”6: Display the distribution of grades awarded” DISPLAY”7: Search the student by Student ID” DISPLAY”8: Search the student by Student Name” DISPLAY”9: Display the highest and the second score” DISPLAY”10: Sort by ID and display” DISPLAY”11: Sort by last name and display” DISPLAY”12: OPTIONAL EXTRA: Calculate and display the standard deviation of the set of overall marks in the unit” DISPLAY ”Please select the following choice:” PROMPT Solute SWITCH(Solute) CASE 1: Choice=false // it will exit the program, assign the choice to false BREAK CASE 2: inputData() BREAK CASE 3: outputData() 19
Image of page 19
BREAK CASE 4: computeAvg() outputAvg() BREAK CASE 5: displayResults() BREAK CASE 6: displayNoGrades() BREAK CASE 7: bubbleSort() searchID() BREAK CASE 8: searchStudentName() BREAK CASE 9: displayHighest() BREAK CASE 10: bubbleSort() outputData() BREAK CASE 11: selectSort() outputData() BREAK CASE 12: calcStandard() BREAK ENDSWITCH // End of Switch statement ENDDO // End of validate loan input 5. DISPLAY “You have exit/quit the program” // Display the message after user exit the program 4.3 Function of inputData() INPUT PROCESSES OUTPUT 20
Image of page 20
numOfStudent StudentClass[]Group StudentClass[]Code sizeOfNew initial - SET initial to true - SET SizeOfNew = 0 - PROMPT numOfStudent - CHECK intial - ADD StudentArrayGroup ADD data SudentArrayGroup 4.3.1 Pseudocode StudentClass[]Group and StudentClass[]Code is declared of array to maintain the data ADD inputData() 1.
Image of page 21
Image of page 22

You've reached the end of your free preview.

Want to read all 66 pages?

  • One '14
  • Return statement, Given name, Display resolution

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture