Assignment 2 - prog102, Assignments of C programming

The math teacher wants to manage class grades. He asks you to help write a small application to do that. He needs to enter the student ID and student grades and store this information in two separate arrays: an integer array of IDs and a float array of grades. Next, you need to print all student IDs along with your grades. Finally, he needs to know which students have the highest and lowest grades. The program must be menu-based with the above options.

Typology: Assignments

2021/2022

Uploaded on 03/07/2022

Hermes0066
Hermes0066 🇻🇳

5

(3)

2 documents

1 / 14

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Date:3/3/2022
Tran The Hao
Class: GCS1003B | ID: GCS210785
PROCEDURAL PROGRAMING
REPORT
ASIGNMENT 2
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe

Partial preview of the text

Download Assignment 2 - prog102 and more Assignments C programming in PDF only on Docsity!

Date:3/3/ 2022

Tran The Hao

Class: GCS1003B | ID: GCS

PROCEDURAL PROGRAMING

REPORT

ASIGNMENT 2

ASSIGNMENT 2 FRONT SHEET Qualification BTEC Level 5 HND Diploma in Computing Unit number and title PROG102: Procedural Programming Submission date Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name TRAN THE HAO Student ID GCS Class GCS1003B Assessor name: LE NGOC THANH 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

Assignment Brief 2 (RQF)

Higher National Certificate/Diploma in Computing

Unit Number and Title Procedural Programming Academic Year 2021 Unit Tutor Assignment Title Analysis and Design a solution for procedural programming problem Issue Date Submission Date IV Name & Date Learning Outcomes and Assessment Criteria Pass Merit Distinction LO3 Be able to implement procedural programming solutions LO4 Be able to test procedural programming solutions P4 Write a program that implements the designed solution. M3 Program is written following coding standards, input data are validated D2 Evaluate your program, state lessons learnt and future improvements. P5 Test the program with proper test plan. M4 Analyse test results for future maintenance. Assignment Brief Scenario: Please refer to scenario in Assignment 1. Tasks 1 Your next task is to implement the software that you designed in previous steps. You need to implement the software designed in assignment 1 using C programming language. Your code must make use of programming standards, including file headers and effective code commenting. You need to provide screenshots of your program when running. During the development of your program, if you make any changes to the original design, state them with reasons in report. Your code listings must be included as an appendix. Task 2 Test your program by making a test plan, execute it and log results. Your test plan should include data validation and program operations based on requirements. Test results (passed or failed) should be analysed to help the program in future maintenance. Task 3 Write an evaluation and conclusion of the whole development. The evaluation of your program should be based on its running and its test result. You should mention about lessons learnt and future improvement. Also evaluate how procedural programming is applied in your program, state benefits, disadvantages or difficulties. A final report of these 3 tasks must be submitted in PDF format to CMS. Submission Format The submission is in the form of a Word document. You are required to make use of appropriate structure, including headings, paragraphs, subsections and illustrations as appropriate, and all work must be supported with research and referenced using the Harvard referencing system.

Contents

  • Assignment Brief 2 (RQF)
    • Higher National Certificate/Diploma in Computing
  • A. SOLVE PROBLEM AND RESULT............................................................................
    • I. Problem:
    • III. Explanation code (P4):
        1. Global variables:
        1. Function input information of student’s:
        1. Function display information of student:
        1. Function find the highest grades of student:
        1. Menu Options:
  • B. RESULT:
    • I. Result for the case data 1:.....................................................................................
    • II. Result for the case data 2:.....................................................................................
  • C. TEST AND RUN (P5) :
  • D. Conclusion
    • I. Evaluation of program (D2,M4):
      • a. Advantage:..........................................................................................................
      • b. Disadvantages:
    • II. C coding standard completion (M3):
  • E. Reference:
  1. Function display information of student: This code help you print student information to the screen
  2. Function find the highest grades of student: This code help you find the student has highest grades and print to the screen. Print the result on the screen
  3. Menu Options: Helps to display more options in the menu. Example: input student ID & grades, view student, find the highest or lowest grades of student, exit program. This menu have 5 option for choose, if you choose <1 or >5. Input will invalid and choose again.

B. RESULT: I. Result for the case data 1: Enter the appropriate information in this situation. First, the system displays a menu with five choices. You need to select one of them (options 1 through 5) and add it to the menu. For example, pressing number 1 will create a list containing all student IDs and grades. After that, you will need to enter the number of students in the class, ID, and grades. Figures 1 : Enter option 1 Figures 2 : Enter the number of students in class

