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 22:00
What is the name of the option in most presentation applications with which you can modify slide elements? 1. the option enables you to modify a slide element in most presentation applications.
Answers: 3
question
Computers and Technology, 23.06.2019 09:00
Which best describes the role or restriction enzymes in the analysis of edna a. to break dna into fragments that vary in size so they can be sorted and analyzed b. to amplify small amounts of dna and generate large amounts of dna for analysis c. to purify samples of dna obtained from the environment so they can be analyzed d. to sort different sizes of dna fragments into a banding pattern that can be analyzed
Answers: 1
question
Computers and Technology, 23.06.2019 11:30
Which excel file extension stores automated steps for repetitive tasks?
Answers: 1
question
Computers and Technology, 25.06.2019 09:20
Part d: float check string has a method s.isdigit() that returns true if string s contains only digits and false otherwise, i.e. s is a string that represents an integer. write a function named float_check that takes one parameter that is a string and returns true if the string represents a float and false otherwise. for the purpose of this function we define a float to be a string of digits that has at most one decimal point. note that under this definition an integer argument will return true. remember “edge cases” such as “45.” or “.45”; both should return true. for example: float_check('1234') returns true float_check('123.45') returns true float_check('123.45.67') returns false float_check('34e46') returns false float_check('.45') returns true float_check('45.') returns true float_check('45..') returns false
Answers: 2
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, 30.11.2020 22:50
question
Advanced Placement (AP), 30.11.2020 22:50
question
Mathematics, 30.11.2020 22:50
question
Mathematics, 30.11.2020 22:50
Questions on the website: 13722361