Question: Write code that prints a random lower case letter using the Math.random() method. Hint: Only 1 line of code inside the System.out.println is needed. Your

Write code that prints a random lower case letter using the Math.random() method. Hint: Only 1 line of code inside the System.out.println is needed. Your 1 line of code should generate any letter from 'a' to 'z'. Typecasting is needed in the end to convert the generated random number into a character. Character 'a' is represented as number 97 inside the machine.

Step by Step Solution

3.37 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Use the following oneliner Java code to print a random low... View full answer

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 Programming Questions!