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
Harlamova29_29 [7]
3 years ago
15

PLEASE HELP ASAP (answer is needed in Java) 70 POINTS

Computers and Technology
1 answer:
8_murik_8 [283]3 years ago
6 0

import java.util.Scanner;

public class MyClass1 {

   public static void main(String args[]) {

     Scanner scan = new Scanner(System.in);

     int smallest = 0, largest = 0, num, count = 0;

     while (true){

         System.out.println("Enter a number (-1 to quit): ");

         num = scan.nextInt();

         if (num == -1){

             System.exit(0);

         }

         else if (num < 0){

             System.out.println("Please enter a positive number!");

         }

         else{

             if (num > largest){

                 largest = num;

                 

             }

             if (num < smallest || count == 0){

                 smallest = num;

                 count++;

             }

             System.out.println("Smallest # so far: "+smallest);

             System.out.println("Largest # so far: "+largest);

         }

     }

   }

}

I hope this helps! If you have any other questions, I'll do my best to answer them.

You might be interested in
Assume:
kobusy [5.1K]

Answer:

?

Explanation:

8 0
3 years ago
Aria has modified the hard disk that hosts the operating system by using the fdisk command. The fdisk command indicates that the
Neko [114]

Answer:

A. Run the parted command.

D. Reboot the system.

Explanation:

Linux command line shell is a vital tooling server administration. It provides the flexibility of executing user and kernel mode commands on the command line interface.

Unlike graphic user interface operating systems, it receives typed commands on its prompt to execute tasks. The fdisk command shows the newly created partition on a disk, and to reload, the parted command is executed or the system should be rebooted.

3 0
3 years ago
If a friend changes the password on your phone how do you get into it if you dont know the password
kotegsom [21]
Ask your friend to tell you the password
3 0
3 years ago
Monica is writing a paper, and it needs to contain a certain amount of words. What Word Online feature can she use?IndentingProo
Greeley [361]

Answer:

Its word count so she knows how much words she is writing

Explanation:

7 0
2 years ago
If x is an int, which of the following statements adds 5 to the current value of x and stores the new value back in x?
faust18 [17]
X += 5;

----------------------------
6 0
3 years ago
Other questions:
  • Which code returns the date in the format friday, april 20th, 2015?
    13·1 answer
  • Convert 234.43 (base 7) to base 10
    7·1 answer
  • The main devices in a rectifier are:
    14·2 answers
  • my airpods just do not seem to connect if i try to pair them, reset them, they have this continuous green light, please help me
    12·1 answer
  • If you wish to sign out of your Microsoft account, tap or click ____ on the ribbon to open the Backstage view and then tap or cl
    8·1 answer
  • Which term refers to the blank areas surrounding a document page? *
    15·1 answer
  • Create html code showing heading tags​
    6·1 answer
  • Do you think lossy compression formats will be popular in 20 years? Why or why not?
    10·1 answer
  • What do you hope will be in/added GTA 6?
    13·1 answer
  • Differentiate between patent and copyright.
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!