1. Trang chủ
  2. » Luận Văn - Báo Cáo

Assignment 2 PROG102 Greenwich

34 302 2

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

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 34
Dung lượng 2,61 MB
File đính kèm ASM2_PROG102.rar (2 MB)

Nội dung

Note: Nếu muốn support C, C#, Networking, Database, project web, 1633, security_zalo 0962.986.805 or fb https://www.facebook.com/profile.php?id=100080073517431. Assignment 2 môn Programing (PROG102) đại học Greenwich 2021. Bài luận đạt điểm chuẩn Merit với trích dẫn học thuật harvard. Dựa vào để hoàn thành điểm M là không khó, full code cũng được xuất hiện trong bài, hoàn toàn sửa thành code của bản thân. Giá tiền phải chăng, dành cho người không có thời gian để làm luận hoặc không có form hướng dẫn. Bạn cũng có thể tìm asm1 của môn này bởi vì mình có đăng trọn bộ. Goodluck

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: Resubmission Feedback: 2.1 Grade: Lecturer Signature: Assessor Signature: Date: ASSIGNMENT Analysis and design a solution for procedural programming problem Contents Introduction 1.1 Scenario 1.2 Problem 1.3 Solution Implementation 2.1 Explain about structure of program 2.2 Explain about each function 2.3 Code: 16 Testing 26 Evaluation 29 5.1 Evaluate my program 29 5.2 Evaluate about Procedural programming with my program 30 6.Conclusion 30 Reference list 31 Introduction 1.1 Scenario A math teacher wants to manage grades of a class He asks you to help him to write a small application to that He needs to enter student IDs, student’s grades and store these information into 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 1.2 Problem • The problem of student information management is a difficult problem Manual management method has many disadvantages • I need to find a way to program and create a system that solved the disadvantages of the old method • The program should have the main functions needed to enter, print, calculate min, max, average, exit, … 1.3 Solution • Using procedural programming to write programs • The program needs an interface to select functions, variables and array to enter information: name, ID, age, gender, subject scores • Create separate functions for input, print, find the highest and lowest scores, average score, result, rank, rating, exit Implementation I will explain the whole program: 2.1 Explain about structure of program • Declaration section - Declare libraries: : Provide the ability to enter Use printf, scanf, … : Adjust a variety of characters (char) : Perform math operations, transformations, ordering, … : Use it to use getch(), … - Struct: This section declares a variable stu to store variables related to student information Inside, I declare variables to store information: + a: ID + b: name + c: age + d: gender + math, English, prog, average: points Thanks to the struct structure, I can use the information easily even though there are many students - The next is declaring functions At here, I declare all of functions • Main I write a loop to know the limit of number of students, declare an empty array of structure stu Program interface and switch-case for selecting functions are also created here Within functions are functions applied • After the main This is the place to write the functions, which will be used in main 2.2 Explain about each function • Function “one”: - This function is used to enter student information: ID, name, age, gender, grades of subjects - I use printf to request information from the user - With variables of type int, float, I use scanf to save the parameter to the variable - With variables of type char, I use gets to store the parameter in the variable - I use fflush(stdin); to clear the program’s temporary memory so that there are no garbage values • Function “two”: This function is used to store student information as an element in an array so that it can be easily used Command line Explain Void two (stu u[ ], int o) Declare the function name as “two”, declare the array u[ ] of the structure stu, declare the variable o integer type, o is the limit of the elements of the array for (int i; i

Ngày đăng: 22/03/2022, 18:25

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w