1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Makovka662 [10]
3 years ago
11

Write a program to read data from a file named problem 2. ext. This file has three exams data (floating point data) in three col

umns for the students in a class. Find the average and the highest score in the class for the Second exam which is located in the Second column of the file. Assume that the file has neither initial number of total lines of data values nor any sentinel signals. That is your program need to show that you have no idea how many data lines are there) 77 90 86 66.5 88 80.5 95 75 80 80 79 89 70.5 81 Note: If you don't have the software access then you don't have to worry about saving the data file. Just write your code assuming the text file is saved in the right location.
Computers and Technology
1 answer:
Travka [436]3 years ago
6 0

Answer:

import java.io.File;  // Import the File class

import java.io.FileNotFoundException;  // Import this class to handle errors

import java.util.Scanner; // Import the Scanner class to read text files

public class ReadFile {

 public static void main(String[] args) {

   try {

     File myObj = new File("filename.txt");

     Scanner myReader = new Scanner(myObj);

     while (myReader.hasNextLine()) {

       String data = myReader.nextLine();

       System.out.println(data);

     }

     myReader.close();

   } catch (FileNotFoundException e) {

     System.out.println("An error occurred.");

     e.printStackTrace();

   }

 }

}

Explanation:

this will read the file and print it out, to do the rest have it take the data and use some "java math" and then print the answers to either console or a file of your choice.

You might be interested in
In what ways are computers being used to improve our quality of life
Helga [31]

Answer:

  • computers help with our education system
  • communicating with others is easier (emails/text messages opposed to sending an envelope)
  • technological advances

5 0
3 years ago
Read 2 more answers
The computer that has been traditionally found on the desks in many offices and homes is the ___ computer.
Sladkaya [172]

Answer:

<u> Personal</u> computer

Explanation:

I.d.k the answer so don't blame me if its incorrect

7 0
3 years ago
How do you open Microsoft Excel 2013 with Windows 8?
adell [148]
Go to the apps page. When you get there find the search bar, and once you find the search bar, click in it and type in Microsoft Excel 2013. The application will come, click on it and it will open. *Note:- This is only if you have already downloaded it on your computer/laptop, or if it came with your laptop/computer.*

Hope I helped ya!! xD
8 0
3 years ago
JAVA Code:
Burka [1]
Dear ,you should ask it on stackoverflow and geekforgeelks , not here
6 0
4 years ago
Switches: Select one:
const2013 [10]

Answer:

b. connect two or more network segments that use different data link protocols

Explanation:

A switch is an analog device that allows to interconnect networks, it is possibly one of the devices with a higher level of scalability. It is important to clarify that a Switch does not only provide connectivity with other networks, nor does it provide connectivity with the Internet, for this purpose a router is necessary.  

6 0
4 years ago
Other questions:
  • What system of representation is used for the threaded portions
    12·1 answer
  • How would you create a tint of a color?
    6·1 answer
  • Write code to complete PrintFactorial()'s recursive case. Sample output if userVal is 5:5! = 5 * 4 * 3 * 2 * 1 = 120
    8·1 answer
  • How long does it take to send a 3 MiB file from Host A to Host B over a circuit-switched network, assuming:
    13·1 answer
  • Small data files that are deposited on a user's hard disk when they visit a website are called _______.
    6·2 answers
  • Hi Alaza, when you submit this form, the owner will be able to see
    12·1 answer
  • What does route print do?
    15·1 answer
  • Think of an aspect of HTML that you found challenging to master. Why is that aspect of HTML important? What are some future situ
    6·1 answer
  • The programming interface for a legacy motor controller accepts commands as binary strings of variable lengths.
    15·1 answer
  • What does the sign (#) mean in manuscript edpm<br> and also what does (DEL)
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!