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
Which of these is a Microsoft certification for system engineers
kow [346]

Answer: B. MCSE

Explanation:

Microsoft offers various courses and certifications for different careers in the IT industry. One such career is system engineering where the MCSE which stands for Microsoft Certified Solutions Expert is offered.

This certification proves that one is proficient with technologies such as server infrastructure, data platforms and business intelligence. Prospective careers apart from sound engineering include Network management and Database Analysis.

7 0
3 years ago
Write a program that inputs two characters first and second, and then prints all non-alphabetic characters starting from second
baherus [9]

Answer:

fbtcft gdfgfffff tvfft gxf

8 0
3 years ago
daniel wants to buy a computer to use for playing games after work. he loves racing games and wants to make sure his device has
kirza4 [7]

The factors which should be considered by Daniel are the RAM capacity and the Processor Core of the computer.

Computer games especially racing and football games are usually memory intensive and as such will require a good amount of RAM in other to ensure that the game runs smoothly as the RAM provides a temporary storage required for applications or programs to run smoothly.

Also, the processor core has to be put into consideration, Daniel will need a multi - core processor in other to aid the smooth running of his racing game.

Therefore, the factors that should be considered are the RAM and processor core.

Learn more :brainly.com/question/25010930

5 0
2 years ago
Choose the type of error described.
Bingel [31]

Answer:

first scenario: B

second scenario: C

third scenario: A

hope this helps! :-)

4 0
3 years ago
Write code that inserts userItems into the output string stream itemsOSS until the user enters "Exit". Each item should be follo
Yuki888 [10]

Answer:

The solution code is written in Python:

  1. itemsOSS = ""
  2. userItem = input("Enter an item: ")
  3. while(item != "Exit"):
  4.    itemsOSS += userItem + " "
  5.    userItem = input("Enter an item: ")
  6. print(itemsOSS)

Explanation:

Firstly, we create a variable itemsOSS (intialized it with empty string) and use it as output string stream (Line 1).

Next use input function to prompt user to enter first item (Line 2)

While the item value is not "Exit" (Line 4), append userItem to variable itemsOSS.

When the user enter "Exit", use print function to print the itemsOSS string (Line 8).

8 0
3 years ago
Other questions:
  • Travis completes his assignments on a word processor. He wants to make sure that his documents are free from spelling or grammat
    9·2 answers
  • What are the best apps to learn coding
    15·2 answers
  • After reviewing the various types of network connections available, a client chooses a network connection that is considered to
    13·1 answer
  • Which is the correct formula to add the values in cells A1 and B1?
    11·2 answers
  • Which remote access configuration option should you choose if you want mobile users to be able to make a secure connection to th
    9·2 answers
  • The fill command try’s to fill or generate content for cells based on a ________.
    15·1 answer
  • Which one is not considered part of the cinematography team?
    7·2 answers
  • What type of computer is used in ATM?
    11·2 answers
  • Define E-Mail Write any 4 special features of E-Mail ​
    13·1 answer
  • Choose the missing words in the code below.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!