Question
write a C progam not C++
please include comments im a beginner
During a drawing competition, the review system is implemented by assigning 3 to 5 reviewers per submission. Each drawing is
Write A DO Week 14 - COS135- https://bbcourses... Write a C program to read, process, and output data as explained below: 1.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <stdio.h>
#include<string.h>

int main()
{
int NumOfStudents;
printf("enter number of students");
scanf("%d",&NumOfStudents);
int i=0;
int sum;
int remainder;
int p;
char Names[NumOfStudents][50];
int Marks[NumOfStudents];
printf("\nEnter names, marks paralelly");
for (i=0;i<NumOfStudents;i++)
{
scanf("%c",&Names[i]);
scanf("%d",&Marks[i]);

}
float avg[NumOfStudents];
for (int i=0;i<NumOfStudents;i++)
{
while(Marks[i]!=0)
{ p=1;
remainder = Marks[i] % 10;
sum = sum + remainder;
Marks[i]= Marks[i]/ 10;
p++;
}
avg[i]=sum/p;
}

printf( "\n Name\tMarks\tavg");
for (i=0;i<NumOfStudents;i++);
{
printf("\n%s\t%d\t%f",Names[i],Marks[i],avg[i]);
}

return 0;
}

output:

enter number of students
3
Enter names, marks paralelly
 Name   Marks   avg

James 24152 2.8

Ann 145 3.33

Mark 432 3

Add a comment
Know the answer?
Add Answer to:
write a C progam not C++ please include comments im a beginner During a drawing competition,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Exercise 7: Program exercise for Basic List operations Write a complete Python program including minimal comments...

    Exercise 7: Program exercise for Basic List operations Write a complete Python program including minimal comments (ile name, your name, and problem description) that solves the following problem with the main function: Problem Specification: Write a program that reads a number of scores from the user and performs the following 1. Read scores from the user until the user enters nothing but Center > key 2. Store scores into a list for processing below 3. Find the average of the...

  • C++ please use only easy code and stdio.h because im just a beginner Description Write the...

    C++ please use only easy code and stdio.h because im just a beginner Description Write the program that can manage the information of students as follows: S 1. This program has two phase; the input phase and the output phase. 2. In an input phase, a teacher inputs the information (name, score, and department) for each student. The total number of students who can be inputted should be defined as a NUM OF_STUDENT constant value. In this example, the value...

  • C programming. please include comments In this lab, you will learn to read data from and...

    C programming. please include comments In this lab, you will learn to read data from and write data to a file - another use for pointers. SAMPLE PROGRAM There are two sample programs this week - WriteFile.c and ReadFile.c. The first, WriteFile.c, allows the user to enter customer names (first, middle, and last), and writes each name to an output text file, customerNames.txt. formatted as: firstName middlelnitial lastName" After you've run it once, what happens to the names you added...

  • Write a C program to compute average grades for a course. The course records are in...

    Write a C program to compute average grades for a course. The course records are in a single file and are organized according to the following format: Each line contains a student’s first name, then one space, then the student’s last name, then one space, then some number of quiz scores that, if they exist, are separated by one space. Each student will have zero to ten scores, and each score is an integer not greater than 100. Your program...

  • C++ please make it sifferent and unique Description Write a program that will read data from...

    C++ please make it sifferent and unique Description Write a program that will read data from the file "p6.dat". The file (that you will create) always contains 15 test scores (whole numbers between O and 100). The test scores are scores for 5 students taking 3 tests, and are arranged, in the file, by the student - that is the first 3 numbers are the test scores for test 1, 2, and 3 for the first student, etc. The program...

  • PLEASE USE BASIC C++ CODE PLEASE USE BASIC C++ CODE PLEASE HAVE DONE AS SOON AS...

    PLEASE USE BASIC C++ CODE PLEASE USE BASIC C++ CODE PLEASE HAVE DONE AS SOON AS POSSIBLE THANK YOU I REALLY APPRECIATE IT FILE TEXT: Mary 80 90 75 90 85 Joe 80 65 80 80 80 Same program as Quiz #4, but this time it must be done with arrays: Write a program that calculates the average of 5 test scores for each student on the file. Function 1--write a function to read the student's name 5 test scores...

  • Using C++. Please Provide 4 Test Cases. Test # Valid / Invalid Data Description of test...

    Using C++. Please Provide 4 Test Cases. Test # Valid / Invalid Data Description of test Input Value Actual Output Test Pass / Fail 1 Valid Pass 2 Valid Pass 3 Valid Pass 4 Valid Pass Question 2 Consider a file with the following student information: John Smith 99 Sarah Johnson 85 Jim Robinson 70 Mary Anderson 100 Michael Jackson 92 Each line in the file contains the first name, last name, and test score of a student. Write a...

  • For this assignment, you are to write a program that does the following: (C++) • read exam scores...

    For this assignment, you are to write a program that does the following: (C++) • read exam scores from a file name data.txt into an array, and • after reading all the scores, output the following to the monitor: the average score and the total number of scores. In addition, the program must use the following functions: //precondition: fileName is name of the file to open, inFile is the input file 2 of 2 //postcondition: inFile is opened. If inFile...

  • Can you please help me print columns for my C++ project? I'd like the print-out to...

    Can you please help me print columns for my C++ project? I'd like the print-out to have 3 columns to line up with of 1) First Name & Last Name 2) ID # and 3) Sales total I've attached the code below. Thank you in advance for your help. Seller::Seller() { setFirstName("None"); setLastName("None"); setID("ZZZ000"); setSalesTotal(0); }Seller::Seller(char first[],char last[],char id[],double sales) { setFirstName(first); setLastName(last); setID(id); setSalesTotal(sales); } /* Method: void setSalesTotal( double newSalesTotal ) Use: Changes a Seller's sales total Arguments:...

  • Write a complete C++ program that reads students names and their test scores from an input...

    Write a complete C++ program that reads students names and their test scores from an input text file. The program should output each student’s name followed by the test scores and the relevant grade in an output text file. It should also find and display on screen the highest/lowest test score and the name of the students having the highest/lowest test score, average and variance of all test scores. Student data obtained from the input text file should be stored...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT