subject

In the language of an alien race, all words take the form of Blurbs. A blurb is a Whoozit followed by one or more Whatzits. A Whoozit is the character ‘x’ followed by zero or more ‘y’s. A Whatzit is a ‘q’ followed by either a ‘z’ or a ‘d’ followed by a Whoozit.1. Design and implement a program that generates blurbs and asks the user for how many blurbs they would like.2. Design and implement a recursive program that check a given string to be a Blurb or not. The program should repetitively prompt the users for more string to check till the user decide to stop. I already did part one here, but I still need help with part 2.import java. util. Random;import java. util. Scanner;public class BlurbyBlurb //naming corresponds to{// random number generator used by all functionspublic static Random r = new Random(); public static String Blurb(){String result = Whoozit(); // A Blurb is a Whoozitint num = r. nextInt(9) + 1;for (int i = 0; i < num; i++) //followed by one or more Whatzits.{result += Whatzit();}return result;}public static String Whoozit(){String result = "x"; // A Whoozit is the character 'x' ...int num = r. nextInt(9);for (int i = 0; i < num; i++){result += "y"; // followed by zero or more 'y's.}return result;}public static String Whatzit(){String result = "q"; // A Whatzit is a 'q'int num = r. nextInt(2);if (num == 0){result += "z"; // followed by either a 'z' or a 'd',}else // (num == 1){result += "d";}result += Whoozit(); // followed by a Whoozit. return result;}public static void main(String[] args){Scanner scan = new Scanner(System. in); System. out. println("This program makes Blurbs.");System. out. println("How many blurbs do you want?");int n = scan. nextInt();while (n > 0){System. out. println(Blurb());n--;}}}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:30
Jessie has received a contract to build a real-time application for a baker. however, the baker doesn't want to invest too much money. his only requirement is that he wants the customers to know which cupcakes are available at what time and in what quantity. so his core requirement is that the details of product should be in real time. what platform can jessie use to develop this application?
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
Kto rozmawia z clamentain przez krótkofalówke w the walking dead która śledzi lee w 4 epizodzie
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
Write a program that inserts the digits of an integer into an array in originalorderfollowed by reverse order. first, promptthe user to enter a positive integer(> 0). determine the number of digits of the integer. create a dynamically allocated integer arrayof a size twice the number of digits.now insert the digits in original order which will occupy half of the array. then, insert the digits in reverse order.finally, output thedigits in thearray.use at least two functions to organize your program.
Answers: 3
question
Computers and Technology, 24.06.2019 05:50
What all vehicles has tesla inc. created over the years
Answers: 3
You know the right answer?
In the language of an alien race, all words take the form of Blurbs. A blurb is a Whoozit followed b...
Questions
question
Mathematics, 01.07.2019 13:30
question
Mathematics, 01.07.2019 13:30
question
English, 01.07.2019 13:30
question
History, 01.07.2019 13:30