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
Please try and solve this
Genrish500 [490]

Answer:

Many students coming into Woodworking 108 are bewildered by “all those little marks ... Parts of an inch will be referred to in fraction form instead of its decimal equivalent. ... on divisions of 2: 1” 2= ½”. ½” 2= ¼”. ¼” 2= 1/8”. 1/8” 2= 1/16”. 1/16” 2= 1/32” ... way is to realize there are 16/16 in an inch and count back 3 of the 1/16 ...

Explanation:

4 0
3 years ago
Why were video games invented?
Alenkinab [10]
The answer is in the following website: https://www.reference.com/history/were-video-games-invented-e9413d3dc1378766


4 0
3 years ago
Which VMware product would allow administrators, to manage enterprise desktops with increased reliability, security, end-user ha
ahrayia [7]

Answer: Horizon

Explanation:

VMware Horizon Suite is a collection of products designed by VMware for Windows, Mac and Linux which allows administrators, to manage enterprise desktops with increased reliability, security, end-user hardware independence, and convenience

delivering data securedly on different remote devices.

7 0
3 years ago
The animal shelter requires that people who volunteer there affirm that they are not allergic to dogs or cats. How would you mod
shepuryov [24]

Answer: Through the use of close-ended questions, for example a question with a YES/NO answer.

Explanation:

Close ended questions are questions in which a participant has already been provided with options to a question, and so the participants must choose from the options and cannot give an answer outside the options given.

Using this kind of question to modify the database schema would be helpful.

Therefore, in order to affirm that the volunteers are not allergic to dogs or cats, the close ended question "are you allergic to dogs or cats" can be used. The volunteers would be provided with a yes or no answer which they must choose from.

This would help in modifying the database schema while affirming whether the volunteers are allergic to dogs or cats.

5 0
3 years ago
Read 2 more answers
Криптографический метод защиты информации?
Andru [333]

Answer:

the answer is green pineapples

5 0
3 years ago
Other questions:
  • A block style business letter is
    14·1 answer
  • Discuss anomaly detection.
    5·1 answer
  • Compressing a file is also called
    9·2 answers
  • What is the full form of icimod?
    6·1 answer
  • Alison retrieved data from a company database containing personal information on customers. When she looks at the SSN field, she
    14·1 answer
  • The
    12·2 answers
  • Use the drop-down menus to answer the questions.
    6·1 answer
  • Need answer ASAP!!!!
    14·1 answer
  • Koi jinda hei kya hello​
    13·2 answers
  • Which two features could be added to a game using an "if () then" block?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!