Create a program that takes in a student first name and average mark obtained, the system should the group the students using the first letter in their name modulus 10 [ Remember that characters are considered as numeric values, hence ‘J’%10 is a valid calculation ]. For example if the student name is Cena, then the student belongs to group 7 because ‘C’%10 = 7 and if the name was Jack then the student belongs to group 4. The program should further use the group number to get the group lecturer and class date as follows: [Hint: If the result is 0 then the student belongs to group 10]
Groups
Group Lecturer
Class date
1 , 7, 9
Mrs. T. Chikohora
Monday
2 , 4, 5
Mrs. J. Muntuumo
Wednesday
3, 6, 10
Mr. S. Tjiraso
Friday
Choose the c methods applicable for reading to a text file from the items given below:
(a) get ()
(b) close ()
(c) getw()
(d) fread()
fill in the missing:
Assume the following program snippet writes to text file:
int main() {
FILE * ptr;
int num;
_____________________= fopen("d:\\writingTo_File.txt", "");_________________
if (ptr !=___________________) {
printf("File created successfully!\n");
}
else {
printf("Failed to create the file.\n");
// exit status that an error occurred
return -1;
}#include <stdio.h>
int main() {
FILE * fp;
fp = fopen ("d:\\music.txt", "w");
fprintf (fp ,"Engineering Programming");
fclose(____________);
return______________;
}Assume the following piece of code reads from a text file
int main() {
int sum =0;
FILE * ptr;
ptr = fopen("d:\\students.________","___________");
if (ptr ==NULL){
_______________("file does not exist!!");
exit(0);
}Create a program that takes in a student first name and average mark obtained, the system should the group the students using the first letter in their name modulus 10 [ Remember that characters are considered as numeric values, hence ‘J’%10 is a valid calculation ]. For example if the student name is Cena, then the student belongs to group 7 because ‘C’%10 = 7 and if the name was Jack then the student belongs to group 4. The program should further use the group number to get the group lecturer and class date as follows: [Hint: If the result is 0 then the student belongs to group 10]
Groups
Group Lecturer
Class date
1 , 7, 9
Mrs. T. Chikohora
Monday
2 , 4, 5
Mrs. J. Muntuumo
Wednesday
3, 6, 10
Mr. S. Tjiraso
Friday
Using a whole loop create a that calculates the monthly salaryof N [ where N is the number if employees that's entered by the user.] If the employee worked less or equal to 160 hours, the employee wilk be paid N$240.00 per hour. For any hour greater than 160, the employee is paid N$320.00 per hour.