> For the complete documentation index, see [llms.txt](https://mrparkonline.gitbook.io/guide-to-high-school-computer-science/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mrparkonline.gitbook.io/guide-to-high-school-computer-science/beginner-programming-grade-10-to-11/java-essentials/basics/exercise-questions.md).

# Exercise Questions

{% embed url="<https://www.youtube.com/watch?index=2&list=PLjJ2BXwGdqPi8E-WwfuwkODMEziYuToPR&pp=gAQBiAQB&v=a74jWFlUemo>" %}

1. **Write a Program that converts a user inputted temperature in Celsius to Fahrenheit.**

$$
Fahrenheit = (Celsius \* 9/5) + 32
$$

{% embed url="<https://www.youtube.com/watch?index=3&list=PLjJ2BXwGdqPi8E-WwfuwkODMEziYuToPR&pp=gAQBiAQB&v=uGnEgbp0efY>" %}

2. **Write a Program that calculates the cost of the tip and the total cost (meal + tip) of a meal.**&#x20;

```
Notes:
- The total cost will be inputted as a real number
- the tip percentage will be inputted as a whole number.
```

{% embed url="<https://www.youtube.com/watch?v=f-d7DaMa9QM>" %}

3. **Write a Program that calculates and outputs the midpoint of two points on a** [**Cartesian Plane**](https://www.varsitytutors.com/hotmath/hotmath_help/topics/cartesian-plane)**.**

<pre><code>You should have 4 inputs.
<strong>- x1
</strong>- y1
- x2
- y2
</code></pre>

{% embed url="<https://www.youtube.com/watch?index=5&list=PLjJ2BXwGdqPi8E-WwfuwkODMEziYuToPR&pp=gAQBiAQB&v=DM3g_RD-svU>" %}

4. **Write a Program that outputs the number of paint cans needed, the number of paint cans leftover, and the total cost of the project.**&#x20;

```
Instructions:
- There are 3 inputs. One for each section of the fence.
- Each fence plank denoted by a "F" requires a single paint can
- The paint can only comes in a box of 12. 
- A single box cost $14.95

Sample Input 1:
FF
FFFF
FFFFFF

Sample Output 1:
12.0
0.0
14.95

Explanation:
- From the three sections inputted, the project requires 12 paint cans 
  (one for each fence plank)
- There were 0 leftovers since a single box contains 12 paint cans
- The cost was 14.95 since a single box sells for 14.95

Sample Input 2:
FFFFF
FFFF
FFFFF

Sample Output 1:
14.0
10.0
29.9

Explanation:
- There were 14 paint cans needed in total
- To paint 14 planks, 2 boxes were purchased
- There were 10 paint cans leftover from having 24 cans.
- Two boxes cost $29.9
```
