Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

Design the following functions and call them in Main

1) int get_student_data(void): This function asks the user to enter the student ID, Quiz, Test, Recitation, Final scores etc and prints them in a file "Stu_score.txt". This functiion returns the number of students in the class.

2) float curv_factor(int num): num here is meant to be for the number of students in the class. This function opens the "Stu_score.txt" file and determines a curving factor for the class: if the class average of student total scores is less than 70 then the crying factor is 70/mean_class_total score, otherwise curving factor is 1.0; This functiion returns the curving_factor for the class.

3) char grade(float Q, float T, float curving): This function needs to be given the Quiz, Test, and also the curving factor. It calculates the grade as per our earlier logic and returns the letter Grade (A, B, C, D, or F). A: 90-100, B=80-89, C=70-79, D=60-69, F otherwise.
Main will have the following steps:
1) call int get_student_data(void)
2) call float curv_factor(int num)
3) Print on screen the value of curving factor as shown below.

4) Open the "Stu_scpore.txt" and using a for loop scan the data, and repeatedly call
char grade(float Q, float T, float curving)in order to print the ID and Grades of each student in the class on the screen.
RUN THE CODE FOR TWO TYPICAL CASES: ONE WHEN CURVING IS NOT NEEDED AND OTHER WHEN CURVING IS NEEDED AS SHOWN BELOW:
TYPICAL SREEN OUT PUTS
Enter 4 digit Student ID:or 999 to end input: 1001 Enter Quiz, Test Scores, separated by blank:
30 40
Enter 4 digit Student ID:or 999 to end input: 1002 Enter Quiz, Test Scores, separated by blank:
32 53
Enter 4 digit Student ID:or 999 to end input: 1003 Enter Quiz, Test Scores, separated by blank:
22 47
Enter 4 digit Student ID:or 999 to end input: 1004 Enter Quiz, Test Scores, separated by blank:
15 25
Enter 4 digit Student ID:or 999 to end input: 999 The curving factor for this class is:2.02
ID:1001, GRADE=C
ID:1002, GRADE=A
ID:1003, GRADE=C
ID:1004, GRADE=F
Press any key to continue . . .
***********************
Enter 4 digit Student ID:or 999 to end input: 1006 Enter Quiz, Test Scores, separated by blank:
78 87
Enter 4 digit Student ID:or 999 to end input: 1007 Enter Quiz, Test Scores, separated by blank:
72 82
Enter 4 digit Student ID:or 999 to end input: 1008 Enter Quiz, Test Scores, separated by blank:
60 65
Enter 4 digit Student ID:or 999 to end input: 999 The curving factor for this class is:1.00
ID:1006, GRADE=B
ID:1007, GRADE=C
ID:1008, GRADE=D

REC 4A F 16

Your CODE uses three functions in the following manner:
(a) void random_gen (void): This function,
(1) Asks user input for lower and upper limits for random numbers, and Scans them.
(2) Asks user number "how many numbers to be generated?" and scans it.
(3) Opens file "Rand_num.txt" and writes "those many" random numbers in that file in one column by repeatedly calling function int rand_int (int low, int high), which uses "calendar time" as seed to generate random numbers between (low and high), including low and high.
(b) float Mean_Min_Max (int * min, int*max): This function opens file "Rand_num.txt", scans the numbers repeatedy using a while loop, finds the "largest" , "smallest" numbers in the file, and also calculates an "returns" the average of these numbers. The function uses integer pointers to convey to the main the "largest" and the "smallest" numbers in the file.
(c) The main calls function random_gen() first get user inputs and print numbers in the file. It then calls function Mean_Min_Max(„ ) to find the Mean, Minimum and Maximum in the list and prints this information on screen.
TYPICAL OUT PUT ON SCREEN
Enter lower and higher limits seperated by a blank:3 79 How many random numbers?:11
Minimum=7, Maximum=75, Mean=25.17
Press any key to continue ...
*********** **
TYPICAL DATA IN FILE "Rand NUM.txt"
71 75 32 34 27 14 7
61 70 44 18

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M92021988

Have any Question?


Related Questions in C/C++

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As