Finally, press number 5 to exit program Figures 7: End the program II. Result for the case data 2: In case 2, I’ll go through some of the most typical errors that people make. To begin, I’ll choose wrong selection. For example, if the user don’t select choice 1 to choice 5, system will require the user to input again. Figures 8: Choosing an invalid option When you input duplicated IDs, the user need input again. Figures 9: Entering duplicated IDs When you type negative number in grade, user need to tap right number. Figures 10: Entering negative grade

C. TEST AND RUN (P5) : Test case Step Test data Expected result Actually result Pass/ Fail Fix

  • Input

choice 1.

  • Input

number of

student.

  • Input

student’s

information

from

keyboard.

  • Number of

student:

  • ID: 1, 2, 3, 4,
  • Grade:

Warning error

at Grade of ID:

Passed

  • Input

choice 2

Passed

3 - Input

choice 3

  • ID: 5
  • Grade:8.

Passed

  • Input

choice 4

  • ID:1,
  • Grade:5.

Passed

5 - Input

choice 6

Warning:

INVALID!!!

Passed

  • Input

choice 1

  • Enter number

of student : 51

and - 1

Warning:

INVALID

NUMBER OF

STUDENT.

Passed

7 - Input

choice 1

Input

ID:GCS

Grade: 8

ID:GCS

Grade: 8

Failed Don’t

type

word.

  1. All reasonable effort shall be taken to keep the length of each function limited to one printed page, or a maximum of 100 lines.
  2. No procedure shall have a name that overlaps a function in the C Standard Library. Examples of such names include strlen, atoi, and memset.
  3. No function name shall contain any uppercase letters.
  4. All new structures, unions, and enumerations shall be named via a typedef.
  5. The comma operator (,) shall not be used within variable declarations.
  6. With the exception of the initialization of a loop counter in the first clause of a for statement and the change to the same variable in the third, no assignment shall be made in any loop’s controlling expression.

E. Reference:

Techopedia.com. (2019). What is C (Programming Language)? - Definition from Techopedia. [online] Available at:

https://www.techopedia.com/definition/24068/c-programming-language-c.

OpenGenus IQ: Computing Expertise & Legacy. (2019). Functions in C. [online] Available at:

https://iq.opengenus.org/functions-c/.

learn.onlinegdb.com. (n.d.). Switch Case Statement | Learn Programming step by step. [online] Available at:

http://learn.onlinegdb.com/switch_case_statement_c.

Learn Computer Science. (2021). Procedural Programming | Procedural Programming Paradigm Explained. [online] Available

at: https://www.learncomputerscienceonline.com/procedural-programming/.

www.programiz.com. (n.d.). Understand C++ Function With Examples. [online] Available at: https://www.programiz.com/cpp-

programming/function.

Study.com. (2020). For Loop: Definition, Example & Results - Video & Lesson Transcript | Study.com. [online] Available at:

https://study.com/academy/lesson/for-loop-definition-example-results.html.

Tekslate. (n.d.). Advantages And Disadvantages Of C Language. [online] Available at: https://tekslate.com/advantages-c-

language.

Tutorialspoint.com. (2019). C - Variables - Tutorialspoint. [online] Available at:

https://www.tutorialspoint.com/cprogramming/c_variables.htm.

Tutorialspoint.com. (2019). do...while loop in C - Tutorialspoint. [online] Available at:

https://www.tutorialspoint.com/cprogramming/c_do_while_loop.htm.

Tutorialspoint.com. (2019). C - Functions - Tutorialspoint. [online] Available at:

https://www.tutorialspoint.com/cprogramming/c_functions.htm.

Tutorialspoint.com. (2019). while loop in C - Tutorialspoint. [online] Available at:

https://www.tutorialspoint.com/cprogramming/c_while_loop.htm.

W3schools. (2014). C Data Types. [online] Available at: https://www.w3schools.in/c-tutorial/data-types/.

What is Procedural Programming? Key Features of Procedural Programming (2019). What is Procedural Programming? Key

Features of Procedural Programming. [online] Hackr.io. Available at: https://hackr.io/blog/procedural-programming.

Techterms.com. (2011). Programming Language Definition. [online] Available at:

https://techterms.com/definition/programming_language.

BINARYUPDATES.COM. (2016). Variables and Data Types in C Programming. [online] Available at:

https://binaryupdates.com/variables-and-data-types-in-c/.

beginnersbook.com. (2014). C - while loop in C programming with example. [online] Available at:

https://beginnersbook.com/2014/01/c-while-loop/.