# How To Program

The steps in programming are as follows:

- Identify variables. Always use variable names from the problem description.
- Identify data types used.
- Create two examples of input values and the expected output.
- Solve one simple problem at a time.
- Try your two examples to test for correctness.

This test covers Steps One and Two.

**A car salesman is paid a commission of 3% of the sales price of a car.**
List the variables.

What are the input variables?

What are the data types of the variables?

**Read an hour value in military time and a minute value.
Output an am/pm value. Example 13 42 == 1:42pm**
List the variables.

What are the input variables?

What are the data types of the variables?

**Read a temperature value in Centigrade and output the Fahrenheit equivalent.
The formula is Fahrenheit=Centigrade x 9/5 + 32**
List the variables.

What are the input variables?

What are the data types of the variables?

**Read a month name and print the number of days in that month.**
List the variables.

What are the input variables?

What are the data types of the variables?

**Read a month, day, and year number then print the date.
For example, 7 12 2003 would output July 12 2003**
List the variables.

What are the input variables?

What are the data types of the variables?

**Read two numbers and check if the first is a factor of the second.
For example, 6 12 would output True; 3 7 False; 12 6 False**
List the variables.

What are the input variables?

What are the data types of the variables?

**Read the lengths of two sides of a right triangle.
Output the length of the hypotenuse as the square root of the sum of the squares of the other two sides.**
List the variables.

What are the input variables?

What are the data types of the variables?

**Read a purchase price (less than $10 and a multiple of 25 cents) and assume the customer pays with a $10 bill.
Make change with only $1 and quarters. For example, 7.75 would output $2 1 quarters**
List the variables.

What are the input variables?

What are the data types of the variables?