Need Help this File Input and Output C Programmings Please H

Need Help this File Input and Output C++ Programmings, Please Help me and teach me how to do this Programming.

Can you explain to me each step, so I understand how to do it. ( NO hand writing please)

Also, I do not understand how it to type \"user is prompted for 10 test scores. 0 to 100 points each score\", can you screenshot how to make it on .txt file Thank you so much

Write a program that the user is prompted for 10 test scores. 0 to 100 points each score.

Open a file for output, called savedTestScores.txt.

Write a loop that prompts the user for the 10 test scores.
Each time a test score is entered by the user, write the test score to savedNames file. And save each test score to an array, called arrayTestScores.

Close the file.
Using the scores stored in the array, write a loop that reads through the array to

determine the minimum, maximum and average test scores. Print out the minimum, maximum and average test scores.
Are the scores written to the file ?

Solution

public class TestScores {

public static void main(String[] args) throws IOException {

writeToFile(\"scores.txt\");

processFile(\"scores.txt\");

}

public static void writeToFile (String filename) throws IOException {

BufferedWriter outputWriter = new BufferedWriter(new FileWriter(\"scores.txt\"));

System.out.println(\"Please enter 10 scores.\");

System.out.println(\"You must hit enter after you enter each score.\");

Scanner sc = new Scanner(System.in);

int score = 0;

while (score <= 10)

{

score = sc.nextInt();

outputWriter.write(score); }

}

public static void processFile (String filename) throws IOException, FileNotFoundException {

double sum = 0;

double number;

double average;

double count = 0;

BufferedReader inputReader = new BufferedReader (new InputStreamReader(new FileInputStream(\"scores.txt\")));

String line;

while ((line = inputReader.readLine()) != null) {

number = Double.parseDouble(line);

sum += number;

count ++; }

average = sum/count;

System.out.println(average);

inputReader.close();

}

Need Help this File Input and Output C++ Programmings, Please Help me and teach me how to do this Programming. Can you explain to me each step, so I understand
Need Help this File Input and Output C++ Programmings, Please Help me and teach me how to do this Programming. Can you explain to me each step, so I understand

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site