Starting from:

$30

Computer Programming HW 02 Solution

Prepare your homework 02 without using array. If you use, the grade will be zero.




1. (50 Points)




Write a C program that takes the number of the students from keyboard between 3 and 50. After taking a number of the students, you must generate a random grade for each student (the number of the grades is equal to the number of the students). The grade is between 0 and 100. After the grades are generated, the program displays a menu which is shown below. The menu consist of 5 options:




I. Show most successful student,

II. Show most unsuccessful student,

III. List the number of students for each letter grade, IV. Show calculated average grade

V. Show all four options data.




Options should give same results as in the figures and letter grades must be calculated programmatically according to grade scale which shown in table below. The program won’t close or restart after any option selection until user enter -1 on menu selection. Also, the menu is shown after every selection.




Note: You must use switch cases to construct the menu. Use rand(void) function to create rando m grades. Take as "srand(40) ;".




Grade
Letter Grade
90-100
A
80-89
B
70-79
C
60-69
D
0-59
F



2. (50Points)




Write a C program to find all digits of a number which is entered from the keyboard (the number must be between 23 and 98760). The program screen is shown in below. Do not use

#include <stdlib.h.




You can only use #include .

If you use other library header files, your grade will be zero. Enter the number: 79045




The fifth digit is 7

The fourth digit is 9

The third digit is 0

The second digit is 4

The first digit is 5










General:







1. Obey honor code principles.

2. Read your homework carefully and follow the directives about the I/O format (data file names, file formats, etc.) and submission format strictly. Violating any of these directives will be penalized.

3. Obey coding convention.

4. Your submission is HW02_studentnumber.zip and include the following files and

NOTHING MORE (no data files, object files, etc):

 HW02part1.c

 HW02_<student_name_<studentSurname_<student number_part2.c

 HW02_<student_name_<studentSurname_<student number.pdf (includes some programming screens and any details of part 1 and part 2, separately).

5. Do not use non-English characters in any part of your homework (in body, file name, etc.).

6. Deliver the print out of your work until the last submission date.

7. For questions about homework, you can send an email to b.koca@gtu.com.tr

More products