Repeat the calorie counting program described in Programming Project 8 from Chapter 2. 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.

This project is a relatively simple addition using String input.and an if statement.


See the code in CandyCalculator2.java.

Computer Science & Information Technology

You might also like to view...

What do you place in front of the scope operator(::) in the implementation of a template class called someThing?

What will be an ideal response?

Computer Science & Information Technology

2. ________ in Google search queries are interpreted as AND.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The ____________________ button hides a layer in the Layers panel.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The default authentication option for forest trusts is _____________ authentication

a. Domain-wide b. Forest-wide c. Selective d. None of the above.

Computer Science & Information Technology