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
Dima020 [189]
3 years ago
15

Write a method named hopscotch that accepts an integer parameter for a number of "hops" and prints a hopscotch board of that man

y hops. A "hop" is defined as the split into two numbers and then back together again into one. For example, hopscotch(3); should print ________.
Computers and Technology
1 answer:
Ivanshal [37]3 years ago
8 0

Answer:

Following are the program in the Java Programming Language.

public class Main // declared class  

{

public void hopscotch(int x) // function definition  

{

int count=0; // variable declaration  

for (int j=0; j<x; j++) // iterating over the loop

{

System.out.println(" " + (++count)); // print the value of count

System.out.println((++count) + " " + (++count));

}

System.out.println(" " + (++count));  

}

public static void main(String[] args) // main method  

{

Main ob=new Main(); // creating object

ob.hopscotch(3); // calling hopscotch method  

}

}

<u>Output</u>:

  1

2     3

  4

5     6

  7

8     9

  10

Explanation:

Here, we define a class "Main" and inside the class, we define a function  "hopscotch()" and pass an integer type argument in its parentheses and inside the function.

  • We set an integer variable "count" and assign value to 0.
  • Set the for loop which starts from 0 and end at "x" then, print space and value inside the loop, again print value then space then value, then repeat the 1st print space then value.
  • Finally, set the main function "main()" and inside the main function, we create the object of the class "ob" then, call the function " hopscotch()" through the object and pass the value 3 in its parentheses.
You might be interested in
write an algorithm that reads to values, determines the largest value and prints the largest value with an identifying message ​
REY [17]

Answer:

I'm unsure of what language you are referring to, but the explanation below is in Python.

Explanation:

a = int(input("Input your first number: "))

b = int(input("Input your second number: "))  

c = int(input("Input your third number: "))

maximum = max(a, b, c)

print("The largest value: ", maximum)

6 0
3 years ago
Write the definition of a function minMax that has five parameters. The first three parameters are integers. The last two are se
guapka [62]

void minMax(int a, int b, int c, int*big, int*small)

{

if(a>b && a >c){

*big = a;

if(b>c)

*small = c;

else

*small = b;

}

else if (b>a && b>c){

*big = b;

if(a>c)

*small = c;

else

*small = a;

}

else{

*big = c;

if(a>b)

*small = b;

else

*small = a;

}

}

8 0
2 years ago
HOW CAN YOU GET THE COOLEST FONTS ON GOGGLE SLIDES???
Viefleur [7K]
I would love to help. but if you could text my number i could help more. i have a chromebook
8 0
3 years ago
Read 2 more answers
Why do employers prefer to hire people with more work ethic?
Andrej [43]

The importance of a good work ethic in school and life. Your good work ethic tells future employers what they might expect from you on the job.

4 0
3 years ago
What is a many-to many types of correspondence?
Ann [662]

Answer:

We have many types of correspondences. There are internal correspondences, external correspondences, sales correspondences, and personalized correspondences. By many to many correspondences we mean, a lot of people correspond with a lot many people from another department, company or market, or any set of people in fact. An internal correspondences, sales correspondences, personalized correspondences or external correspondences can be of many to many types, and as well as of others like one to one, many to one and so on.

Explanation:

Please check the answer.

5 0
3 years ago
Other questions:
  • 50+ POINTS AND BRAIN IF CORRECT Chris is working with other employees on a worksheet. The other employees have made comments, bu
    8·1 answer
  • type the correct answer in the Box spell the words correctly Caleb is working on a simple logic base program to stimulate the ga
    5·2 answers
  • Edhesive silly questionsj
    8·1 answer
  • Write a program that takes a date as input and outputs the date's season. The input is a string to represent the month and an in
    6·1 answer
  • This is used in a program to mark the beginning or ending of a statement, or separate items in a list:_____
    15·1 answer
  • Most wires are covered in rubber to insulate them and keep people safe from electricity and heat true of false
    11·1 answer
  • Which statement best describes desktop publishing?
    10·1 answer
  • Essay about evolution of media shaped the values and norms of the society
    11·1 answer
  • Which of the following statements is true regarding a user account? Once a user account has been created, it cannot be completel
    8·1 answer
  • What are organization tools?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!