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
olchik [2.2K]
4 years ago
13

Write a function solution that returns an arbitrary integer which is greater than n.

Computers and Technology
1 answer:
Aleksandr-060686 [28]4 years ago
4 0

Answer:

   public static int greaterThanInt(int n){

       return n+10;

   }

Explanation:

This is a very simple method in Java. it will accept an argument which is an integer n and return n+10 since the question requires that an arbitrary integer greater than n be returned adding any int value to n will make it greater than n.

A complete java program calling the method is given below:

<em>import java.util.Scanner;</em>

<em>public class ANot {</em>

<em>    public static void main(String[] args) {</em>

<em>        Scanner in = new Scanner(System.in);</em>

<em>        System.out.println("Please enter an integer");</em>

<em>        int n = in.nextInt();</em>

<em>        int greaterInt = greaterThanInt(n);</em>

<em>        System.out.println("You entered "+n+", "+greaterInt+" is larger than it");</em>

<em>    }</em>

<em>    public static int greaterThanInt(int n){</em>

<em>        return n+10;</em>

<em>    }</em>

<em>}</em>

You might be interested in
You have decided to remove a recently installed feature which method can you use to remove this feature
Aliun [14]
If it is on the desktop screen you just right click on the icon and select delete. from there if you're on a windows computer it goes to your recycle bin then you right click the recycle bin and a little rectangle pops up an in that rectangle it says clear recycle bin and once you press that all of the stuff that was in there is deleted. now if your on a computer that has chrome os installed you just go to the files screen and right click what you want to delete and click delete and it's gone. 
6 0
3 years ago
The Gas-N-Clean Service Station sells gasoline and has a car wash. Fees for the car wash are $1.25 with a gasoline purchase of $
Vesnalui [34]

Answer:

Amount Gasoline purchases                       9.7 Gallons

Price pre gallons                             $          2.89

Total gasoline cost                          $          28.03

Car wash cost                                  $          1.25

Total due                                         $          29.28

Explanation:

hope this helps

5 0
3 years ago
15.Every CPU needs to:
aliya0001 [1]

Answer:

Dissipate heat

Explanation:

As CPU works efficiently while there is cool

8 0
3 years ago
Chdtp aoxophg gr72 ae9&gt;3 zqqz
AlekseyPX
So, is this a real problem or just some random typing

8 0
4 years ago
doubleUp Write a method doubleUp that doubles the size of a list of integers by doubling-up each element in the list. Assume the
Maslowich

Answer:

The solution in Python is as follows:

class myClass:

     def doubleUp(self,myList):

           myList[:0] = myList[::2] = myList[1::2] = myList[:]

       

mylist =  [1, 3, 2, 7]

list = myClass()

list.doubleUp(mylist)

print(mylist)

Explanation:

To create a method in Python, the first step is to create a Class.

This is done in the following line:

class myClass:

Then this line defines the method

     def doubleUp(self,myList):

This line duplicates the elements of the list

           myList[:0] = myList[::2] = myList[1::2] = myList[:]

This defines the list        

mylist =  [1, 3, 2, 7]

This creates an instance of the class

list = myClass()

This passes the list to the doubleUp method

list.doubleUp(mylist)

This prints the duplicated list

print(mylist)

4 0
3 years ago
Other questions:
  • Which signal types are represented by a continuous waveform?
    10·1 answer
  • When using bits to represent fractions of a number, can you create all possible fractions? Why or why not?
    6·1 answer
  • What is virtual memory?
    11·1 answer
  • What is the meaning of website cookies? brief explanation ​
    9·2 answers
  • Write a program that takes as input a number of kilometers and prints the corresponding number of nautical miles. Use the follow
    9·1 answer
  • Peter was working on a design for a magazine. He had to give his design to his team for further editing. He wanted to use a file
    8·1 answer
  • HELP PLS TIME LIMIT HERE
    11·1 answer
  • What do you understand by the term polysome?​
    14·1 answer
  • Which of the following is a responsibility of CTSO membership?
    13·1 answer
  • FS EVERFI:
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!