1. Trang chủ
  2. » Công Nghệ Thông Tin

Assignment 2 Procedural Programming

7 2 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 7
Dung lượng 114,04 KB

Nội dung

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 R.

ASSIGNMENT FRONT SHEET Qualification BTEC Level 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 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  Summative Feedback: Grade: Lecturer Signature:  Resubmission Feedback: Assessor Signature: Date: ASSIGNMENT GUIDE Implementation (P4, M3) Declaring libraries used in program #include : Provide the core of the typing capabilities in C int inputsvID(char ID[][10]); void inputgrade(float grade[], int n); void max(char studentID[][10], float studentgrade[],int n); void min(char studentID[][10], float studentgrade[], int n); void displayall(int numstudent); Declaring variables used in program: Int main(void) is a variable to declare main() function used in the program Int means that main() can only return integer values Void has the effect of specifying the main() function to return no value int main (){     char ID[50][10];     float grade[50];     int n = inputsvID(ID);     inputgrade(grade, n);     float studentgrade;     max(ID ,grade, n);     min(ID ,grade, n);     int numstudent; } Int: This is an integer; it basically represents the natural size of the integer It is used to set variables a, c, option, ID in the program •Float: This is a real number type, used to store floating point numbers For example 2.5 and 5.6 are real numbers It is used to declare the variable Sgrade in the program char: this is the character type used in Name void displayall(int numstudent){     printf("Total number of student: %d",numstudent);     for (int i = 0; i < numstudent; i++){   } } We create a function void displayall(int numstudent) used to input data from the keyboard for arrays In the function we use a for loop starting from int i =0 and ending when i

Ngày đăng: 28/02/2023, 20:34

w