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
Which term describes a secure, individual, private cloud-computing model hosted within a public cloud?
grin007 [14]

The term that describes a secure, individual, private cloud-computing model hosted within a public cloud is A hybrid cloud.

<h3>What is this cloud about?</h3>

A hybrid cloud is known to be a system or a model which is said to be a form of a private cloud that is linked with public cloud infrastructure, and it is one that tends to give room for an organization to act workloads in two environments.

Note that In this model, the public cloud is known to be one that is seen and it is one that becomes an extension of the private cloud to make a single, uniform cloud.

Hence, The term that describes a secure, individual, private cloud-computing model hosted within a public cloud is A hybrid cloud.

Learn more about hybrid cloud from

brainly.com/question/27838623

#SPJ1

7 0
1 year ago
Why we need each section of prologprogram?
evablogger [386]

Answer:

Prolog program are used in the artificial intelligence and the web development in a systematic manner process. As, it is also sometimes known as declarative language which basically consist of some facts and list. Prolog program are divided into the sections that are:

  • Domain sections
  • Clauses sections
  • Predicates sections
  • Goal sections

We need each section of the prolog program because all the sections introduced the systematic program and performed there particular functions so by using all these processing steps an efficient function are formed.

6 0
3 years ago
Help please what is the answer , thanks!!!
shepuryov [24]

Answer:

X = "Hello World"

Y = "hello world"

Z = 100

C = 200

if X == Y:

   print("TRUE")

else:

   print("FALSE")

if Z > C:

   print("TRUE")

else:

   print("FALSE")

4 0
2 years ago
What happens once the Insert tab is used in PowerPoint to insert a chart into a presentation?
nordsb [41]

Answer:

•The user can edit the chart directly. hoped i;m right

Explanation:

6 0
2 years ago
A _____ chart provides a simple way to show trends and variations in a range of data within a single cell
ludmilkaskok [199]
Most reasonable answer is a line chart.
 
With line charts you can spot trends and variations in a certain range of data through different times or just different values of the variable that we plot on the x-axis. In general, line charts are often used in research that wants to depict time trends or how a certain variable progresses through different levels of the variable on the x-axis.
8 0
3 years ago
Other questions:
  • Care should be taken whenever you post comments or photos to any social media or other websites, because each of these online ac
    8·1 answer
  • _____ are independent and not associated with the marketing efforts of any particular company or brand.​
    9·1 answer
  • You are the administrator of a Windows network. When creating a new user account, you specify a security clearance level of top
    8·1 answer
  • What is another word for microchips operating systems input methods and everything in between?
    5·1 answer
  • In this section of your final project, you will write a basic script to create and back up files. You will create this script wi
    11·2 answers
  • Given that n refers to a positive int use a while loop to compute the sum of the cubes of the first n counting numbers, and asso
    12·1 answer
  • Why do we need to make a plan before actions?
    7·1 answer
  • Write a program that uses an STL List of integers. a. The program will insert two integers, 5 and 6, at the end of the list. Nex
    15·2 answers
  • Practising some questions for board exams for class 12 python,pls help with detailed answer
    14·1 answer
  • consider the following code segment, which appears in a method in a class other than password. the code segment does not compile
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!