Write a program that calls methods for each of the following mini problems from its main method. Us a single Scanner for the program declared in the class as private Static Scanner keyboard = new Scanner(System.in); Repeat the calorie counting program from problem 5 in a new method. This time ask the user to input the string “M” if the user is a man and “W” if the user is a woman.   Use only the male formula to calculate calories if “M” is entered and use only the female formula to calculate calories if “W” is entered.  Output the number of chocolate bars to consume as before.      2. For all of the following words, if you move the first letter to the end of the word, and then spell the result backwards you will get the original word: banana dresser grammar potato revive uneven assess Write a method that reads a word and determines whether it has this property. Continue reading and testing words until you encounter the word quit. Treat uppercase letters the same as lowercase letters. Display how many words you found when you finish.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Modularization Techniques
Section: Chapter Questions
Problem 13RQ
icon
Related questions
Question

Write a program that calls methods for each of the following mini problems from its main method.

Us a single Scanner for the program declared in the class as
private Static Scanner keyboard = new Scanner(System.in);

  1. Repeat the calorie counting program from problem 5 in a new method. This time ask the user to input the string “M” if the user is a man and “W” if the user is a woman.   Use only the male formula to calculate calories if “M” is entered and use only the female formula to calculate calories if “W” is entered.  Output the number of chocolate bars to consume as before.

 

   2. For all of the following words, if you move the first letter to the end of the word, and then spell the result backwards you will get the original word:

banana dresser grammar potato revive uneven assess

Write a method that reads a word and determines whether it has this property. Continue reading and testing words until you encounter the word quit. Treat uppercase letters the same as lowercase letters. Display how many words you found when you finish.

Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
void method
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage