Questions


July 2021 1 83 Report




Question: Fizzbuzz Strings

Write a method Met that takes as parameter 1 String. The entire string is in lowercase.

If the string starts with f print Fizz. If the string ends with b return Buzz.
If both the f and b conditions are true, return FizzBuzz. In all other cases, print the string unchanged.

Only write the method - assume that the Class & main method have been defined.

Use the System.out.println() statement for printing.

Example Input: fuel
Output: Fizz
Example Input: lob
Output: Buzz
Example Input: flab
Output: FizzBuzz
Example Input: goodness
Output: Goodness

Answers & Comments


Add an Answer


Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Helpful Social

Copyright © 2024 EHUB.TIPS team's - All rights reserved.