Write a java program that contains a method

Assignment Help Computer Engineering
Reference no: EM132200790

Question :

Write a Java program that contains a method named ReadAndFindMax. The argument to this method is the filename (of String type). The method opens the file specified in the method argument filename and then reads integers from it.

This file can contain any number of integers. Next, the method finds the maximum of these integers and returns it.

The main method must first ask the user to enter the filename; then call ReadAndFindMax method with the entered filename as an argument; and finally it must print the maximum integer value that is returned from this method.

You would have the screenshots similar to shown below (assuming that you are using console I/O):

Enter the file name: myfile.txt

The maximum number is 45

Assuming that the file myfile.txt contains the following four integer numbers:

23

34

45

2

Reference no: EM132200790

Questions Cloud

Examine what the bumper sticker says : We have now ventured in the part of economic theory where we explore why we buy goods and services. We know we respond to prices but we also buy goods.
What is the rotational speed of the disk : 1) What is the rotational speed of the disk? 2) What is the transfer time for one sector?
Measure the usefulness of the words : 1. Why can't we use TF alone to measure the usefulness of the words? 2. What is a caveat of IDF? How does TFIDF address the problem?
Write a java program the displays the state bird and flower : Write a Java program the displays the State bird and flower. You should use your IDE for this exercise.
Write a java program that contains a method : This file can contain any number of integers. Next, the method finds the maximum of these integers and returns it.
What are some technologies included into a web-based : What are some technologies included into a Web-based Training and what are some pros and cons of it.
Define what happens to macroeconomic aggregates : If the Federal Reserve were to target the price level, so that Pt = P, how would money supply change if productivity (At) suddenly decreased temporarily?
How the round robin scheduling algorithm works : Topic 1: Discuss how the round robin scheduling algorithm works.
Which cache block will the memory reference : Suppose a computer using fully associative cache has 216 words of main memory and a cache of 64 blocks, where each cache block contains words 32.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What are the source and destination port numbers

What are the source and destination port numbers in the UDP packet sent from the UDP server to the UDP client?

  Find friction coefficient for fully developed turbulent flow

Employing numerical integration to determine the ratio of mean velocity to centerline velocity, and Eq. for the velocity profile, evaluate the friction.

  Discuss new information technology has a ripple effect

The introduction of new information technology has a ripple effect, raising new ethical, social, and political issues that must be dealt with on individual

  Explain in twenty words or less how selection sort works

Explain in twenty words or less how selection sort works. On average, about how many more comparisons does selection sort do than insertion sort on a list?

  Write a bnf description for a statement-sequence

Write a BNF description for a statement-sequence as a sequence of statements in which each statement is terminated by a semicolon.

  Evaluating the code

Which of the following best explains the situation after Line 1 has been executed? pCdoesnothaveatarget, and pCdoesnothaveaknownvalue. pCdoesnothaveatarget, butpCdoeshaveaknownvalue.

  What are the three components to define a computer bus

Why, and in what sense, are the DIN 4164 standard connectors specified by the VMEbus standard better than the connectors used by the IBM PC bus?

  How can store configuration information on a motherboard

Why do you think the trend is to store configuration information on a motherboard in CMOS setup  than by using jumpers or switches.

  Prepare to discuss the article you find

Please type up a 1 page synopsis of no less than 350 words. Prepare to discuss the article you find at the beginning of the next class and submit a printed copy to the instructor.

  Design an eight-input priority encoder

Design an eight-input priority encoder with inputs A7:0 and outputs Y2:0 and NONE should be 0. Give a simplified Boolean equation for each output.

  Describe pros and cons of moving enterprise-wide application

Describe the pros and cons of moving enterprise-wide applications that have traditionally been supported on premises to the cloud.

  What do you mean by the tip

"How to Use JavaScript to Liven up your Web site, how to protect users whose browsers will not load JavaScript. What is the tip? would Web site designers write JavaScript code so all browsers can use it? Why?

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