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
rusak2 [61]
3 years ago
13

Create your own unique Java application to read all data from the file echoing the data to standard output. After all data has b

een read, display how many data were read. For example, if 10 integers were read, the application should display all 10 integers and at the end of the output, print "10 data values were read"
Computers and Technology
1 answer:
mafiozo [28]3 years ago
8 0

Answer:

<u>Output</u>

The values read are:  

25

3

4

65

7

9

5

6

1

11

10 data values were read

Explanation:

Below is the Java program to read all data from the file echoing the data to standard output and finally displaying how many data were read:-

import java.io.File;

import java.io.FileNotFoundException;

import java.util.Scanner;

public class MyFileReader {

public static void main(String[] args){

 int num,counter=0;

 File file=new File("numbers.txt");

 try {

  Scanner input=new Scanner(file);

  System.out.println("The values read are: ");

  while(input.hasNext()){

   num=input.nextInt();

   System.out.println(num);

   counter+=1;

  }

  System.out.println(counter+" data values were read");

 } catch (FileNotFoundException e) {

  // TODO Auto-generated catch block

  e.printStackTrace();

 }

}

}

You might be interested in
How many skins are in fortnite
umka21 [38]

Answer:

As of July 2020, there are 797 Fortnite skins.

Explanation:

4 0
3 years ago
Read 2 more answers
4
Nataly_w [17]

Answer:

5 hours 25 minutes

Explanation:

It takes 25 minutes to finish a hole

It takes 25*13 minutes to finish 13 holes

325 minutes is require to finish 13 holes

Convert 325 minutes to hours and minutes by dividing it by 60

=5 5/12 hours

Convert 5/12 hours to minutes by multiplying by 60

=25 minutes

The answer is 5 hours 25 minutes

5 0
4 years ago
write a program in python to input 3 sides of a triangle. check if the triangle is equilateral, isosceles or scalene. use logica
hjlf
<h2>Type of Triangle - Python</h2>

In Geometry, a triangle is a three-sided polygon with three edges and three vertices. A triangle with vertices A, B, and C denoted ∆ABC.

<h3>Equilateral Triangle</h3>

A triangle is said to be an EQUILATERAL TRIANGLE if all the sides are equal in measure.

<h3>Isosceles Triangle</h3>

A triangle is said to be an ISOSCELES TRIANGLE if any two sides are equal in measure.

<h3>Scalene Triangle</h3>

A triangle is said to be a SCALENE TRIANGLE if none of the sides are equal in measure.

<h3>Here's our program:-</h3>

a = float(input("Enter the length of the first side of a triangle: "))

b = float(input("Enter the length of the

second side of a triangle: "))

c = float(input("Enter the length of the third side of a triangle: "))

if (a == b and b == c and c == a):

print("Equilateral Triangle.")

elif (a == b or b = c or c == a):

print("Isosceles Triangle.")

elif (a != b and b !=c and c != a):

print("Scalene Triangle.")

<h3>else:</h3>

print("Invalid Input.")

6 0
2 years ago
Tom and jerry opened a new lawn service
DedPeter [7]
That’s cool sirrrrrrrr
6 0
3 years ago
Read 2 more answers
In cell E6, create a formula to calculate the percentage of total sales accounted for by DVDs. The formula will divide DVD sales
NISA [10]

Answer:

= C6/$C$20

Explanation:

Given

Cell C6 ; Cell C20 and Cell E6

Cell C6 = DVD Sales

Cell C20 = Total Sales

Cell E6 = The result cell.

Cell E6 gets it value by calculating the percentage of DVD sales.

In other words, E6 = C6/C20

From the question, cell C20 is to be referenced using absolute reference.

The absolute reference ensures that the value never changes no matter where the formula is copied. The dollar sign ($) fixes the reference to a given cell.

So, cell C20 will be referenced like this: $C$20

While cell C6 will be referenced using the default relative reference (C6)

The percentage formula will be entered in cell E6 as this

= C6/$C$20

Click the Percent Style button (Home tab > Number group) to display the resulting decimal fractions as percentages.

Increase the number of decimal places if needed

5 0
3 years ago
Other questions:
  • type the correct answer in the Box spell the words correctly Caleb is working on a simple logic base program to stimulate the ga
    5·2 answers
  • Which presenter would most likely benefit from a custom slide show?
    10·2 answers
  • This toolbar has icons representing the application's basic operations such as Save and Copy. Drawing Formatting Standard Task
    11·2 answers
  • A viral video is one that can infect your computer with malware. <br> a. True <br> b. False
    6·1 answer
  • 2. A body is thrown vertically<br>100 m/s Theme taken to retum​
    13·1 answer
  • I just want to ask if some one know an online school program that offer a live session and the cost of it not to expensive. for
    10·1 answer
  • Kaitlin likes a particular design theme, but she is not sure about every single color for bullets, backgrounds, etc found in the
    5·2 answers
  • Does functionality provided by the app play an important role in a decision to
    13·1 answer
  • What does an arrow after a command indicate
    13·2 answers
  • 7. A(n) is the address of a document or other file accessible on the Internet.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!