Question: Assume we have already defined a variable of type String called name with the following line of code: String nane???; // 'name' can have any

 Assume we have already defined a variable of type String called
name with the following line of code: String nane"???"; // 'name' can

Assume we have already defined a variable of type String called name with the following line of code: String nane"???"; // 'name' can have any String value TASK: Print a welcome message "Hello, nome Welcome to cs 7.) surrounded by a box of asterisks (*) with spaces separating the box and your text. EXAMPLE: If nane is "Newmar", you would print the following ******** * Hello, Newmont Welcome to cs 71 :) EXAMPLE: If name was "Jerry, you would print the following: Hello, Jerry! Welcome to cs 71 :) NOTE: Notice how the length of none affects the length of the message, which in turn affects the number of surrounding asterisks and spaces. NOTE: You do not need to create a class or main method, and you do not need to create the variable nane. We have done all of that behind the scenes HINT: Try to re-use your code from the previous two problemol Figure out how many anteriska go on the 1st/Sthrows, and figure out how many spaces go on the 2nd/4th rows. Sample Input 1 Frodo Sample Output 1: Hello, Frodo! Welcome to CS 71 :) NOTE: Notice how the length of nane affects the length of the message, which in turn affects the number of surrounding asterisks and spaces. NOTE: You do not need to create a class or main method, and you do not need to create the variable name. We have done all of that behind the scenes. HINT: Try to re-use your code from the previous two problemst Figure out how many asterisks go on the 1st/5th rows, and figure out how many spaces go on the 2nd/4th rows. Sample Input 1: Frodo Sample Output 1: ***************** * Hello, Frodo! Welcome to CS 7! :) * * *** Sample Input 2: Sam Sample Output 2: ************* * Hollo, Sant Welcome to cs 71 :) w RRRR

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!