
#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
write a C progam not C++ please include comments im a beginner During a drawing competition,...
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 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 language Write a program that asks the user for a file name. The file contains a series of scores(integers), each written on a separate line. The program should read the contents of the file into an array and then display the following content: 1) The scores in rows of 10 scores and in sorted in descending order. 2) The lowest score in the array 3) The highest score in the array 4) The total number of scores in...
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 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 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 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
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 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 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:...