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
BabaBlast [244]
4 years ago
7

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:
emmasim [6.3K]4 years ago
6 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
Who is the traitor of UA?<br><br>1 Karishma<br><br>2 Yuga Aoyama<br><br>3 Denki <br><br>4 Mineta
Ipatiy [6.2K]

Answer:

your answer is yuga Aoyama

6 0
3 years ago
In a case where electrical current leakage from the circuit occurs, the GFCI would do the following:
tigry1 [53]

Answer:

In a case where electrical current leakage from the circuit occurs, the GFCI would do the following:

1. Sense the current leakage.

2. Trip the circuit.​

3. Cut off the electricity.

Electrical current leakage needs to be sensed at once. Without it being detected, it cant be dealt with. The second step consists of tripping the  circuit so at to remove the flow of electricity. The third step is to Cut the electricity off so to stop the leakage and be safe.

I hope the answer is helpful.

Thanks.

4 0
3 years ago
Zac works in the robotics industry. He assists in assembling robots. He also carries out regular inspections at industries that
loris [4]

Answer:

Robotics Engineer

Explanation:

This is a designation for those like Zac who have loads of patience, and also a lot of experience in Engineering. It's the Engineers like Zac who is responsible for figuring out the robots on paper. And this takes quite an effort as they have to do a lot of research as well as should be technically sound as well as sophisticated in Robotics. Note, Zac assists in assembling Robots, and this can only be done by a Robotics Engineer. And Zac also carries regularly the inspection of the industries which have bought his organization's Robots. And he finds if they are functionally sound. And that can be done by only a Robotic Engineer, And he is hence, certainly a Robotic Engineer.

7 0
3 years ago
Read 2 more answers
Complete the code to finish this program to analyze the inventory for a store that sells purses and backpacks.
sp2606 [1]

Answer:

import csv

fileIn = open("data/bags.txt","r")

countPurse = 0

textFile= csv.reader(fileIn)

for bag in textFile:    

   if bag[ 1 ] == 'purse':

       countPurse = countPurse + int(bag[6])

fileIn.close()

print("Number of purses:",countPurse)

Explanation:

I hope this helps!

3 0
3 years ago
Which of the following would be considered the highest risk portfolio?
sashaice [31]

The best option is (C) A portfolio made up of 60% stocks, 30% mutual funds, and 10% Treasury bonds.

There are a lot of risks involved when investing in almost anything. You may end up paying a lot for something that may not be worthwhile and at the end of it all end up losing a lot more than you get. In this case, more than half of the money has been invested in stocks and the prices of stocks change daily. Investing in stocks may give a good return but remains high risk to involve yourself in and should be avoided as much as possible.






4 0
3 years ago
Other questions:
  • Jacob is a website designer. Whenever his company takes on a new project, Jacob takes the initiative and comes up with ideas and
    12·1 answer
  • One of the disadvantages of Audacity is that it has limited technical support since it is a free program.     true or false
    11·2 answers
  • What is the slide sorter view used for?
    11·1 answer
  • Heeeaaaalp please!!!!
    15·2 answers
  • Which of the following are examples of how a company might use consumer data it had collected? a To decide what types of product
    10·1 answer
  • Access Help defaults to searching for information on the _________.<br><br> Not multiple choice
    10·1 answer
  • What is c also write it's features
    8·2 answers
  • What of the following is not a benefit of active listening
    8·2 answers
  • Which of these devices collects the most information on network activity?
    11·1 answer
  • Do you all like IXL?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!