Instructions
Rearrange the lines of code so that the program prints the number of cans of paint needed to paint 20 rooms.
You can cut and paste a line by highlighting the line (click on the number of the line in the left column), using Ctrl+X (PC) or Cmd+X (Mac) to cut it, clicking at the new location, and using Ctrl+V (PC) or Cmd+V (Mac) to paste it. If you want to start over from the beginning, you can use the Restore button.
Note:
Hint:
- Make sure that each variable has been defined before it is used on the right-hand side of an assignment statement.
Write a program that prints the total bill for the cost of a $40 meal with 13% tax and 15% tip. The tip should be calculated based on the cost of the meal alone (not the tax) and the tax should be calculated based on the cost of the meal alone (not the tip).
You can use the variables in the code box to write your code.
Note:
Hints:
- You may also add a variable for the cost of the meal, but it is not required.
Write a program that prints the area of wrapping paper needed to cover a box with the dimensions specified by the variable assignments in the code box.
You can assume that the paper does not overlap anywhere.
Note:
Hint:
- Remember to cover the bottom, the top, the two short sides, and the two long sides.
Now change your program to print the area of wrapping paper needed to cover a box for which 35.2 is the width, length, and height.
Note:
For your new solution, the only changes needed were in the definitions of the variables.
Hints:
- undefined
Write a program that prints the total length of ribbon needed to wrap a box with the dimensions specified by the variable assignments in the code box.
The ribbon should cover the top and bottom of the box in both the long and short directions, and should cover each of the four sides once each.
You should leave another 20 centimetres for tying the bow.
Note:
Hints:
- undefined
Write a program that prompts the user for a string of length at least two and then prints a string formed by exchanging the first and last characters in the string provided by the user.
Note:
Hints:
- Use a variable to store the input from the user.
Write a program that prompts a user for an input string of length at least two and prints the string with the first half in upper case and the second half in lower case. If the length of the string is odd, the "second half" should be one character longer than the "first half".
Note:
Hints:
- Use a variable to store the input from the user.
The target heart rate can be obtained by adding the resting heart rate to the product of the target intensity (a number between 0 and 1) and the heart rate reserve.
The heart rate reserve is the difference between the maximum heart rate and the resting heart rate.
The maximum heart rate is calculated as 220 minus the age.
For the values given in the code box, print the target heart rate.
Note:
Hints:
- undefined