Question: class Main { public static void main(String[] args) { // TODO: First coding session // Create a short program that prompts the user for their

class Main { public static void main(String[] args) { // TODO: First coding session // Create a short program that prompts the user for their name, // reads the name, and replies with a greeting by name, starting // with "Hello, " // Use java.util.Scanner to read from System.in. // Use System.out.println() to reply. // TODO: Second coding session // Use the Scanner's type-specific methods to read user input // as int, double, boolean and String, in that order. // Output them all on one line separated by spaces, in the same order. // In the questions below use length(), toLowerCase(), toUpperCase(), // trim(), charAt(int), indexOf(int ch), indexOf(String), // replace(char from, char to), substring(int from), and/or // substring(int from, int to) // TODO: Third coding session. // Modify "The quick brown fox jumps over the lazy dog." to make // 1. all consonants be lower case // 2. all vowels to be upper case // 3. output the resulting string // Consider using String.toLowerCase() and String.replace(). // TODO: // Extract and print the word "fox" using indexOf() and substring() methods. // TODO: Fourth coding session. // Print field of asterisks (*) per the instructions. // TODO: // Print field of double quotes (") per the instructions. }

}

Instructions from your teacher:

Warm up

Use Scanner and System.in to read data from the user, then System.out to print it back out.

Use Scanner.nextLine() and related .next*() methods.

Use String methods.

Field of stars

After doing the first N exercises, use the special characters \t and to output this flag-like set of stars. Don't use spaces or tabs in your println() calls, use "\t" instead.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

After getting the stars to print, add another set of code to print with double quotes (") instead of asterisks (*).

" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " "

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!