Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

Students also viewed these Databases questions

Question

2. Place a value on the outcomes.

Answered: 1 week ago