A structure will be defined (Student ID, Student Name, Student Surname, Midterm, Final, average). The user will be asked to enter the number of Students in the Class (1). Number, name and surname of the students in the class will be entered (2). After entering the whole class number, name and surname, the student's number, name and surname will be shown and the midterm grades will be requested (3). Then, you will be asked to enter the final grades as the midterm is entered (4). 40% midterm, 60% final calculation is made and recorded in the average field (5). The number, name, surname and averages of the students in the class will be shown on the screen (6). The sequence of actions will be performed in the order described. Write the C program code that performs the above operations. Number of students in the class is 10 Any random name, surname, student number, midterm grades and final grades can be used
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
A structure will be defined (Student ID, Student Name, Student Surname, Midterm, Final, average).
The user will be asked to enter the number of Students in the Class (1).
Number, name and surname of the students in the class will be entered (2). After entering the whole class number, name and surname, the student's number, name and surname will be shown and the midterm grades will be requested (3).
Then, you will be asked to enter the final grades as the midterm is entered (4).
40% midterm, 60% final calculation is made and recorded in the average field (5). The number, name, surname and averages of the students in the class will be shown on the screen (6). The sequence of actions will be performed in the order described.
Write the C program code that performs the above operations.
Number of students in the class is 10
Any random name, surname, student number, midterm grades and final grades can be used
Step by step
Solved in 4 steps with 3 images