Design the functions and call them in main

Assignment Help C/C++ Programming
Reference no: EM131267239

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

Reference no: EM131267239

Questions Cloud

Write a c program that will malloc up space dynamically : Write a C program that will malloc up space dynamically. The space should be able to hold exactly one integer value. After the space has been reserved, you should deposit the number 6 into the space. After the number 6 has been deposited into the spa..
What is the output of the given program : What is the output of the following program? summer(intNum1, intNum2); cout
What is cis complex numbers : What is cis (Complex Numbers). Give me the exact formula of shortest distance.  Tips how can i stove a problem in few seconds.
Describe your network design strategy that supports design : Describe your network design strategy that supports your design (why you choose such design and what are the advantages of your design).
Design the functions and call them in main : Design the functions and call them in Main - his 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.
Discuss process you went through to select appropriate data : Discuss the process you went through to select the appropriate data types, primary and foreign keys, and other constraints that are necessary to maintain the integrity of the database.
Explain the whole learning process of the switches : Consider  an institutional LAN Shown in the figure below that is composed of five host (A,B,C,D,E) and two transparent switches (Switch 1 and Switch 2). Assume that frames are exchanged as follows. Explain the whole learning process of the Switches.
Describe the events or tasks that would occur in each step : Consider a different SDLC Model (4 step or 12 step). Describe the events/tasks that would occur in each step if your company were to use this SDLC model instead. - 3 pages.
What essentials would you need in order to make the work : Based on what you have learned so far, how do you think you would lay out a home network based on your needs as well as the needs of the other members of your household? What essentials would you need in order to make this work?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd