ASSIGNMENT 2 Procedural Programming, Assignments of Computer Science

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, the progr

Typology: Assignments

2020/2021

Uploaded on 03/26/2021

trantuan
trantuan 🇻🇳

4.9

(32)

2 documents

1 / 15

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ASSIGNMENT 2 FRONT SHEET
Qualification
BTEC Level 5 HND Diploma in Computing
Unit number and title
Unit 0: Procedural Programming
Submission date
Date Received 1st
submission
Re-submission Date
Date Received 2nd
submission
Student Name
Dong Minh Quan
Student ID
GCH200669
Class
GCH0905
Assessor name
Nguyen Dinh Tran Long
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
Grading grid
P4
P5
M3
M4
D2
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download ASSIGNMENT 2 Procedural Programming and more Assignments Computer Science in PDF only on Docsity!

ASSIGNMENT 2 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 0 : Procedural Programming Submission date Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Dong Minh Quan Student ID GCH Class GCH0905 Assessor name Nguyen Dinh Tran Long 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 Grading grid P4 P5 M3 M4 D

 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date: Lecturer Signature:

Task I. Sceenshot & Explain

1. Problem

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, the program should go back to the main menu so he can choose another option. There should be an option to quit program.

2. Solve problem

I write a program is used to manage student information. The main functions of program is:

  • Input student information (Student ID, Student Grades)
  • Display student information (Print to the screen)
  • Find the student has highest grades
  • Find the student has lowest grades
  • Exit
  1. Code explanation ▪ Global variables: - In this program, I use 3 libraries which are stdio.h and stdlib.h. - Students for total students, ID[30] for ID, grade [10] for grade Figure 1. Global variables of program.

Help you print student information to the screen. ▪ Function find the highest grades of student: Help you find the student has highest grades and print to the screen.

  • Max = grades[0], max ID = IDs[0]
  • I from 0 to students - 1
  • If max < grades[i] then max = grades[i], maxID = IDs[i]
  • Print the result on the screen Figure 3. Print information of student to the screen. Figure 4. Find the highest grades of student.

▪ Function find the lowest grades of student: Help you find the student has lowest grades and print to the screen.

  • Min grades[0], min ID = IDs[0]
  • I from 0 to students - 1
  • If min > grades[i] then min = grades[i], minID = IDs[i]
  • Print the result on the screen Figure 5. Find the lowest grades of student.

Task II. Testing

1 Sceenshot.

▪ Menu Options:

▪ Enter student’s information(5- 3 0):

Figure 8. Enter student’s information. Figure 7. Menu Options.

▪ Display information of student’s to the screen: Figure 9. isplay information of student's. ▪ Find the highest grades of student: Figure 10. Find the highest grades of student.

2 Test plan Test case What is being test How Data Expected result Result Evaluate 1 User input selection Int choice Range:1- 5 Try to input boundary data, typical data, bad data A,b,c,,&… Error Error Pass Typical data(1,2,..) Accepted Accepted Pass Decimal in typical data(1.1,1.2…) Error Accepted Fail Bad data(statement) Error Error Pass Boundary data Error Pass 2 Input the number of student ID[30] Try to input boundary data, typical data, bad data A,b,c,,&… Error Error Pass Typical data(5,6,7..) Accepted Accepted Pass Decimal in typical data(5.1,6.2…) Error Accepted Fail Bad data(statement) Error Error Pass Boundary data Error Error Pass 3 Input the student ID Int ID[30] Try to input boundary data, typical data, bad data A,b,c,*,&… Error Accepted Fail Typical data(1,2,3..) Accepted Accepted Pass Decimal in typical data(1.1,1.2…) Error Accepted Fail Bad data(statement) Error Accepted Fail Duplicate Error Error Pass

Input student grades Float grades Try to input boundary data, typical data, bad data A,b,c,*,&… Error Accepted Typical data(1,2,3..) Accepted Accepted Pass Decimal in typical data(1.1,1.2…) Accepted Accepted Pass Bad data(statement) Error Accepted Fail Boundary data Error Error Pass 5 Function of printing information of student Selection: 2 None Display all information(ID, grades) student was entered. Accepted Pass 6 Function of printing student has highest grades Selection: 3 None Display the student has highest grades(grades,ID) Accepted Pass 7 Function of printing student has lowest grades Selection: 4 None Display the student has lowest grades(grades,ID) Accepted Pass