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
If Mary makes homemade jams that she sells to her local grocer, she is practicing:
DIA [1.3K]

Answer: c) C2B (Consumer to business)

Explanation: Consumer to business (C2B) is the business technique in which the consumer or customer generates the good or service and then businesses are offered to take that product or service. The case mentioned in the question is also similar where May sells the jams made by her to the local grocer who has his business.

Other options are incorrect because Business to business (B2B) is where two business party trade with each other, Business to consumer (B2C) is business offer the product or service to consumer and Costumer to costumer(C2C) is the private trading of service between two individual parties. Thus,the correct option is option(c).

8 0
3 years ago
What are the two basic literary forms?
Korolek [52]
Fiction and nonfiction
6 0
3 years ago
Stephanie is a zoologist who loves the outdoors and often travels the world researching wildlife and serving as a consultant it
Flauer [41]

Answer:

Nature (at all) is the best place for her to work at. Researcher or Environmental activist or Biologist Professor or Zoo care/assistant. All of the mentioned works can be applied to her.

Explanation:

8 0
3 years ago
Read 2 more answers
Which statement about the Weather Bar in the Outlook calendar is true?
NARA [144]

Answer:

C

Explanation:

3 0
3 years ago
PLEASE HELP WILL GIVE BRAINLIEST!
fgiga [73]

Answer:

(1BD.63B851EB851EB851EB85)₁₆

Explanation:

7 0
4 years ago
Read 2 more answers
Other questions:
  • If we recorded the average U.S. Housing Price every month for the next year, what graphical display is most appropriate to displ
    6·1 answer
  • If you combine two cells into one, what action are you performing?
    12·2 answers
  • In normal view, powerpoint's ________ contains buttons such as notes, comments, and view.
    14·1 answer
  • Are scripted languages easier or more difficult to port than programming languages? Why?
    6·1 answer
  • What file does a aac run under
    11·1 answer
  • Microsoft PowerPoint is popular software that allows you tocreate slides, handouts, notes, and outlines.
    12·1 answer
  • Hola soy nuevo alguien me dice como funciona cada tipo de internet osea mandenme imágenes de diferentes moden creo que ya saben
    11·1 answer
  • For a new version of processor, suppose the capacitive load remains, how much more energy will the processor consume if we incre
    12·1 answer
  • What are some industries of aerodynamics and hydrodynamics? explain each one in detail.
    5·2 answers
  • Explain employment opportunities in the networking field 
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!