Question

IN C PROGRAMMING PLEASE Write a program to curve 10 scores so that the average is...

IN C PROGRAMMING PLEASE

Write a program to curve 10 scores so that the average is 75.0.

Get and store 10 scores in an array. The score must be between 0 and 110 inclusive (use constants for the min and max scores, and use the constants in the validation condition and error message). Then total the scores, find the average of the scores, and calculate the curve amount, which is the difference between 75 and the average (75 should also be stored in a constant). Then update the scores in the array with the curve amount, but make sure the score does not go above or below the max and min score values (again, using the constants). Finally, display the original average of the scores, the curve amount, and the 10 new scores.

Have blank lines between the original scores, the average and curve amount, and the new scores.

Hints:

• Validation error messages are indented 3 spaces

• You will need a decision to set the score to the minimum (or maximum) if the score is less than (or greater than) the minimum (or maximum)

• Don’t forget the blank line before ‘Press any key to continue…”

Example Run #1:

Enter the score for student #1: 92.0

Enter the score for student #2: 886.4

The score entered was not in the range of 0.0 to 110.0.

Enter the score for student #2: 86.4

Enter the score for student #3: 73.6

Enter the score for student #4: 71.0

Enter the score for student #5: 66.6

Enter the score for student #6: 55.8

Enter the score for student #7: 68.7

Enter the score for student #8: 70.3

Enter the score for student #9: 59.0

Enter the score for student #10: 80.2

The average of the scores was: xx.x

Each student will have x.x added to their score.

The new scores are:

The score for student #1 is: xx.x

The score for student #2 is: xx.x

The score for student #3 is: xx.x

The score for student #4 is: xx.x

The score for student #5 is: xx.x

The score for student #6 is: xx.x

The score for student #7 is: xx.x

The score for student #8 is: xx.x

The score for student #9 is: xx.x

The score for student #10 is: xx.x

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Executable Code:


#include <stdio.h>

int main() {

float score[10], avg = 0.0, sum = 0.0, curve = 0.0;

int i = 0;

const int min = 0, max = 110, curveVal = 75;

for(i = 0; i < 10; i++) {

printf("\nEnter the score for student %d : ", i+1);

scanf("%f",&score[i]);

if(score[i] < min || score[i] > max) {

printf("\nThe score entered was not in range of 0.0 to 110.0");

--i;

continue;

}

sum += score[i];

}

avg = sum / 10;

printf("The average of the scores is %f", avg);

curve = curveVal - avg;

printf("\nEach student will have %f added to their score", curve);

printf("\nThe new scores are : ");

for(i = 0; i < 10; i++) {

printf("\nScore for student %d : is %f", i+1, score[i]+curve);

}

return 0;

}

Sample Output:





Please don't hesitate to contact me if you have any queries or require any modifications :)
Do rate the answer if it was helpful thanks.

Add a comment
Know the answer?
Add Answer to:
IN C PROGRAMMING PLEASE Write a program to curve 10 scores so that the average is...
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
  • Write a class AdjustedAssignment that has private attributes for Name and a vector of integers Scores....

    Write a class AdjustedAssignment that has private attributes for Name and a vector of integers Scores. Add public set and get methods for Name Write a public method addScore that accepts an integer and add it's to the score vector write public methods for maximum, minimum and average - but before calculating, find the difference between the highest score and 100, and when calculating max, min and average, add that value to the result ( don't actually change the values...

  • c++ Instructions Overview In this programming challenge you will create a program to handle student test...

    c++ Instructions Overview In this programming challenge you will create a program to handle student test scores.  You will have three tasks to complete in this challenge. Instructions Task 1 Write a program that allocates an array large enough to hold 5 student test scores. Once all the scores are entered, the array should be passed to a function that sorts them in ascending order. Another function should be called that calculates the average score. The program should display the...

  • Write a C++ program to keep records and perform statistical analysis for a class of 20...

    Write a C++ program to keep records and perform statistical analysis for a class of 20 students. The information of each student contains ID, Name, Sex, quizzes Scores (2 quizzes per semester), mid-term score, final score, and total score. The program will prompt the user to choose the operation of records from a menu as shown below: ==============================================                                            MENU =============================================== 1. Add student records 2. Delete student records 3. Update student records 4. View all student records 5. Calculate...

  • write program in c # to do the following : Insert 10 student scores and store...

    write program in c # to do the following : Insert 10 student scores and store them in an array Create a function that prints array elements Create a function that returns the highest mark Create a function that calculates the average score Create a function that calculates the pass rate, knowing that the pass mark is 60

  • Write a C++ program named, gradeProcessor.cpp, that will do the following tasks: -Print welcome message -Generate...

    Write a C++ program named, gradeProcessor.cpp, that will do the following tasks: -Print welcome message -Generate the number of test scores the user enters; have scores fall into a normal distribution for grades -Display all of the generated scores - no more than 10 per line -Calculate and display the average of all scores -Find and display the number of scores above the overall average (previous output) -Find and display the letter grade that corresponds to the average above (overall...

  • Exercise 03: Write a program in java that read as input the scores of 3 quizzes...

    Exercise 03: Write a program in java that read as input the scores of 3 quizzes of each student (out of 10 as follows) into a 2-D array: Enter the number of students> 4 Enter quiz scores for student 1> 10.0 2.04.0 Enter quiz scores for student 2> 5.5 6.0 6.0 Enter quiz scores for student 3» 8.259.04.0 Enter quiz scores for student 4> 9.5 8.5 2.0 The program then calculates the average of each quiz score for all the...

  • 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...

  • In C++ Assignment 8 - Test Scores Be sure to read through Chapter 10 before starting this assignment. Your job is to write a program to process test scores for a class. Input Data You will input a tes...

    In C++ Assignment 8 - Test Scores Be sure to read through Chapter 10 before starting this assignment. Your job is to write a program to process test scores for a class. Input Data You will input a test grade (integer value) for each student in a class. Validation Tests are graded on a 100 point scale with a 5 point bonus question. So a valid grade should be 0 through 105, inclusive. Processing Your program should work for any...

  • Question: - write a C++ program that asks user to enter students' quiz scores, calculate the...

    Question: - write a C++ program that asks user to enter students' quiz scores, calculate the total score for each students and average for all. Note: - number of students: 1 through 5. That is, at least one student and up to 5. - number of quizes: 8 through 10. That is, at least 8 quizes and up to 10. - quiz score range: 0 through 100. - when entering quiz scores, if user enters -1, that means the user...

  • - write a C++ program that asks user to enter students' quiz scores, calculate the total...

    - write a C++ program that asks user to enter students' quiz scores, calculate the total score for each students and average for all. Note: - number of students: 1 through 5. That is, at least one student and up to 5. - number of quizes: 8 through 10. That is, at least 8 quizes and up to 10. - quiz score range: 0 through 100. - when entering quiz scores, if user enters -1, that means the user has...

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