Answered step by step
Verified Expert Solution
Question
1 Approved Answer
7 AFIZZY PROBLEM Write a method named fizzBuzz. Given an int n, return the number followed by !. So the int 6 returns 6!. Except
7 AFIZZY PROBLEM Write a method named fizzBuzz. Given an int n, return the number followed by "!". So the int 6 returns "6!". Except if the number is divisible by 3 use "Fizz" instead of the number, and if the number is divisible by 5 use "Buzz", and if divisible by both 3 and 5, use "FizzBuzz". Do not put the quotes around your result . input of 1"1!" input of 2 "2!" . input of 3 "Fizz!" 8 ANOTHER FIZZY PROBLEM Write a method named fizzBuzz. Given an input string str, if the string starts with "f" (either upper or lowercase), return "Fizz". If the string ends with "b" (either upper or lowercase), return " Buzz". If both the "f" and "b" conditions are true, return "FizzBuzz". In all other cases, return the string unchanged. Do not put the quotes around your result . input of "fig" + "Fizz" . input of "dib""Buzz" input of "fib" "FizzBuzz" 9 THE PARTY PROBLEM Write a method named partyOn. We are having a party with amounts of tea and crumpets Return the outcome of the party as "sad", "pleasing" or "brilliant". A party is pleasing if both tea and crumpets are at least 5. However, if either tea or crumpets is at least double the amount of the other one, the party is brilliant. However, in all cases, if either tea or crumpets is less than 5, the party is always sad. Do not put the quotes around your result . input of 6, 8 "pleasing" . input of 3, 8"sad" . input of 20, 6"brillliant" 10 THE SPECIAL SUM PROBLEM Write a method named specialSum. Return the sum of the two int arguments, a and b However, "teen" values in the range 13. .19 inclusive, are extra lucky. So if either value is a teen, just return 19 . input of 3, 47 . input of 10, 1319 . input of 13, 219
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started