Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Implementing Ai And Machine Learning For Business Optimization

Authors: Robert K Wiley

1st Edition

B0CPQJW72N, 979-8870675855

More Books

Students also viewed these Databases questions

Question

2. Define identity.

Answered: 1 week ago

Question

1. Identify three communication approaches to identity.

Answered: 1 week ago

Question

4. Describe phases of majority identity development.

Answered: 1 week ago