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
inna [77]
4 years ago
4

CHALLENGE ACTIVITY 5.2.3: Basic while loop expression. Write a while loop that prints userNum divided by 4 (integer division) un

til reaching 2 or less. Follow each number by a space. Example output for userNum = 160: 40 10 2 Note: These activities may test code with different test values. This activity will perform four tests, with userNum = 160, then with userNum = 8, then with userNum = 0, then with userNum = -1. See "How to Use zyBooks". Also note: If the submitted code has an infinite loop, the system will stop running the code after a few seconds, and report "Programend never reached." The system doesn't print the test case that caused the reported message.
Computers and Technology
1 answer:
monitta4 years ago
5 0

Answer:

input with 160

output: 40 10 2

Explanation:

import java.util.Scanner;

//Define the class divideFour

public class divideFour

{

  public static void main(String[] args)

  {

      //Declaration of variables as integer

      int userNum;

      //set an input

      userNum = 160;

      //Run the while loop until the conditions are not satisfied.

      while(userNum>2)

      {

          //Divide userNum by 4 and store it in the same.

          userNum = userNum/4;

          //Print the new value of the userNum

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

      }

      System.out.print("");

  }

}

You might be interested in
Jenna wants to convert a decimal number to its octal form. Which option will she use to calculate the octal number?
Gelneren [198K]

Answer and Explanation

Needs  to 'multiply' a number by the base value 8 in octal.

To convert from octal to decimal, make a table of base 8 multipliers.  

8⁵ = 32,768  

8⁴ = 4,096  

8³ = 512  

8² = 64  

8¹ = 8  

8⁰ = 1

Octal number system is the base of -8 number system which uses the digits zero to seven. while decimal numbers  or decimal system uses the positional numeral system 0-9. . It also requires a dot (decimal point) to represent decimal fractions.

6 0
3 years ago
Imagine that you are preparing a series of bitmap graphics for a Website. To decrease the download time for each graphic, you ca
Yakvenalex [24]
The answer t this question is .bmp
4 0
4 years ago
In the early days of computer technology, which system was justified because data-processing personnel were in short supply, har
crimeas [40]

Answer:

Centralized Processing

Explanation:

Centralized processing was developed to process all of the data in a single computer, and since the first computers were stand-alone with all input and output devices in the same room, only the largest organizations could afford to use centralized processing.

5 0
3 years ago
Will a company ever finish its social media marketing strategy?
aleksley [76]
No.

This is because a social media company must always continue to adapt to new trends and marketing techniques in order to remain relevant to the community.

Hope this helps!
6 0
4 years ago
What are the 3 parts of a browser window? What componets are in each?
Helga [31]
Here are the universal symbols: the minus symbol is minimize, the square(s) are for windowed mode, and the X symbol is for closing the browser. Branliest answer here.
7 0
4 years ago
Other questions:
  • Binary search requires that data to search be in order. true or false
    5·1 answer
  • A(n) _____ can be used to convert digitized documents into ascii (american standard code for information interchange) text that
    6·1 answer
  • a solid state drive is a removable flash memory device that you insert and remove from a slot in a computer, mobile device, or c
    5·1 answer
  • The false reject rate describes the number of legitimate users who are denied access because of a failure in the biometric devic
    11·1 answer
  • Difference between switch case and if else statement.​
    11·1 answer
  • The point of entry from a wireless device to a wired network is performed at a device called a(n) ____________________.
    10·1 answer
  • How many questions do you need unlock messages
    6·1 answer
  • What was Pike's objective on his first expedition in 1805?​
    9·1 answer
  • What is a graph,a chart then give similarities between graph and chart.​
    6·2 answers
  • Describing Work Styles for Farmworkers and Laborers, Crop
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!