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
Rus_ich [418]
3 years ago
13

5-11) (Find the Smallest Value) Write an application that finds the smallest of several integers. Write a program which first as

ks the user to enter the number of values to enter, then asks for each value, and finally prints out the lowest value of those entered.
Computers and Technology
1 answer:
Elanso [62]3 years ago
8 0

Answer:

import java.util.Arrays;

import java.util.Scanner;

public class num4 {

   public static void main(String[] args) {

   Scanner in = new Scanner(System.in);

       System.out.println("How many numbers? ");

       int n = in.nextInt();

       int []intArray = new int[n];

       //Entering the values

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

           System.out.println("Enter the numbers");

           intArray[i]=in.nextInt();

       }

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

       int min =intArray[0];

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

           if(min>intArray[i]){

               min = intArray[i];

           }

       }

       System.out.println("The Minimum of the numbers is "+min);

   }

}

Explanation:

  • Using Java programming language
  • Prompt the user for the number of values
  • Using Scanner class receive and store in a variable
  • Create an array of size n
  • Using an for loop continuously ask the user to enter the integers
  • Print the array of integers
  • Using another for loop with an if statement, find the smallest element in the array of numbers
  • Output the the smallest number
You might be interested in
Joe is examining the logs for his web server and discovers that a user sent input to a web application that contained the string
alexira [117]
SQL Injection Attack
6 0
2 years ago
12. Fill in the blanks: In a ____________, the root of the tree is labeled _______________, children of the root are the names o
Alona [7]

Based on the description of the tree, the missing words are:

  • Binary tree.
  • Root node.
  • Internal nodes.
  • External node.
  • Structure.

<h3>What are the parts of a binary tree?</h3>

In a <u>Binary tree</u>, the roots are called the <u>root nodes</u> and the children of those roots are called the <u>internal nodes. </u>

The leaves are meant to designate the<u> external nodes</u>. These trees are helpful in evaluating architectural alternatives because they provide <u>structure.</u>

Find out more on binary trees at brainly.com/question/14990156.

6 0
2 years ago
Write a program that assigns a value the value of 50000 to an integer variable x, assigns the value of x*x to an integer variabl
Allushta [10]

Answer:

Explanation:

The following code is written in Java and does exactly what the question asks. The variables are long variables instead of integers because integer variables can only be a maximum of 2147483647 and the product of these two variables is much higher than that.

public static void main(String args[]) {

               long x = 50000;

               long y = x * x;

               System.out.println(y);

       }

7 0
3 years ago
Which of the following correctly revises the passive voice of the sentence above to active voice?
muminat

There is no question on the passive voice, therefore I cannot change it to an active voice.

I hope this helped!

6 0
3 years ago
Programming terms!!Please need help!!!
Alexeev081 [22]
1 algorithm
2 sequential
3 selection
4 loop
5 boolean
6 variables
7 expression
8 concatenation
9 operator
10 function
11 argument
12 event
13 event handler
14 class
15 object
16 instance
17 properties
18 methods
19 parameters
8 0
3 years ago
Other questions:
  • You have a multi-domain Windows Server 2016 forest. You need to make a shared folder available to users from several domains. Wh
    6·1 answer
  • Susie works for an architectural firm and the partners have always drawn the plans for projects by hand. Though Susie learned ho
    8·1 answer
  • Which of the following describes a source file? A. It contains the information to be copied. B. It's where copied information is
    11·2 answers
  • 9.6 Code Practice<br> Instructions<br> 1<br> Declare a 4x 5 array called N<br><br> Please helppp
    9·1 answer
  • Guys help me, to get 25 examples of computer software​
    8·1 answer
  • Who wants to be my tutor?
    14·2 answers
  • Definition of the term social factor and explain why texting while driving can be classified as a social factor causing accident
    6·1 answer
  • Factoring is the revers of​
    14·1 answer
  • Can any one help me please with my computer science hwk :)
    11·1 answer
  • :|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|:|
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!