please write a c program for each of the following final exam program 1,2 & 3 and they should be in visual studio community. Attached is final exams programs
5
pick you
indeterministic and if the loop is entrance-controlled or exit-controlled.
Exam 4 Program 2: Write a C program that picks a random number from 1 to 100. Allow the user to guess
the random number by printing if each guess is higher or lower than the random number. If the user cannot
guess the random number in 7 guesses, print out the random number picked. If the user guesses the number
in 7 or fewer guesses, print how many guesses it took the user to guess the random number.
Final Exam Program 1: Write a C program which uses the following functions for an array of 5 names:
a. Load the array from the keyboard
b. Print the array
c. Sort the array in ascending order
d. Print the array again using the same print function from b
e. Allow the user to enter a full name and search for the full name in the array. Print “found” if the full name
is in the array or print “not found” if the full name is not in the array.
Final Exam Program 2: You need a program to maintain information for a class of students. Each student’s
data include their name, their three homework grades, and their two exam scores. The homework grades
range from 0 to 25 while the exam scores range from 0 to 100. For the class, homework counts for 40% of
the final grade while the exams count for 60% of the final grade. Assume that the following data is to be
used:
Name
HWK1
Peters, Kevin 18
Barth, Mary 25
James, Chris 15
Student, Lousy 2
Adams, Larry 15
HWK2
24
25
16
2
14
HWK 3
20
20
20
4
18
EXAM 1
76
96
58
4
77
EXAM 2
88
99
75
6
83
Write a C program which uses the following functions and parameter passing for an array of structures
for the 5 students:
a. Allow the user to enter in the data for each student. For each student, calculate the total homework points,
the total exam points, the class percentage, and the letter grade using the same formulas from Exam 1
Program 2 and the grade scale from Exam 2 Program 1. Place the calculated values into the array of
structures.
b. Sort the array of structures on name and print the array after the sort is completed.
c. Calculate and print the average exam 1 score and the average exam 2 score. In addition, calculate and
print how many of each letter grade was given for the students. That is, how many A’s, how many B’s, how
many C’s, how many D’s, and how many F’s.
d. Save the array of structures to a text file.
e. Retrieve and print the text file.
f. Save the array of structures to a binary file.
g. Retrieve and print the binary file.
Your program output should include the following: All the student data printed after being sorted by name,
the average exam 1 score, the average exam 2 score for the five students and how many of each letter grade
was given for the students, the student data should be printed again after the text file has been saved and
retrieved, and the student data should be printed one last time after the binary file has been saved and
retrieved.
You will also need to show your text file which you can do from any text editor when submitting this program.
Final Exam Program 3: Write a C program which uses a recursive function to find the sum of the first n cubes
where n is entered by the user. That is 13+ 23 + 33 + 43+ + nº
…..