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
Which of the following is an example of a syntax error?
Yuri [45]

Answer:

misspelling a programming language word

Explanation:

Syntax error is the type of error in programming, when the programmer insert some symbol that is not present in directories or libraries, the programmer not followed the rules of that particular programming language that is understandable to compiler.

For example in C++, it is necessary to insert the semicolon (;) after each statement. If the programmer not insert the semicolon after each statement, the program will show the syntax error.

If the programmer use integer instead of int to assign datatype to the variable in C++, it will also leads to the syntax error. Because in C++ library, Integer is defined with the help of "int".

4 0
2 years ago
In the legend of sleeping Hallow what does Ichabod Crane fear the most
ahrayia [7]

Ichabod Crane is terrified of the headless horsemen

3 0
3 years ago
Read 2 more answers
You can post a Facebook status update from your smartphone. True or false?
Nady [450]
True .................
3 0
3 years ago
Read 2 more answers
Elevenplus = input ("Are you age 11 or over? (Y/N):") if elevenplus == "Y": print("you can ride the roller coaster") else: print
anastassius [24]

Answer:

The variable used is elevenplus

Explanation:

Given

The above code segment

Required

The variable in the code

In Python, variables are used to take inputs, and they are used to storing values.

On the first line of the program, elevenplus is used to get input for age.

Up till the end of the program, no other variable is introduced.

<em>Hence, the variable in the program is </em><em>elevenplus</em>

4 0
3 years ago
What are the most recent attacks on computer security that you face this month? Use the Internet to search for the latest attack
grigory [225]

Answer:

Now a days every thing can be done on the internet easily but this internet has various drawbacks with that as the most of our personal information we share on internet these days so if anyone attacks on your server then he/she can easily access all the private information including financial details and this attack is known as cyber attack. there are various ways to attack on the internet some of them are-

1.Malware- it is shortly known as the malicious software, malware can be described as worms, viruses, trojans these all are variety of malware which provide root access to the attacker by which they can control the system remotely.

2.phising- This is a technique by which the criminals craft emails to fool a target into taking some harmful action. The recipient might be tricked in downloading malware that disguised as an important document for instance or argued toclick on that link that takes them to a fake website where they can get the password which are necessary for any transaction.

3.Ransomware- This is like a malware which is stored in the computer and easily encrypt all the necessary files of the victim's computer and after that they demand some ransom to decrypt it.

4.SQL injection- This is the process by which the SQL command gets injected by the attacker into the victim's system so that the attacker can easily gather all the necessary information which they want to take control on the system.

These attacks are very dangerous for the system because the attacker can get all the necessary information about the user and can easily harm him/her by getting their personal information.

There are various steps to prevent these attacks which are-

I.secure your hardware- The user has to prevent their hardware from lost or steal. protect all devices with a complicated password, share that password with the device user only.

II.Encrypt and backup data- You have to prevent your data by making the backup of the necessary files so that if any of your information gets lost then you can retrieve it from your backup.

III. create a security focused workplace- Employees are the most common ways of breaching of the data as many don't recognise the external threats the internal one breaches the security and it cause the loss of the information.

some latest viruses are-

1.cyborg ransomware-This virus is present in the floppy disk which is used by the user and can cause the count of time the system reboot. it's new variant is present in windows 10.

2.Gobrut-This is also one of the latest viruses it is capable enough to detect weak passwords and can cause loss of information.

3.jokeroo-This virus works as the ransomware their author spread it in the computer system which will encrypt the files and for decrypting it they demand ransom for that.

4.Trojan Glupteba- Once this virus enters the system the user cannot know that the system is infected and it will slowly communicates with the IP of the system which results in loss of the confidential information.

Most vulnerable platforms are-

1.Social engineering- The social networking sites has most of your personal information of the user which can be used by the attacker to get the necessary information.

2.cloud computing services- More companies use to store their most of the information on the cloud which is used by the attacker to get the confidential passwords which can cause loss of the essential information.

Explanation:

6 0
3 years ago
Other questions:
  • Which loan type requires you to make loan payments while you’re attending school?
    9·1 answer
  • A network administrator has been tasked with configuring access to the Internet for about 50 computers. The administrator has be
    6·1 answer
  • Which statement is true regarding bitmap images?
    6·2 answers
  • keeping in mind the role in order of precedence plays in equations, what would excel display as the result of the following equa
    14·1 answer
  • Jack is an accountant. He can't access the spreadsheet software, which is installed on the server. What should Jack do?
    5·2 answers
  • A=1/2h(a+b) solve for h
    6·1 answer
  • Computer technology has changed our lives write of a least five ways to show how this is so​
    15·1 answer
  • Need help fast this is do a 4
    5·1 answer
  • A _ shows the end of a page . ​
    11·2 answers
  • // This pseudocode is intended to describe
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!