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
kkurt [141]
3 years ago
10

Implement a function named largerThanN that accepts three arguments: an array of type int, the size of the array of type int and

an int number n. The function should display all of the numbers in the array that are greater than the number n. in the main() function create an array named numbers containing 10 integers : 30,20,50,2,-1,44,3,12,90,32 Ask the user to enter a number. Call the the function largerThanN and pass the array , the size and the number that user entered.
Computers and Technology
1 answer:
levacccp [35]3 years ago
6 0

Answer:

import java.util.Scanner;

public class NewArray {

//Main Method begins here

   public static void main(String[] args) {

   int [] numbers = {30,20,50,2,-1,44,3,12,90,32}; //The given array

   Scanner in = new Scanner(System.in);

       System.out.println("enter a number");

       int n = in.nextInt(); //Receive the number from the user

       //Calling the method largerThanN

       largerThanN(numbers, numbers.length,n);

   }

//The method largerThanN begins here

   public static void largerThanN(int []intArray, int arraySize, int n){

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

           if(intArray[i] > n){

               System.out.println(intArray[i]);

           }

       }

   }

}

Explanation:

Uisng the Java prograamming language the solution is provided above.

Please see the comments within the code for detailed explanation

The key logic within the method largerThanN () is using a for loop to iterate the entire array. Within the for loop use an if statement to compare each element with the the number n entered by the user

You might be interested in
Why is iot architecture important?
Harlamova29_29 [7]
They need to make sure your building is easy to move around in. Beyond the building itself, architecture and design can help bring balance to people's lives. ... Well-designed schools create better learning environments. Workplaces with good architecture experience higher productivity.
7 0
3 years ago
Assume that a program uses the named constant PI to represent the value 3.14. The program uses the named constant in several sta
mihalych1998 [28]

Answer:

The advantage for the above condition is as follows:-

Explanation:

  • If a user creates a defined constant variable and assigns a value on its and then uses that variable instead of the value, then it will a great advantage.
  • It is because when there is a needs to change the value of that variable, then it can be done when the user changes the value in one place. There is no needs to change the vale in multiple places.
  • But if there is a value in multiple places instead of a variable and there is no constant variable, then the user needs to change the value in multiple places.
7 0
3 years ago
You suspect that a bad video driver is causing a user's system to randomly crash and reboot. Where would you go to identify and
lord [1]

The area of the system that you need to go to identify and confirm your suspicions is Dump files.

<h3>What is a dump file?</h3>

Memory Dump Files  is known as .dmp files. They are called the  the quick shots of a specific memory  of a program that is often taken at a particular point in time, such as in a crash.

Note that Dump files are also called special type of files that saves information regarding your computer such as the video crash. So the right place to check is the dump files.

Learn more about video driver from

brainly.com/question/13835124

3 0
2 years ago
Advanced persistent threat (APT) attackers want to ________. Select one: a. create awareness for their causes b. remain unnotice
Romashka [77]

Answer:

Option b (remain unnoticed so they can continue to steal data) is the right approach.

Explanation:

  • APT seems to be sustained but instead designed to target coordinated attack whereby an attacker achieves network access including a longer length of time impossible to conceive.
  • Usually, APT assaults become targeted at organizations throughout fields including such national security, engineering, as well as the financial services industry, as they make increased-value details.

There are 3 other possibilities not relevant to just the given case. So that the option here was the right one.

6 0
3 years ago
How to convert ascii to hexadecimal?
Deffense [45]
ASCII is an agreement on which number represents which typographic character. Using this table you can look up the number of any character. For instance, "A" has 65, but that is a decimal. Next step is to represent this decimal number in hexadecimal. You can do that by taking the divisor and remainder of a division by 16. Numbers beyond 9 are represented as a through f. Hexadecimal numbers are commonly prefixed by "0x" to make them recognizable.

So "A" = 65 = 4*16+1 = 0x41

And "Z" = 90 = 5*16+10 = 0x5a

There are ASCII tables that have the hexadecimal value in them, to make the task easier (www.asciitable.com).

If you want to do this programmatically, you can write something like this (node.js):

console.log( Buffer.from('AZ', 'utf8').toString('hex'));

Note that the 0x prefix is not shown here.
7 0
3 years ago
Other questions:
  • Which of the following criteria would not make a person eligible to receive medicare benefits?Which of the following criteria wo
    12·2 answers
  • The ________ occurs when the user presses the enter key without typing a value for an input operation.
    5·1 answer
  • Most Microsoft Windows fatal errors (blue screen of death) are caused by:
    14·1 answer
  • A poker hand consists of 5 cards drawn at random without replacement from a 52 card deck. Using python and the cards data frame
    12·1 answer
  • Summarizes statistical data ?
    11·1 answer
  • Question 1
    13·1 answer
  • To make something ready for some activity is to ________it.
    15·1 answer
  • Read integers from input and store each integer into a vector until -1 is read. Do not store -1 into the vector. Then, output al
    11·1 answer
  • Laura is filming a scene in which the subject is sitting with a lit fireplace behind him. The only other source of light in the
    15·1 answer
  • Differentiate between patent and copyright.
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!