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
goldenfox [79]
3 years ago
10

Write a static method named lowestPrice that accepts as its parameter a Scanner for an input file. The data in the Scanner repre

sents changes in the value of a stock over time. Your method should compute the lowest price of that stock during the reporting period. This value should be both printed and returned as described below.
Computers and Technology
1 answer:
NikAS [45]3 years ago
6 0

Answer:

Explanation:

The following code is written in Java. It creates the method as requested which takes in a parameter of type Scanner and opens the passed file, reads all the elements, and prints the lowest-priced element in the file. A test case was done and the output can be seen in the attached picture below.

import java.io.File;

import java.io.FileNotFoundException;

import java.util.Scanner;

class Brainly{

   public static void main(String[] args) throws FileNotFoundException {

       Scanner console = new Scanner(System.in);

       System.out.print("file location: ");

       String inputLocation = console.next();

       File inputFile = new File(inputLocation);

       Scanner in = new Scanner(inputFile);

       lowestPrice(in);

   }

   public static void lowestPrice(Scanner in) {

       double smallest = in.nextDouble();

       while(in.hasNextDouble()){

           double number = in.nextDouble();

           if (number < smallest) {

               smallest = number;

           }

       }

       System.out.println(smallest);

       in.close();

   }

}

You might be interested in
2:3:5<br>_ _ _<br>3 2 8<br><br><br><br>find ratio​
TiliK225 [7]

Answer:

453 over 328

Explanation:

I'm just guessing

4 0
3 years ago
Jeanne writes a song, and Raul wants to perform
Goryan [66]
B) ask jeanne for permission
6 0
3 years ago
Read 2 more answers
Why do computers use binary code?
Anna71 [15]

Answer:

To make sense of complicated data, your computer has to encode it in binary. Binary is a base 2 number system. Base 2 means there are only two digits—1 and 0—which correspond to the on and off states your computer can understand

4 0
3 years ago
Read 2 more answers
Which step in the software development life cycle involves making improvements based on user feedback?
Dima020 [189]

Answer:

The step is Testing oki doki

6 0
3 years ago
_______ is a form of crime that targets a computer system to acquire information stored on that computer system, to control the
julia-pushkina [17]

Answer:

Option (A) is the correct answer.

Explanation:

A Computer system can be the target for the crime on which a criminal can acquire the information from the computer system which is stored on it. A Criminal is targeting the system with the help of some software that is entered on the computer system through a network.

In the above question, paragraphs are describing the content related to the crime which targets the computer system. This is a concept of a "computer as target". Hence option "A" is the correct answer while the other is not valid because--

  • Option b suggests the concept behind the storage device of a computer but in the question, it is about the crime of a computer.
  • Option c suggests the concept behind the computer is a criminal but in the question, it is about the crime of a computer.
  • Option d suggests the concept behind the communication of a computer but in the question, it is about the crime of a computer.
4 0
4 years ago
Other questions:
  • To find a webpage, the user of a search engine would simply enter a word or phrase in the resource's text box. what is the term
    11·1 answer
  • How many times do you usually use npm?<br> Put your answer in the box.
    6·1 answer
  • In this website/app what are the points for?
    7·1 answer
  • Samantha wants to create a network group that allows open sharing of data without restrictions. What type of network should she
    9·1 answer
  • One of the advantages of off-the-shelf software is that ________________. a. the software contains important features, thus elim
    13·1 answer
  • For this lab, you will work on a simple GUI application. The starting point for your work consists of four files (TextCollage, D
    5·1 answer
  • Write a C function which mimics the behavior of the assembly language function below. Note that this time, the assembly language
    10·1 answer
  • How can the use of new technology in industry benefit the us government
    8·2 answers
  • Problem: Mr. James Reid, the director of admissions at MOGCHS University, has
    14·1 answer
  • Select the correct answer from the drop-down menu.
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!