public class MyProgram extends ConsoleProgram { public void printMessage(String lineOne, String lineTwo, int numLines) { } public void run() }

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 14RQ
icon
Related questions
Topic Video
Question

use java

1 public class MyProgram extends ConsoleProgram
2- {
public void printMessage (String lineOne, string lineTwo, int numlines)
{
3
4-
5
}
7
public void run()
{
8
9
10
}
12 }
11
Transcribed Image Text:1 public class MyProgram extends ConsoleProgram 2- { public void printMessage (String lineOne, string lineTwo, int numlines) { 3 4- 5 } 7 public void run() { 8 9 10 } 12 } 11
Fill in this function that takes three parameters, two Strings and an int.
The Strings are the message that should be printed. You should alternate
between the Strings after each line. The int represents the total number of
lines that should be printed.
For example, if you were to call
printMessage("Hi", "Karel", 5);
the function should produce the following output:
Hi
Karel
Hi
Karel
Hi
Transcribed Image Text:Fill in this function that takes three parameters, two Strings and an int. The Strings are the message that should be printed. You should alternate between the Strings after each line. The int represents the total number of lines that should be printed. For example, if you were to call printMessage("Hi", "Karel", 5); the function should produce the following output: Hi Karel Hi Karel Hi
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,