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
Write a program that reads in 10 numbers from the user and stores them in a 1D array of size 10. Then, write BubbleSort to sort
Diano4ka-milaya [45]

Answer:

The solution is provided in the explanation section.

Detailed explanation is provided using comments within the code

Explanation:

import java.util.*;

public class Main {

//The Bubble sort method

public static void bb_Sort(int[] arr) {  

   int n = 10; //Length of array  

   int temp = 0; // create a temporal variable  

   for(int i=0; i < n; i++){  

         for(int j=1; j < (n-i); j++){  

           if(arr[j-1] > arr[j]){  

               // The bubble sort algorithm swaps elements  

               temp = arr[j-1];  

               arr[j-1] = arr[j];  

               arr[j] = temp;  

             }  

         }            

         }  

        }

 public static void main(String[] args) {

   //declaring the array of integers

   int [] array = new int[10];

   //Prompt user to add elements into the array

   Scanner in = new Scanner(System.in);

   //Use for loop to receive all 10 elements

   for(int i = 0; i<array.length; i++){

     System.out.println("Enter the next array Element");

     array[i] = in.nextInt();

   }

   //Print the array elements before bubble sort

   System.out.println("The Array before bubble sort");

   System.out.println(Arrays.toString(array));

   //Call bubble sort method

   bb_Sort(array);  

               

   System.out.println("Array After Bubble Sort");  

   System.out.println(Arrays.toString(array));

 }

}

8 0
2 years ago
What is the best definition of the 7x7 rule for maximizing audience comprehension
olganol [36]

The 7x7 Rule states that a PowerPoint slide should have no more than seven lines of text and no more than seven words in each of those lines.

7 0
2 years ago
A data use agreement is required when a researcher uses a limited data set (lds). an lds must have:_________
svetoff [14.1K]

An LDS must have all direct identifiers removed.

According to the HIPPA policy, a Limited Data Set (LDS) is a kind of data set in which direct identifiers are removed.

Limited Data Set  (LDS) is a set of data that can be used for research purposes under the HIPPA policy without any authorization from the patient. However, this kind of data ensures that any kind of identifier information such as the patient's name, relative's name, address, number etc is not shared and not made a part of the research.

Limited Data Set (LDS) shows common information like age, city, and gender information from the data.

The Limited Data Set (LDS) is available to only those researchers with whom the data use agreement has been signed.

To learn more about  Limited Data Set (LDS), click here:

brainly.com/question/2569524

#SPJ4

7 0
1 year ago
A customer dictates instruction on how to transcribe audio. Do you have to transcribe the instruction word for word?
Ostrovityanka [42]

Answer:

No

Explanation:

4 0
2 years ago
The picture that graphically represents the items you use in Windows is called a/an
Fofino [41]
Icon need to use 20  characters <span />
7 0
3 years ago
Other questions:
  • A network administrator is implementing dhcpv6 for the company. the administrator configures a router to send ra messages with m
    6·1 answer
  • What’s the answer?............................
    13·1 answer
  • When you move or size a control in the Form Designer, Visual Studio automatically adjusts the ________________ that specify the
    9·1 answer
  • A user clicked an email link that led to a website than infected the workstation with a virus. The virus encrypted all the netwo
    10·1 answer
  • A benefit of flashcards is that they are
    7·2 answers
  • The decimal number 3 is ___ in binary the 2s column plus the 1s column.
    11·1 answer
  • Do you have to make a account of Windows 10?
    12·1 answer
  • Select the correct answer.
    13·1 answer
  • Here is a nested loop example that graphically depicts an integer's magnitude by using asterisks, creating what is commonly call
    7·1 answer
  • Please answer me <br> in Assignment - Algorithms
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!