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
Sedbober [7]
4 years ago
10

Given an int variable n that has already been declared and initialized to a positive value, and another int variable j that has

already been declared, use a do...while loop to print a single line consisting of n asterisks. Thus if n contains 5, five asterisks will be printed. Use no variables other than n and j.
Computers and Technology
1 answer:
stiks02 [169]4 years ago
5 0

Answer:

The solution code is written in Java.

  1. public class Main {
  2.    public static void main(String[] args) {
  3.        int n = 5;
  4.        int j;
  5.        do{
  6.            System.out.print("*");
  7.            n--;
  8.        }while(n > 0);
  9.    }
  10. }

Explanation:

Firstly, declare the variable n and assign it with value 5 (Line 4). Next declare another variable j.

Next, we create a do while loop to print the n-number of asterisks in one line using print method. In each iteration one "*" will be printed and proceed to the next iteration to print another "*" till the end of the loop. This is important to decrement the n by one before the end of a loop (Line 9) to ensure the loop will only run for n times.

You might be interested in
Marly is using her smartphone to review a webpage that she created. The formatting and alignment of webpage elements is incorrec
Margaret [11]

Answer:

She needs a responsive design

Explanation:

The website needs to detect what kind of device the user is using. It could be by the window size (not very accurate), or a piece of code to figure out the device being used. Once it knows what device is being used, and the size of the page, it should change its layout to fit the design.

3 0
3 years ago
1. Describe data and process modeling concepts and tools.
kow [346]

Answer:

data is the raw fact about its process

Explanation:

input = process= output

data is the raw fact which gonna keeps in files and folders. as we know that data is a information keep in our device that we use .

5 0
3 years ago
Read 2 more answers
What is the difference between a database schema and a database state?
Alexxx [7]

Answer:

A database schema or an intention gives a description of the database. This can be considered as a blueprint of a database, and gives a list of fields in the database with their data types. ... A database state provides the present state of the database and its data.

8 0
3 years ago
What are the characteristics of computer. Explain any one​
Pachacha [2.7K]

Answer:

<h3>Your answer will be on the picture above..</h3>

Explanation:

Hope it helps you..

Y-your welcome in advance..

(;ŏ﹏ŏ)(ㆁωㆁ)

7 0
3 years ago
Read 2 more answers
Why would you use a custom filter?
Angelina_Jolie [31]

Answer:By specifying conditions, you can create custom filters that narrow down the data in the exact way that you want. You do this by building a filter. If you've ever queried data in a database, this will look familiar to you. Point to either Number Filters or Text Filters in the list.

Explanation:

5 0
3 years ago
Other questions:
  • When the speaker compares dream memories to fall leaves that are hard to catch,what feeling does the simile suggest?
    14·2 answers
  • Write three tasks students can preform in a digital classroom?
    9·2 answers
  • We use them every day, but what is the overall purpose of a search engine?​
    10·2 answers
  • Write a method called makeStars. The method receives an int parameter that is guaranteed not to be negative. The method returns
    14·1 answer
  • In the terms of OOP, in the microwave system, current time is a BLANK and change heat is a BLANK
    15·1 answer
  • If you commit retail theft your drivers license will be ? A. Revoked, B. Suspended, C. Cancelled or D. Restricted
    7·2 answers
  • A python package used in text analysis and natural language processing. True or False
    10·1 answer
  • What is the default font style of “Title” box in MS PowerPoint 2013?
    8·1 answer
  • 1. I am a rectangle in a flowchart. What do I represent?
    5·1 answer
  • What is the correct order of the phases of the software development process?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!