at 64 why are you using depth when you have the param celsius_temp?
and at 71 why use the celsius_at_depth function when you have the param for input and use it in line 79 as the input?
When you create a function with a param, you want to use the param you made for it.
When doing top down design, the point is that you connect the functions properly.
For example this is the top down design of 3 depth i get from this
1 2 3 4 5 6 7 8 9 10 11 12 13
|
*Say what the temperature at the depth is
1. Get the depth form the user
1. Tell the user what the program does
2. Get input from the user on the top down design
2. Calculate what the temperature at the depth is
1. Find the temperature in celsius
2. Find the temperature in fahrenheit
3. Tell the user the temperature
1. Tell the user what they originally input
2. Tell the user the calculated temperatures
4. Repeat if the user wants to know another temperature
1. Find out if user wants to repeat
2. If they wan to repeat, then repeat
| |
This shows that I want 4 things happening in main at least, with those 4 things each doing 2 other things. Some of these 4 may be functions (calculate and tell), some may be built in commands (repeat = while). But you need to figure out how to connect them properly.
Sorry if I come off as an a**-hole, but I want to help you out by helping you think about this better (you did a good job so far with those functions, just think more about what they are doing when you code them).