I'm needing help writing a program that reads a list of scores from a .txt file then drops the lowest. Instructions are below. Then use the "low score drop" algorithm in a program to read and process an indeterminate number of floating-point scores from a file. The program should then display the result (the lowest score in the file), with two digits after the decimal. There is no restriction on these values; they might be negative or positive, and the values can be as small or large as the language permits.
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
float array[100]; // array for numbers
int size=0; // get total of file size
ifstream obj;
ofstream obj1;
obj.open("input.txt"); // open file
while(obj>>array[size]){ // read file
size++; // get to next index
}
for(int i=0;i<size;i++){
cout<<array[i]<<" "; // printing file data
}
cout<<endl;
delete (obj); // deleteing file
obj.close(); // closing its link
cout<<endl;
int smallest=INT_MAX; // get highest number possible
for(int i=0;i<size;i++){
if(smallest>array[i]){ // if smallest found
smallest=array[i];// update it
}
}
obj1.open("input.txt"); // open new file with same name
cout<<smallest<<endl; // print on console
obj1<<smallest<<endl; // print on file
obj1.close(); // close file
return 0;
}

IF YOU HAVE ANY QUERY PLEASE COMMENT DOWN BELOW
PLEASE GIVE A THUMBS UP
I'm needing help writing a program that reads a list of scores from a .txt file...
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...
Suppose that a text file Lab2.txt contains an unspecified number of scores. Write a program that reads the scores from the file and displays their total and average.In the text file, the scores are separated by blanks.The program should contain two methods with these signatures (it can contain other methods besides these if you think appropriate):public static double totalScores(File inFile)public static double averageScores(File inFile)The output from the program should look like this successful sample run from my solution:The total of...
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...
(Statistics) a. Write a C++ program that reads a list of double-precision scores from the keyboard into an array named scores. It is assumed that the user will enter no more than 35 scores. The scores are to be counted as they're read, and entry is to be terminated when a negative value has been entered. After all scores have been input, your program should find and display the sum and average of the scores. The scores should then be...
write a python program that reads from a file, scores.txt, a list of test scores. the program should calculate the average of all the scores, and print to the screen. the program should also have a function, num_passing, that takes as a parameter the list or grades and returns the number of scores that are above 64.
C++
3. Write a program that reads integers from a file, sums the values and calculates the average. a. Write a value-returning function that opens an input file named in File txt. You may "hard-code" the file name, i.e., you do not need to ask the user for the file name. The function should check the file state of the input file and return a value indicating success or failure. Main should check the returned value and if the file...
I need help writing a program in python that reads from a file and performs matrix multiplication. the file has this format 1 4 2 1 1 1 1 1 1 2 2 3 3 4 4 which means : 1 #rows in A 4 #cols in A, rows in B 2 #cols in B Matrix A contents: 1 1 1 1 Matrix B contents: 1 1 2 2 3 3 4 4 i need to be able to read...
Write a program in C that reads 20 float numbers from a file. The values are stored in a vector (1-dimensional array). Find and display the smallest number, the second smallest number, and the third smallest number of the set. Use only these libraries: stdio.h, stdlib.h, math.h, and string.h. Below is an example of the input file (in1.txt) and the resulting output file (output.txt). In1.txt: 3.14 4.05 -3.73 4.13 1.32 -2.21 0.46 4.57 4.64 -3.42 4.57 -0.14 3.00 -3.58 -0.78...
Write a program in C language that reads scores and id numbers from a file, finds the average score, and assigns each student a grade based on the following rules: Each score > average + 20 gets an A Each score between average + 10 and average + 20 gets a B Each score between average - 10 and average + 10 gets a C Each score between average - 20 and average - 10 gets a D Each score...
Implement MERGE-SORT() algorithm that reads from a file named “inputHW02.txt” a list of double numbers (max = 3,000,000 numbers), sorts those numbers and indicates time consumption. This programming question will address the advantage of using iteration loops over recursive calls as well as using INSERTION-SORT() as a procedure in MERGESORT(). Your program must perform the following actions: 1. Opens the given file name and reads all double numbers. For simplicity, we assume this file only contains numbers and nothing else....