c language

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

c language

Post by answerhappygod »

c language
C Language 1
C Language 1 (60.04 KiB) Viewed 27 times
C Language 2
C Language 2 (60.04 KiB) Viewed 27 times
C Language 3
C Language 3 (70.65 KiB) Viewed 27 times
C Language 4
C Language 4 (7.11 KiB) Viewed 27 times
C Language 5
C Language 5 (30.42 KiB) Viewed 27 times
Problem Write a C program that simulates a student registration system and shows output as in the given sample. In the program, material covered until end of week 13 should only be used. The program should run successfully with different scenarios. It is not allowed to use constants, global variables/arrays except the mentioned in this assignment. Program should utilize the following functions only: 1) Function LoadData that performs the following: • take 3 parameters: • A char 10 array Student Data of size 5. • An integer 10 array StudentsIDs of size 5. • An integer 2D array Registration of size 5x4 • Initialize Student Data with your AUM ID (5 digits). Using pointers syntax is mandatory in this part. (10 points) • Initialize Students IDs with random student IDs. Each student ID should be in the range 20000 - your AUM ID. For example, if your AUM student ID is 62143 then the array Studentsits should be initialized with IDs in the range 20000 - 62143. Invalid IDs should not be added to the array. Different random IDs should be generated each time the program is executed. Using pointers syntax is mandatory in this part. (5 points) • Initialize Registration with -1 your AUM student ID as in the below table, which means that no student is registered yet in any course. Using pointers syntax is mandatory in this part. (5 points) Student ID Course1 code Course2 code Course 3 code -62143 -62143 -62143 -62143 -62143 -62143 -62143 -62143 -62143 -62143 -62143 -62143 -62143 -62143 -62143 -62143 -62143 -62143 -62143 -62143 2) Function PrintData that performs the following • take 2 parameters: An integer 10 array StudentsIDs of size 5 An integer 2D array Registration of size 5X4 • Print the students' IDs by printing the array StudentsIDs in reverse order as shown in the below sample output. Using index notation is mandatory in this part. (5 points) • Using a do while loop, repeatedly print a menu on the screen with the following options: (5 points) 1. Register a student in a course 2. Display registration table 4. Exit program

Prompt the user to enter valid choice (integer) from the above menu. If the user enters an invalid choice, an error message should be displayed and the menu should be re- printed. If the user enters 1, it should call the function Register. If the user enters 2, the array Registration should be printed on screen as shown in the sample output (Registration Summary). The unused rows (contain value -52143) should not be printed. If the user enters 4, then the program should terminate. Using pointers syntax is not allowed in this part (10 points) 3) Function Register that performs the following • takes 2 parameters: • An integer 10 array StudentsIDs of size 5 • An integer 2D array Registration of size 5x4 • Prompt the user to enter a student ID. The entered ID should be validated by accessing the array StudentsiDs. An appropriate error message should be displayed in case of invalid data entered (student ID is not found). The user should have the option to re-enter a valid student ID or return to previous menu by enteringo. Using Index syntax is mandatory in this part. (5 points) • Prompt the user to enter course code. The entered value should be validated (should be between 110 and 909 inclusive). An appropriate error message should be displayed in case of invalid course code entered. The user should have the option to re-enter a valid course code or return to previous menu by entering 0. (5 points) • In case the data entered (student ID and course code) are both valid, this function should update the Registration array by registering (e storing) the student ID and course code in the correct indexes. In the Registration array, only one row can be used for each student. A student is not eligible to register in more than 3 courses (An error message "Student is already registered in 3 courses should be displayed in such case). A student cannot register a course if he/she is already registered in it (An error message "Student is already registered in this course" should be displayed in this case). After each successful registration is done, a confirmation message should be displayed on screen as in the sample output. A message The Registration array is full should be displayed if registration fails due to full array (5 students are registered in the array). Using pointers syntax is not allowed in this part. (30 points) 4) Main function should perform the following • Declare 3 arrays: • A char 10 array Student Data of size 5. • An integer 10 array StudentsIDs of size 5. An integer 2D array Registration of size 5x4. Call function LoadData(5 points) By accessing the array StudentData, print a message based on the following rules: Student ID Message Less than 50000 System created be Student xx WY Between 50000 and 52999 Registration System by xxx WY 53000 or above Developer: Xox WY

Using local variables, other arrays, loops and if/if else statements are not allowed in this part. xxyy is the student name (10 points) • Call function PrintData. (5 points)

Sample output (Student ID=62143): Developer: Xxx yy. 10: 62143 Students TDS: 20388 45848 20436 44065 46775 Registration system menu 1. Register a student in a course 2. Display registration summary 4. Exit program Enter your choice: 1 Enter Student ID to register (or enter to return to menu): 44065 Enter course code to register (or enter o to return to menu): 150 Student 4486 has been successfully registered in course 159 Registration system menu 1. Register a student in a course 2. Display registration summary 1. Exit program Enter your choice: 1 Enter student in to register (or enter to return to menu): 45848 @ Enter course code to register (or entere to return to menu): 261 Student 45848 has been successfully registered in course 261 Registration system menu 1. Register a student in a course 2. Display registration summary 4. Exit progran Enter your choice: 2 Registration Summary: Student ID Course Code 44065 159 45848 261 Registration system menu 1. Register a student in a course 2. Display registration summary 4. Exit program Enter your choice: 4
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply