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 the insert table of figures dialog box which drop down menu do you use to choose what information is displayed in the table
Mashutka [201]

Answer:

caption label

Explanation:

8 0
3 years ago
After reading through the code, what will happen when you click run?​
AnnyKZ [126]

Answer:

B.) Laurel will try to collect treasure when there is not any and it causes an error

Explanation:

Laurel is at the top right corner of the map. When you click run, laurel moves 1 step ahead. This spot is right above the coordinate of the very first diamond. There is no treasure at this spot.

Therefore, when the next command calls for collecting, there will be an error, as there is no treasure at the spot right above the first diamond.

4 0
2 years ago
1 the background image on the desktop of computer is called
aleksandrvk [35]

Answer:

4. Wallpaper

Explanation:

The background image for your computer is called a wallpaper

5 0
2 years ago
Answer is A, do not believe the D answer;What are additional details that can be viewed in an Outlook task? Check all that apply
sergiy2304 [10]

Answer:

A

C

D

E

F

Explanation:

got it right on edg

3 0
2 years ago
Read 2 more answers
Which symbol should you use for entering a formula in a cell?
Ray Of Light [21]

Answer:LETTER B

Explanation:

8 0
3 years ago
Other questions:
  • For what type of document would you use the landscape page orientation
    11·1 answer
  • If a pedestrian begins to cross my path when i have the right of way
    5·1 answer
  • the type() function in python does what when you give it an object. returns the last keystrokes from the user. fill the object w
    9·1 answer
  • How does a hard drive work
    6·1 answer
  • For enterprise servers, or servers accessed around the clock, SATA disks are preferred over SAS disks. True or False
    12·1 answer
  • Halp me vanajsudhrbfhjrjfjfjf ​
    9·1 answer
  • From which country samsung is​
    6·2 answers
  • Which of the following are exclusively associated with copyright protection
    5·2 answers
  • How many pages is 1500 words double spaced 12 font?.
    10·1 answer
  • does an access control list looks for patterns of traffic between multiple packets and takes action to stop detected attacks?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!