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
vaieri [72.5K]
3 years ago
11

7.7 LAB: Using a while loop countdown Write a program that takes in an integer in the range 10 to 100 as input. Your program sho

uld countdown from that number to 0, printing the count each of each iteration.After ten numbers have been printed to the screen, you should start a newline.The program should stop looping at 0 and not output that value. I would suggest using a counter to count how many items have been printed out and then after 10 items, print a new line character and then reset the counter. important: Your output should use " %3d " for exact spacing and a space before and after each number that is output with newlines in order to test correctly.
Computers and Technology
1 answer:
dybincka [34]3 years ago
3 0

Answer:

The solution is written in Java

  1. public class Main {
  2.    public static void main(String[] args) {
  3.        int count = 0;
  4.        Scanner stream = new Scanner(System.in);
  5.        System.out.print("Input a number between 10 to 100: ");
  6.        int num = stream.nextInt();
  7.        while(num > 0){
  8.            if(count % 10 != 0){
  9.                System.out.printf("%3d", num);
  10.            }else{
  11.                System.out.println();
  12.                System.out.printf("%3d", num);
  13.            }
  14.            count++;
  15.            num--;
  16.        }
  17.    }
  18. }

Explanation:

Firstly create a counter variable, count and initialize it with zero (Line 3).

Next, create Scanner object and prompt the user to input a number between 10 to 100 (Line 4-6).

Create a while loop and set the loop condition as while the count down number is still bigger than zero, the loop should keep going on (Line 8). Next, create an if condition to check if the counter variable reach multiple of 10 times. If not print the current num or else create a new line and then only print the current num (Line 9 -14).

Increment the count by one and decrements the num by one before running the next iteration (Line 15 -16).

You might be interested in
what are some steps Hector could have taken to ensure that his photographs were not ruined near the end of the shoot?
galben [10]

Answer:

make several extra copies of the pictures and frame them right away if they're printed out.

Explanation:

3 0
2 years ago
When presenting, which tool would you use to highlight and magnify a section of the slide?
marysya [2.9K]
Well, the word magnify means to zoom, so I assume the correct answer is B. the zoom tool.
You would use this tool to zoom in your text which may be small, or to draw your audience's attention to specific details in your presentation. You would use the same tool to highlight a part of your slide.
7 0
3 years ago
Read 2 more answers
How to create drop down list in excel with multiple selections.
Art [367]

Answer: <em>Select the cell or cells you want the drop-down list to appear in.</em>

<em>Click on the Data tab on Excel's ribbon.</em>

<em>Click on the Data Validation button in the Data Tools group.</em>

<em>In the Data Validation dialog, in the Allow: list select List.</em>

<em>Click in the Source: box.</em>

<em />

<em></em>

<em />

8 0
3 years ago
Read 2 more answers
The following is the correct way to write a for loop
Rzqust [24]

Answer:

for i in range

Explanation:

This is the only excerpt of code

3 0
3 years ago
You open a folder Properties box to encrypt the folder, click Advanced, and discover that Encrypt contents to secure data is dim
yaroslaw [1]

Most likely a virus has attacked the system and is disabling encryption is the most likely problem.

c. Most likely a virus has attacked the system and is disabling encryption.

<u>Explanation:</u>

The end users can protect the folder by enabling encrypt the folder or files. But in windows encrypting the file or folder is not available. The computer management console is used to open all other services such as risk management, performance management extra.

In some other operating encryption of folder or files is allowed.  Third-party software is available to protect folder or files once the third party used any files possible to share outside the world.

As far as my knowledge there is encrypting technology is available in the windows operating system.

5 0
3 years ago
Other questions:
  • What two features distinguished Windows 2.0 from Windows 1.0?
    5·1 answer
  • What is the value of the variable result after these lines of code are executed?
    5·2 answers
  • one business rule is that each project has one manager. Identify two (and no more than two) problems with the data structure or
    9·1 answer
  • Assume that a large number of consecutive IP addresses are available starting at 198.16.0.0 and suppose that two organizations,
    13·1 answer
  • A computer is an electronic device operating under the control of instructions stored in its own memory that can accept, manipul
    11·1 answer
  • When computing the cost of the basket of goods and services purchased by a typical consumer, which of the following changes from
    11·1 answer
  • An automated search feature used by search engines to find results that match your search terms is called a spider or _______. A
    15·2 answers
  • 1. What are the main uses for Protein in the body?
    13·2 answers
  • What must your motherboard have to use bitlocker encryption in windows 7 which will ensure that your hard drive cannot be used i
    15·1 answer
  • Let A and B be regular languages. Is the set of strings of odd length from A beginning with 0 concatenated with the set of strin
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!