Exercises

Goat

Exercise

Questions

Write a program that asks the user about their name, their dog's name, and shows a message. All input and output is with dialogs. First, the program asks for the user's first name:

First name

Then the last name:

Last name

Then the dog's name:

Dog's name

That's all the input. After that, your program shows a message, that puts together the data:

Output

Format the message exactly, with the right spacing, and the line breaks.

Notice something else you need to do. The user might type extra spaces around their input, like they did with the dog name.

Dog's name

Make sure the extra spaces do not affect the output.

Another run sequence:

First name

Last name

Dog name

Output

Upload your worksheet. The usual coding standards apply. Good variable names, like that.

Exercise

Cylinder covering

Write a program to help users work out how much fabric they need to make a covering for their fave cylinder. The input should be from the worksheet, like this:

Input

I asked Google how to work out the surface area of a cylinder. It said:

Surface area formula

Here's the output for that data:

Output

Problem, though. The input is in centimeters. The output should be in square meters. I asked Google about that, too.

Square cm to square meters

Another example. The input:

Input

Output:

Output

Upload your workbook. The usual standards apply.