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
Large and powerful computer capable of processing and storing large amounts of business data
Nata [24]

Answer:

True

Explanation:

but no need to be large physically ;)

the important point is the computer must have a proper specification to process a large amount of data

6 0
3 years ago
Which futures would work well for text entered into cells check all that apply
Vikki [24]

Answer:

this is no image for me to see to to do

Explanation:

7 0
4 years ago
To enhance the readability of your document, select a layout that aligns text ________.
Vilka [71]

Answer:

b. only at the left margin.

Explanation:

It's the most widely accepted layout. MLA format, which is used in most professional settings, aligns the body to the left. Though, the answer may be different depending on the language.

5 0
2 years ago
Read 2 more answers
What makes up data encryption standard ?
galben [10]

Answer:

Data Encryption Standard Use Cases. The DES was a data security standard used to encrypt and decrypt non-classified computer data generated by the United States government and any commercial organization. The Data Encryption Standard (DES) is a symmetric-key block cipher published by the National Institute of Standards and Technology (NIST). ... Note that both the right section and the key are 48-bits in length. Also note that the round key is used only in this operation. The DES is a product block cipher in which 16 iterations, or rounds, of substitution and transposition (permutation) process are cascaded.

Explanation:

If this helps can i have brainliest

8 0
3 years ago
Which is a function of network media?
Eduardwww [97]
The (main) function of the "network media" is the "<span> to transmit signals from device to device" because by doing this and allowing this to happen, this the signals would also send messages, and by this, it would then also be known as social media, and by this, it would be able to send pictures,  text, and etc. This would be the point of the "network media".</span>
5 0
3 years ago
Read 2 more answers
Other questions:
  • Choosing the “Quick Print” button will ____________.
    14·1 answer
  • Write code that inserts useritems into the output string stream itemsoss until the user enters "exit". each item should be follo
    15·1 answer
  • What finger is used to key letter c
    12·2 answers
  • Given the following HTML form snippet of markup, which of the following user inputs would meet the regular expression rule writt
    7·1 answer
  • 9. A change in the appearance of a value or label in a cell
    5·1 answer
  • Write the name of the tab, command group, and icon that is used to create multilevel lists.
    12·1 answer
  • Claire writes a letter to her grandmother, in which she describes an amusement park she visited last week. She adds pictures of
    13·1 answer
  • A pre-design document you can use to create a new project quickly
    5·1 answer
  • Computer science is a blank process
    6·2 answers
  • Electronic data interchange (EDI) and electronic funds transfer (EFT) are forms of__________e-commerce transactions.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!