Question: A. Write a method named mysteryWord that accepts a single integer parameter and returns a String of that length with random (upper case) characters.

A. Write a method named mysteryWord that accepts a single integer parameter 

A. Write a method named mysteryWord that accepts a single integer parameter and returns a String of that length with random (upper case) characters. (Hint: (char)65 is 'A' and (char)90 is 'Z'). Example use shown below. B. Write a method named countOf9 that accepts a single integer parameter and returns the count of number of times digit 9 appears in that integer. For example, countOf9(23969) will return 9 whereas countOf9(8757) will return 0. Make sure your code works for single digit as well as negative numbers correctly. You are not allowed to convert the number to a string and use any string methods. Reminder: Class name, and correct 1,2,3 (return, name, parameters) for each method is the best place to start!!! Here's a main() method for Quiz5.java that will work if you do this correctly: public static void main(String[] args) { } String thing mysteryWord(4); System.out.println(thing); // "SDTL" on my first test do { thing mysteryWord (4); } while (!thing.equals("SURE")); System.out.println(thing); // ultimately I get "SURE" System.out.println("countOf9 in 45894399 is " + count0f9 (45894399)); //Should be 3 System.out.println("countOf9 in 424 is " + count0f9 (424)); //Should be System.out.println("countOf9 in -919199 is " + countOf9(-919199)); //Should be 4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here are the methods mysteryWord and countOf9 java import javautilRandom public class Quiz5 Method t... 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!