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

Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Follow each number by a space.

Computers and Technology
1 answer:
Ksenya-84 [330]3 years ago
3 0

Answer:

   while(userNum>=1){

       System.out.print(userNum/2+" ");

       userNum--;

        }

Explanation:

This is implemented in Java programming language. Below is a complete code which prompts a user for the number, receives and stores this number in the variable userNum.

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

<em>public class TestClock {</em>

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

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

<em>        System.out.println("Enter the number");</em>

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

<em>    while(userNum>=1){</em>

<em>        System.out.print(userNum/2+" ");</em>

<em>        userNum--;</em>

<em>         }</em>

<em>    }</em>

<em>}</em>

The condition for the while statement is userNum>=1 and after each iteration we subtract 1 from the value of   userNum until reaching 1 (Hence userNum>=1)

You might be interested in
Where do we manage POS? ​
valkas [14]

Explanation:

<em>The</em><em> </em><em>POS</em><em> </em><em>serves</em><em> </em><em>as</em><em> </em><em>the</em><em> </em><em>central</em><em> </em><em>component</em><em> </em><em>for</em><em> </em><em>your</em><em> </em><em>business</em><em>;</em><em> </em><em>it's</em><em> </em><em>the</em><em> </em><em>hub</em><em> </em><em>where</em><em> </em><em>everything</em><em> </em><em>like</em><em> </em><em>sales</em><em>,</em><em> </em><em>inventory</em><em> </em><em>management</em><em> </em><em>,</em><em> </em><em>payment</em><em> </em><em>processing</em><em>,</em><em> </em><em>and</em><em> </em><em>customer</em><em> </em><em>management</em><em> </em><em>merges</em><em>.</em><em> </em>

3 0
3 years ago
What does the average function do in a spreadsheet?
givi [52]
This article describes like shows the formula syntax and usage of the AVERAGE<span>  function in Microsoft Excel</span>
8 0
4 years ago
What is the difference between connecting link and missing link ?
JulijaS [17]
It's simple. Missing link is the connecting link which had been cut or extinct. The main example are extinct animal species.
8 0
3 years ago
Help please, on tuesday we have oral presentation in zoom and i am afraid to speak in front of people, and i don't know what to
Lapatulllka [165]

Answer:

You should be strong, and be sure about what you want to say. Make sure when you speak it is clear, and makes sense.

Explanation:

If you don't speak up or sound like you know what you are talking about. I like to think of it as dancing. Act like you own the stage, or in your case, like you own the presentation. Also, I suggest you speak to your teacher in private, about him ignoring you. If I were you, I would look for newer friends. Ones that won't ignore you.

6 0
3 years ago
Jan pays $70 each month for her auto insurance policy. this regular payment is called a: co-pay, deductible, premium, claim?
balu736 [363]
Co-pay: Term often used in health care, insurance covers part of the cost and you pay the rest. Seeing in this situation you are paying for the insurance itself, the term is not correct. 

Deductible: An insurance term for when you have to pay a certain amount before insurance will cover the rest. 

Premium: A fee payed by the insured (Jan) to be covered. This is my best guess for your answer.

Claim: A claim is when Jan would request the insurance company to reimburse her after a car accident (or her tires got slashed, etc.)
3 0
3 years ago
Other questions:
  • In one to two sentences, describe one method for launching or opening a program.
    5·2 answers
  • Given an integer variable bridgeplayers, write an statement that increases the value of that variable by 4.
    9·1 answer
  • I’m having trouble with my computer. It’s stuck on this automatic repair screen and every time I try to reset it, it says “Your
    5·1 answer
  • The entirety of a packet at one layer becoming the payload section at another layer is known as
    8·2 answers
  • How are cars made in georgia
    15·1 answer
  • Symmetric cryptography uses identical keys for both encryption and decryption. True False
    10·1 answer
  • I need help Asap!!! So the question is "Compare and contrast Web page and Websites". ​
    12·1 answer
  • Consider a system which has a memory access time of 300 nsec. An average page fault takes around 10 millisecond to get serviced.
    15·2 answers
  • PLS HELP subject (Microsoft Excel ) True or False:
    9·1 answer
  • Write a function called printRange() that accepts two integers as arguments and prints the sequence of numbers between the two a
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!