how do i write a program in c++ that use functions max, min, the total numbers,
ID: 3557684 • Letter: H
Question
how do i write a program in c++ that use functions max, min, the total numbers, the mean and standard deviation to read a file text and return these values from the file text. note the file text has random numbers. note im not suppose to use arrays. so again i have to get the maximum number from the file text, the minimum from the file text, the mean from the file text, the total numbers from file text, and lastly the standard deviation from file text. please add notes so i can follow the logic.
Explanation / Answer
# include # include # include # include using namespace std; //Opens the file under variable name Write and Identifies //The file that is being read from ofstream Write("temp.txt",ios::out); ifstream Read("LabData.txt", ios::in); void Header(); //Prototype for header function double Mean(int table[],double); //Prototype for Mean function const int Max = 400; //Constant used to represent the size of the array int Minimum (int num[],int); //Prototype for Minimum function int Maximum (int info[], int); //Prototype for Maximum function void Distribution(int val[],int); //Prototype for Distribution function void sort(int[], int); //Prototype for Sort function double Deviation(int set[], int, double); //Prototype for Standard Deviation function int main() { //Displays programmer information to the user Header(); int data[Max]; //Defines the arrat int number; //Varialbe used to count int lines = 1; //Variable used to format the outputof the array double meanb; //Variable used to store the value of the mean //Message displayed to user letting them know where the file is stored and //What the name of the file it reads from is called coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.