Question
Q: Write to console Writing to console was discussed in lecture 1.2 Implement the three functions printHelloUser() printHelloUserNewline() printHelloUserBlankLines() to write to the console in
Q: Write to console Writing to console was discussed in lecture 1.2
Implement the three functions printHelloUser() printHelloUserNewline() printHelloUserBlankLines() to write to the console in the manner described.
Code:
package systemout;
public class WriteToConsole { /** * Prints the phrase "Hello, user!" to the system out console. */ public void printHelloUser() { // write your code here }
/** * Prints the phrase "Hello, user!" to the system out console (i.e. the first line), * followed by "Greetings!" on a new line (i.e. the second line). */ public void printHelloUserNewline() { // write your code here }
/** * Prints the phrase "Hello, user!" to the system out console (i.e. the first line), * followed by two blank lines, * followed by "Greetings!" on the fourth line. */ public void printHelloUserBlankLines() { // write your code here } }
Write to console Writing to console was discussed in lecture 1.2 1 package systemout; 2 3 public class WriteToConsole { 4 /** 5 * Prints the phrase "Hello, user!" to the system out cons 6 */ 7 public void printHelloUser() { 8 // write your code here 9 } 10 11 /** 12 * Prints the phrase "Hello, user!" to the system out cons 13 * followed by "Greetings!" on a new line (i.e. the second 14 */ 15 public void printHelloUserNewline () { 16 // write your code here 17 } Implement the three functions printHelloUser() printHelloUserNewline() printHelloUserBlankLines () 18 to write to the console in the manner described. 19 20 21 22 23 24 25 26 27 } /** * Prints the phrase "Hello, user!" to the system out cons * followed by two blank lines, * followed by "Greetings!" on the fourth line. */ public void printHelloUserBlankLines () { // write your code here } 28Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started