answer.
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
Mnenie [13.5K]
2 years ago
4

Write an application whose main() method holds two integer variables. Assign values to the variables. In turn, pass each value t

o methods named displayTwiceTheNumber(), displayNumberPlusFive(), and displayNumberSquared(). Create each method to perform the task its name implies (for example, displayTwiceTheNumber given the value 10 should display the following: 10 times 2 is 20 Part B: Modify the NumbersDemo class to accept the values of the two integers from a user at the keyboard. Output the answers to the console.
Computers and Technology
1 answer:
mr_godi [17]2 years ago
5 0

I'll provide you with the pseudocode and explanation of what's happening, and you can implement it in the language of your choice!

Part B requires seeing the `NumbersDemo` class. But if you want to get data from the user, you will need to use the appropriate library and functions. For example in Java you would need the Scanner class. Check this: https://www.w3schools.com/java/java_user_input.asp

This is for Part A: https://gist.github.com/Amaazing/74d65fc987fbf86f74e0927cccf7b8ac

It might be difficult to read with the comments, so try take them out and read the code! It's good practice :)

You might be interested in
A Salesforce administrator adding a recommendations carousel component in Community Builder. The page displays correctly in Comm
disa [49]

Answer:

The page changes with the recommendation component have NOT been published.

Explanation:

The community builders are generally used to identify different opportunities by utilizing the necessary creativity, analysis and strategies. This will ensure that the objectives are achieved at the end of the day. Based on the problem encountered during the operation, it shows that the necessary page changes were not published.

4 0
2 years ago
How many solutions exist for the given equation?
vovikov84 [41]
Infinity amount of answers because each side can be simplified to x making any solution correct
6 0
2 years ago
Consider the following method, which is intended to return an array of integers that contains the elements of the parameter arr
Gennadij [26K]

Code:

public static int[] reverse(int [] arr){

Int [] newArr = new int[arr.length];

for (int k = 0; k<arr.length;k++){

/*Missing statement */

}

return newArr;

Answer:

Replace the comment with:

newArr[k] = arr[arr.length-k];

Explanation:

Required

Complete the code

In the given code:

The first line of the given code defines the method

public static int[] reverse(int [] arr){

The next line declares array newArr withe same length as array arr

Int [] newArr = new int[arr.length];

The next line iterates through the elements of array arr

for (int k = 0; k<arr.length;k++){

The /* Missing statement */ is then replaced with:

newArr[k] = arr[arr.length-k];

The above statement gets the elements of array arr in reversed order.

This is so because, as the iteration iterates through array arr in ascending order, arr.length-k gets the element in reversed order

6 0
2 years ago
In a single file, you wrote a bike class and used this line of code in the program.
Elza [17]

Answer:

Explanation:

Based on the available options the one that would be correct would be that the code to define your class (beginning with "class bike") must come before the line "bikeA = bike('Acme' 111)." This is because the line of code declaring the object and initializing it needs to be able to grab the information of the class that it is creating an object of. To do this, the class would need to have already been compiled by the program. It is good practice to have each class definitions as its own separate files but this is not a necessity.

5 0
2 years ago
Cloud-based services can open doors to leveraging Artificial Intelligence (AI) without dramatically increasing risk. Which clien
vladimir1956 [14]

Answer:

Explanation:

The clients that would be best suited for this opportunity would be small business or business' that do not have the hardware/space resources necessary to create the computing power that they need. Instead, they can simply pay for these cloud-based services which provide all of the necessary computing/hardware power and resources necessary so that the company can easily fulfill all of their tasks without any problems. Bigger companies can easily pay for and implement their own hardware to solve their problems which may benefit them even more in the long-term.

7 0
1 year ago
Other questions:
  • George and Miguel are considering opening up a shoe store but first need to do market research. Which one of these is NOT part o
    13·2 answers
  • Splunk uses ________ to categorize the type of data being indexed..
    11·2 answers
  • Which selections are possible for controlling the start time of audio playback? Check all that apply. Automatic Rewind when done
    10·1 answer
  • Read this excerpt from The Outsiders. Or I could have gotten one of the gang to come along, one of the four boys Darry and Soda
    6·2 answers
  • Write a program named SortWords that includes a method named SortAndDisplayWords that accepts any number of words, sorts them in
    10·1 answer
  • rite a method so that the main() code below can be replaced by simpler code that calls method calcMilesTraveled(). Original main
    7·1 answer
  • Write the definition of a class Telephone. The class has no constructors,
    8·2 answers
  • Consider the following 3-PARTITION problem. Given integers a1; : : : ; an, we want to determine whether it is possible to partit
    10·1 answer
  • If productCost and productPrice are numeric variables, and productName is a string variable, which of the following statements a
    11·1 answer
  • Which OS function does a CLI fulfill? A User interface B Running applications C Hardware interface D Booting
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!