Ex 04
Ex 04
Each of the following programs should begin with a program header block
comment. Ensure that each program is using good output style.
1. Prompt the user for the radius of a circle and output the area of the circle.
Round your answer to one decimal place.
Be sure that your program has good output style. It should prompt the user
for their number, and then it should explain what the answer represents.
For example, your program should look something like this when it runs:
(In this example, underlined text represents information the user typed in.)
2. Prompt the user for the length and width of a rectangle and output the area.
Just as with exercise 1, ensure your program is using good output style.
Save your completed program under the file name: 4_2.py
3. Prompt the user their full name and then print three lines.
On the first line of your program, it should print the user’s name once.
On the second line, your program will print the user’s name twice.
On the third line, your program will print the user’s name three times.
You may use the default separator behavior when printing the names.
4. Write a program that will prompt the user for a number of dollars (as a whole
number) and then prints the number of quarters with an equivalent value.
For example, your program should look something like this when it runs:
(In this example, underlined text represents information the user typed in.)
7. For each of the following variable names, state whether it is a good name, a
bad name (but still works), or if it will cause a syntax error.