POST #4 I have posted this 5 times, so, whoever is able to make the code that co
ID: 3570408 • Letter: P
Question
POST #4
I have posted this 5 times, so, whoever is able to make the code that completes the tasks and COMPILES I will give 7500 points, IF EXTRA is also completed. Just leave the same answer on all question posts, or separate in 5 parts. IF IT WORKS I will give you all the points.
#1 - https://www.chegg.com/homework-help/questions-and-answers/post-1-posted-5-times-whoever-able-make-code-completes-tasks-compiles-give-7500-points-ext-q6404659
#2 - https://www.chegg.com/homework-help/questions-and-answers/post-2-posted-5-times-whoever-able-make-code-completes-tasks-compiles-give-7500-points-ext-q6404675
#3 - https://www.chegg.com/homework-help/questions-and-answers/post-3-posted-5-times-whoever-able-make-code-completes-tasks-compiles-give-7500-points-ext-q6404681
#4 - https://www.chegg.com/homework-help/questions-and-answers/post-4-posted-5-times-whoever-able-make-code-completes-tasks-compiles-give-7500-points-ext-q6404685
#5 - https://www.chegg.com/homework-help/questions-and-answers/post-5-extra-posted-5-times-whoever-able-make-code-completes-tasks-compiles-give-7500-poin-q6404683
Problem Description using C:
Big Jim is opening a new pizza restaurant and needs a program that reads a data file containing his employee information and prints a summary report of employees and salary. His data file contains two kinds of transactions that his reporting program must process: an employee insertion transaction and a reporting transaction.
An insertion transaction starts with the tag
Explanation / Answer
#include<stdio.h>
#define SIZE 50
struct student {
char name[30];
int rollno;
int sub[3];
};
void main() {
int i, j, max, count, total, n, a[SIZE], ni;
struct student st[SIZE];
clrscr();
printf("Enter how many students: ");
scanf("%d", &n);
/* for loop to read the names and roll numbers*/
for (i = 0; i < n; i++) {
printf(" Enter name and roll number for student %d : ", i);
scanf("%s", &st[i].name);
scanf("%d", &st[i].rollno);
}
/* for loop to read ith student's jth subject*/
for (i = 0; i < n; i++) {
for (j = 0; j <= 2; j++) {
printf(" Enter marks of student %d for subject %d : ", i, j);
scanf("%d", &st[i].sub[j]);
}
}
/* (i) for loop to calculate total marks obtained by each student*/
for (i = 0; i < n; i++) {
total = 0;
for (j = 0; j < 3; j++) {
total = total + st[i].sub[j];
}
printf(" Total marks obtained by student %s are %dn", st[i].name,total);
a[i] = total;
}
/* (ii) for loop to list out the student's roll numbers who
have secured the highest marks in each subject */
/* roll number who secured the highest marks */
for (j = 0; j < 3; j++) {
max = 0;
for (i = 0; i < n; i++) {
if (max < st[i].sub[j]) {
max = st[i].sub[j];
ni = i;
}
}
printf(" Student %s got maximum marks = %d in Subject : %d",st[ni].name, max, j);
}
max = 0;
for (i = 0; i < n; i++) {
if (max < a[i]) {
max = a[i];
ni = i;
}
}
printf(" %s obtained the total highest marks.", st[ni].name);
getch();
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.