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
Local television news networks cover only
Vika [28.1K]

Answer:

12 percent of international news

Explanation:

Just did it

3 0
3 years ago
Read 2 more answers
Styles are modified by using the Office clipboard in the Home tab. true or false
cluponka [151]
Your answer is false
7 0
3 years ago
Read 2 more answers
Monica is teaching herself to paint. What web resource would be the most helpful
strojnjashka [21]

Answer:

Video Tutorial

Explanation:

The others don’t make sense.

3 0
3 years ago
Which of the following sets of acronyms is concerned with encoding data for secure transmission?
guapka [62]

I'm pretty sure your answer is VPN. Hope this helps!

7 0
3 years ago
Need help with this
andrezito [222]

Answer:

13:a. 15:c. 14:Unknown answer

6 0
3 years ago
Other questions:
  • Information technology is the study of managing, processing, and retrieving information.
    5·1 answer
  • major m,ajorrr points helpppppppppppppppppppppppppppi have a question i hit a few buttons and now my computer is saying everythi
    11·2 answers
  • As faster processors are designed, a disparity has developed between the speed at which the CPU processes data and the speed at
    10·1 answer
  • It's better to create tables just by starting typing in the data that you want the table to store. There is no need to name fiel
    6·1 answer
  • Which statement most aptly defines the term networking?
    8·1 answer
  • When discussing the business requirements of a WLAN design, what is the first question that should be posed
    15·1 answer
  • A game developer is purchasing a computing device to develop a game and recognizes the game engine software will require a devic
    7·1 answer
  • Which is the following should be selected in the paragraph dialogue box to prevent page break from occurring within a paragraph
    12·1 answer
  • Structured query language (sql) enables data analysts to _____ the information in a database.
    7·1 answer
  • Frequently used _____________ can be saved as _____________ for use in analysis, dashboards, reports, tickets, and alerts.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!