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
Suppose that the host with IP address 10.0.1.19 sends an IP datagram destined to host 128.119.160.183. The source port is 3324,
Slav-nsk [51]

Answer:

The source and destination IP addresses are 10.0.1.19 and 10.0.1.25

Explanation:

NAT or network address translation is a network protocol is used by private networks to access the internet by assigning or mapping a public IP address to the private addresses.

The host with IP address 10.0.1.19 searches for the actual destination IP address 128.119.160.183 in its private network and when it does not find it, it sends the packet to the default gateway IP address 10.0.1.25, which is where the private IP address is NATted and sent to the destination.

5 0
3 years ago
Computer-based networks that trigger actions by sensing changes in the real or digital world are known as: global marketing plat
Gennadij [26K]
It known as the smart systems

It make decision by describing and analyzing the available data in a predictive or adaptive manner thereby performing an efficient and smart actions based on that analysis

A lot of smart systems evolved from micro systems
8 0
3 years ago
What happens to a mechanical system when two opposing torques do not cancel out?
const2013 [10]
The system will move in the direction of the stronger torque
5 0
3 years ago
In the early days of photography, cameras were limited to professional photographers because of the knowledge needed to work the
ki77a [65]
True  ------------------------------------------
8 0
3 years ago
Read 2 more answers
Anyone wanna hop on 1v1.lol<br> party code : usfhb6
hjlf

Answer:

thx for the points

Explanation:

8 0
2 years ago
Read 2 more answers
Other questions:
  • Convert 234.43 (base 7) to base 10
    7·1 answer
  • Using information from the lesson, explain how new technologies change your experience as a consumer.
    5·2 answers
  • Software that instructs the computer how to run applications and controls the display/keyboard is known as the
    14·1 answer
  • Which of the following scanning technique attackers use to bypass firewall rules, logging mechanism, and hide themselves as usua
    11·1 answer
  • What does the merge &amp; center button in the alignment group on the home tab do?
    8·1 answer
  • The variable used in a loop to control the number of times it is executed is called a _______.
    10·1 answer
  • ​Lara is the chief editor of "Laughter and Life," an online magazine. Lara has assigned Jenny the task of redesigning the magazi
    5·1 answer
  • Identify some advantages of using Excel over lists, paper files, or simple word documents? Describe some disadvantages of using
    15·1 answer
  • 1. Who was the first lady programmer?​
    14·2 answers
  • You use a Windows desktop system to edit and produce audio files. Your system has two hard disks installed. Your applications ar
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!