Problem on java programming

Assignment Help Programming Languages
Reference no: EM13322205

import java.util.*;
import java.io.*;

public class MainMethodClassName
{
public static void main(String args[])
{

Scanner readFile = null;

try

{

readFile = new Scanner(
new FileInputStream("numbers.txt"));
}


catch(FileNotFoundException e)
{

System.out.println("Sorry, this file could not be found.");
}

int max = readFile.nextInt();
int min = max;
while(readFile.hasNextInt());
{
int next = readFile.nextInt();
if(min > next)
min = next;

if(max < next)
max = next;
}

System.out.println("Maximum number:" + max);
System.out.println("Minimum number:" + min);
}
}

I have a text file located in the same folder with some various numbers, and it won't work. Thanks in advance.

Reference no: EM13322205

Questions Cloud

Calculate the frequency of the tone perceived by observer : A speaker generating a tone at 285 Hz is moving towards a stationary observer with a speed of 35 m/s
Compute the steady-stare creep rate and stress level : If it is known that the value of the stress exponent, n, for this alloy is 8, compute the steady-stare creep rate at 1300 K and a stress level of 90 MPa.
Write a method named maxelement : Write a method named maxElement, which returns the largest value in an array that is passed as an argument. The method should use recursion to find the largest element. Demonstrate the method in a program.
What is the first harmonic frequency of this pipe : An organ pipe is 1.42 m long. What is the first harmonic frequency of this pipe when it is open at both ends
Problem on java programming : I have a text file located in the same folder with some various numbers, and it won't work. Thanks in advance.
Determine the strength of the a992 steel column : A W18x130 section is used as a column with one end pinned and the other end is fixed against rotation but free to translate. The length is 12 ft. determine the strength of the A992 steel column.
How far is she from the cliff : A hiker is approaching a sheer cliff wall. She yodels, and hears the echo of her yodel after 3.3 s. How far is she from the cliff
Explain how does the epoxy coating protect reinforcement : Compare the effectiveness of the zinc coating with a typical epoxy coating on reinforcement. How does the epoxy coating protect reinforcement and what happens if the coating is nicked.
What are specifications need to be specified for waterways : what are the specifications need to be specified while creating a design for waterways. what are their uses. how are they maintained.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd