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
I’m nobody. Who are you?
stepan [7]

Answer:

The poet praises the common man.

Explanation:

8 0
3 years ago
Read 2 more answers
In the space below, explain how the Table Tools can be accessed
ZanzabumX [31]

Answer:

Click in the cell (or select multiple cells) that contains text you want to align. The Table Tools tab appears. Click the Layout tab under the Table Tools heading. … If you change the alignment of blank cells, any new text you type in those blank cells will appear according to the alignment you choose.

Explanation:

3 0
3 years ago
Ask the user to input a country name. Display the output the message “I
Sever21 [200]

Answer:

Explanation:

The following code is written in Python, it asks the user for an input saves it to a variable called country, and then prints out the sentence example in the question using the user's input. The output can be seen in the picture attached below

country = input("input country")

print('I would love to go to ' + country)

4 0
3 years ago
Which of the following is a responsibility of CTSO membership?
Leni [432]

Answer:conducting yourself appropriately and professionally

Explanation:

2021 edg

7 0
2 years ago
Which of the following common software packages would help a business
Jobisdone [24]

Answer:

D. Spreadsheets

Explanation:

While A also seems correct, a spreadsheet is best at collecting and organizing data. Databases would only store data while a spreadsheet would keep those records, as well as help calculate a budget or payroll.

3 0
3 years ago
Other questions:
  • 1. When you write HTML code, you use ______ to describe the structure of information on a webpage. a. a web address b. tags c. s
    6·1 answer
  • Discuss OPENGL instruction to draw the following drawing primatives:
    14·1 answer
  • A database interrogation is a major benefit of the database management approach, where end users can query (“ask”) the database
    6·1 answer
  • Before guis became popular, the _______________ interface was the most commonly used.
    15·1 answer
  • (1) Prompt the user to enter a string of their choosing. Output the string.
    11·1 answer
  • You are planning the requirements for a site tracking and reporting system for your company Web site. Which of the following inf
    10·1 answer
  • Consider an allocator on a 32-bit system that uses an implicit free list. Each memory block, either allocated or free, has a siz
    11·1 answer
  • Which careers require completion of secondary education, but little to no postsecondary education? Mathematical Technicians and
    8·2 answers
  • A malware which acts like a spy in computer system is called ___?​
    15·2 answers
  • Memory of your familiar old e-mail password may block the recall of your new password. This illustrates
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!