Assignment 2 Procedural Programming M->D, Assignments of C programming

Almost got Distention and didn't give any more explanation

Typology: Assignments

2020/2021

Uploaded on 09/12/2021

UnderLine07
UnderLine07 šŸ‡»šŸ‡³

4.7

(66)

16 documents

1 / 23

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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
DNG
Student ID
Class
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
Grading grid
P4
P5
M3
M4
D2
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17

Partial preview of the text

Download Assignment 2 Procedural Programming M->D and more Assignments C programming in PDF only on Docsity!

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 DNG^ Student ID Class 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 Grading grid P 4 P 5 M3 M4 D

 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date: Lecturer Signature:

  • Table of Figure
    1. Introduction
    1. Chapter 1: Implementation and explain program
    • 2.1 Scenario:
    • 2.2 Library
    • 2.3 Variable
    • 2.3 Functions..........................................................................................................................................
      • 2.3.1 Function login
      • 2.3.2 Function input
      • 2.3.3 Function output
      • 2.3.4 Function rank
      • 2.3.5 Function average
      • 2.3.6 Function passrate
      • 2.3.7 Function max
      • 2.3.8 Function min................................................................................................................................
      • 2.3.9 Function main..............................................................................................................................
    • 2.4 Review program.............................................................................................................................
    1. Chapter 2: Test Plan
    1. Evaluation Program
    1. Inconclusion
  • Figure 1- Libraries of program Table of Figure
  • Figure 2- Variables of program
  • Figure 3- Function login
  • Figure 4- Running Function Login
  • Figure 5- Function Input.................................................................................................................................
  • Figure 6- Running Function Input
  • Figure 7- Function Output
  • Figure 8- Running Function Output
  • Figure 9- Function Rank...............................................................................................................................
  • Figure 10- Running Function Rank
  • Figure 11- Function Average
  • Figure 12- Running Function Average
  • Figure 13- Function Passrate
  • Figure 14- Running Function Passrate
  • Figure 15- Function Max
  • Figure 16- Running Function Max
  • Figure 17- Function Min
  • Figure 18- Running Function Min................................................................................................................
  • Figure 19- Set color for program and input total student
  • Figure 20- Running Input Total Student
  • Figure 21- Menu Control
  • Figure 22- Features of program
  • Figure 23- Invalid Choice.............................................................................................................................
  • Figure 24- Error when user did not enter student information before..........................................................
  • Figure 25- When user choose case 1 twice in a row
  • Figure 26- Exit Program
  • Figure 27- User input statement in grade of student

Main Content:

1. Introduction

After I have designed the solution for the Assignment 1 situation. In Assignment 2, I will demonstrate how to apply procedural programming in solving the scenario. I will use C language to create the best possible software that I have learned after taking Procedural Programming. Actually, when I did assignment 1, I wrote a program that met the requirements, but it was not very good when I could not separate the code in the main () function into functions. However, in this Assignment 2 I have overcome that. In addition, I have made an extra step so that users have to log in to use the program and I also created a few functions that are quite useful in managing students' grades. In this assignment, I will present in 2-chapter as: Chapter 1: Implementation and explain program Chapter 2: Test Plan

2. Chapter 1: Implementation and explain program

2.1 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, the program should go back to the main menu so he can choose another option. There should be an option to quit program. The following is a program that I created to respond to this situation and it also has a few more interesting features. I'll break it down into important pieces of code so that it's easier for people to understand my program.

When going to each function, I will explain more about how variables are used in the operation of the program.

2.3 Functions

2.3.1 Function login Figure 3 - Function login A new function compared to my assignment 1. This is a feature I find very interesting and I have invested a lot of time in reading documentation and writing code. This function has the ability to require the user to enter the correct "loginname (admin)" and "password (123456)", then the program will start showing the

main interface for users to use the program. This function is written based on the endless loop ā€œWhileā€ to ask the user for correct input and the function ā€œstrcmp(string compare) ā€ information, the program will print the message "Login success". Figure 4 - Running Function Login 2.3.2 Function input

"input" function will stop. Figure 6 - Running Function Input 2.3.3 Function output

Figure 7 - Function Output Figure 8 - Running Function Output

2.3.5 Function average Figure 11 - Function Average Figure 12 - Running Function Average 2.3.6 Function passrate Figure 13 - Function Passrate

Figure 14 - Running Function Passrate 2.3.7 Function max Figure 15 - Function Max Figure 16 - Running Function Max 2.3.8 Function min

Figure 19 - Set color for program and input total student Figure 20 - Running Input Total Student

Figure 21 - Menu Control

Figure 24 - Error when user did not enter student information before

be notified that: ā€œData has been enteredā€ and the break statement will stop the case. first. Figure 25 - When user choose case 1 twice in a row