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
WARRIOR [948]
3 years ago
8

Write the definition of a method dashedLine, with one parameter, an int. If the parameter is negative or zero, the method does n

othing. Otherwise it prints a complete line terminated by a newline to standard output consisting of dashes (hyphens) with the parameter's value determining the number of dashes. The method returns nothing.
Computers and Technology
1 answer:
ZanzabumX [31]3 years ago
5 0

Answer:

import java.util.Scanner;

public class DashLine {

public static void main(String[] args) {

// Declaring variables

int n;

/*

* Creating an Scanner class object which is used to get the inputs

* entered by the user

*/

Scanner sc = new Scanner(System.in);

// Getting the input entered by the user

System.out.print("Enter a number :");

n = sc.nextInt();

// calling the method by passing the user entered input as argument

dashedLine(n);

}

//This method will print the dashed line for number greater than zer

private static void dashedLine(int n) {

if (n > 0) {

for (int i = 1; i <= n; i++) {

System.out.print("-");

}

System.out.println();

}

}

}

Explanation:

You might be interested in
You have several marketing documents that are published through AD RMS. However, you have three new marketing employees that req
snow_lady [41]

Answer:

Document unauthorized

Explanation:

this way new employees will not try to open

5 0
3 years ago
Absolute time would be most similar to :
Luda [366]
The absolute time would be most similar to a fact. It was theorised and in fact, approved by scientists as a scientific law which governs, according to Wikipedia, as a "<span>true and mathematical </span>time<span>, of itself, and from its own nature flows equably without regard to anything external, and by another name is called duration: relative, apparent and common </span><span>time."</span>
3 0
3 years ago
The class at the top of exception class hierarchy is ..........................
Lynna [10]

Answer:

<u>B) Throwable</u>

Explanation:

Great question, it is always good to ask away and get rid of any doubts that you may be having.

There are a wide range of classes on the exception class hierarchy. All the way on the top is the Objects Class but since that is not an available answer we will move on to the next one. The next one is the <u>Throwable</u> class. therefore that is the answer.

**Exception is after Throwable , and Arithmetic Exception is at the bottom.... everything is a class so that is not a part of the hierarchy **

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

6 0
3 years ago
What type of socket should be used with an air impact wrench
Vikentia [17]
<span>Black sockets should be used, but the color is not the reason why. Chrome sockets will cause splits to form in the socket walls pretty quickly, after only a few uses. But the black sockets are that color because they have gone through a process called Parkerizing that coats the surface of the socket in order to provide more resistance when being used and protect the socket against corrosion.</span>
3 0
2 years ago
Pls answer asap do not use internet
kozerog [31]

Answer:

key differences between linux and windows operating system linux is free and open resource whereas windows is a commercial operating system whose source code is inaccessible windows is not customizable as against linux is customizable and a user can modify the code and can change it looks and feels

Explanation:

I hope this helps

5 0
3 years ago
Other questions:
  • A DSLR camera is made up of two parts. They are
    13·2 answers
  • What command do you type in the search box to access the command line intrface in windows?
    8·1 answer
  • I'm looking for a new laptop for school. Which laptop would be the best. Right now I have a chromebook and it is broken. 
    12·2 answers
  • What are the characteristics of a severe storm
    12·1 answer
  • When was the Ethics Resource Center (ERC) established? In the 1970s In the 1980s In the 1990s In the 2000s
    14·1 answer
  • Which of the following is NOT areserved word in Java?intpublicstaticnum
    9·1 answer
  • All the network nodes are connected to each other
    8·1 answer
  • Why can’t I message people? It doesn’t let me, please help.
    12·2 answers
  • What are the cloud storage components
    6·1 answer
  • Select the three concepts of capital outlay.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!