




















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Scenario: A math teacher wants to manage grades of a class. He asks you to help him to write a small application to do that. He needs to enter student IDs, student’s grades and store these information into 2 separate arrays (integer array for IDs and float array for grades). Then he needs to print all student IDs together with their grades. Finally, he needs to know which student has highest grade and lowest grade. Your program should be menu based with the options above. When an option is done,
Typology: Study Guides, Projects, Research
1 / 28
This page cannot be seen from the preview
Don't miss anything!





















Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Prog102: Procedural Programming Submission date 13/10/2021 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Nguyen Thai Hiep Student ID GCH Class GCH1001 Assessor name Student declaration I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that making a false declaration is a form of malpractice. Student’s signature Hiep Grading grid P1 P2 P3 M1 M2 D
Grade: Assessor Signature: Date: Lecturer Signature:
output. Simply put, procedural programming involves writing down a list of instructions to tell the computer what it should do to finish the task. Procedural Programming
Procedure A Procedure B Procedure C Procedure Y Procedure X
C++: C++ is a general-purpose programming language created by Bjarne Stroustrup as an extension of the C programming language
PYTHON: Python is an interpreted high-level general-purpose programming language. Almost, programs language have file extension corresponding such as Python is .py, Ruby is .rb…..
#include <stdio.h> void main () { int age = 19; printf("Age : %d",age); } OUTPUT Age : 19 Normally, in command ‘printf’, Int will be ‘% d ’ or ‘% i ’, Float will be ‘% f ’, ‘%. 1f ’ or ‘% 1. f ’, [%f will show full decimal, %.1f will show one decimal and %1.f will rounding number], Char will be ‘% c ’, Char is an acronym for a character. Depending on the case, char will be taken in ASCII. For String , it will be ‘%s’. In C++, will not have variable ‘string’. [30] is character limit in this variable
selection items from menu max Float Scan highest grade min Float Scan lowest grade check Boolen To check. If user didn’t input information first. Another option could not use.
WBS - WBS to breakdown a problem into small ones. After I read the scenario, I understood the problem and had solutions to manage grades for students by using WBS. In my WBS, I have subdivided it into 5 functions of problem to solve problem. When teacher start program, teacher will see a menu that have 5 options: ❖ Option 1: After teacher enter total of student, next, teacher must enter information of their student, (Name, ID, Grade), if not, they can’t use another option. ❖ Option 2: Show information, this function will print all of information that import in option 1 to screen. ❖ Option 3: Find and print the student who have highest score to screen with their same ID. ❖ Option 4: Function same as option 3. But instead of looking for the highest scorer, we find the lowest scorer. ❖ Option 5: To exit program when teacher need to exit program. 1) Use-case diagram for student’s manage system 14 Input Name Input ID Input Grade Name/ID include Enter information of student Input total of student include Grade Show information
Explain main program by pseudo code: Step 1: START Step 2: DECLARE the variable n, ID[], grade[], name[], check, option
Step 3: SET check=false Step 4: CALL printMenu() Step 5: Input option Step 6: If option=1 then Step 6.1: CALL inputList() Step 6.2: SET check=true Step 7: ELSE (check=false) is true, return Step 5. Step 8: IF option=2 then CALL printList() Step 9: IF option=3 then CALL findMax() Step 10: IF option=4 then CALL findMin() Step 11: IF option=5 then GO TO Step 13 Step 12: WHILE option != 5, repeat Step 5 Step13: STOP Menu list
Explain menuList by pseudo code: Step 1: START Step 2: PRINT (“Input total student(3-30) ”) Step 3: PRINT ("1. Input information") Step 4: PRINT ("2. Show information") Step 4: PRINT ("2. Show information") Step 5: PRINT ("3. Find the student have highest score.") Step 6: PRINT ("4. Find the student have lowest score.") Step 7: PRINT ("5. Exit") Step 8: PRINT (“ Input your choice “) Step 9: STOP Input list