Question
Suppose you are making a birthday cake for a large group of people. Get user input for the total size of the cake (length and
Suppose you are making a birthday cake for a large group of people. Get user input for the total size of the cake (length and width in feet), the length of one square piece (whole inches), and a message to be written on the cake (only one word).
Your program must then compute how many cake servings will be in one row and how many rows there will be (round down for both), based on the piece size. It should then calculate and display how wide each letter in the message will be (in inches), assuming they are all exactly the same width and cover the cake length exactly along the full length with no space between the letters. Output the letter width with exactly 3 digits of precision after the decimal point. Note that each foot is 12 inch; perform conversions as needed.
Here is a sample run with the user input in bold. Your output must match this format exactly when you run the tests (but remember that the input will be entered separately in the zyDE). You can assume that all input we test with is valid, including that sizes are positive values. You will see few of our grading tests, but not all. Remember that your output must match our expected output exactly for full credit. [Hint: use Math.floor() where needed. Hint2: use printf for formatted output.]
Enter the length and width of the cake in feet:
2.6 0.8
Enter the size of a square piece in inches:
3
Enter the cake message:
HappyBirthday!
The cake will have 10 pieces in each of 3 rows
Each letter will be 2.229 inches wide
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