I have this exercise that i need some help with !!

• Write the function fahrenheit that returns the Fahrenheit equivalent (as a float value) of a temperature value in Celsius. The function has one integer parameter for the temperature in Celsius.
[Hint: Tf = (9/5)*Tc+32; Tc = temperature in degrees Celsius, Tf = temperature in degrees Fahrenheit]
• Write another function printTempratures which receives two integer arguments low and high. The function uses the function fahrenheit to print all the Fahrenheit temperatures for all the Celsius temperatures in the range between low and high.
• Your main program tests the two functions by asking the user to enter a range and printing the Fahrenheit equivalence for all the Celsius values in that range.
• The following shows a sample run.

Enter the low Celsius value: 5
Enter the high Celsius value: 9

Celsius Fahrenheit
5 41.0
6 42.8
7 44.6
8 46.4
9 48.2

and i'll be so thankful :)

Recommended Answers

All 3 Replies

So, what exactly do you need help with? I don't see any questions on your part nor do I see any code that you may need help with so I have no idea what you want from us.

Please read the following:
http://www.daniweb.com/forums/announcement8-2.html

...but we do want to help :) we just need to see that you've put in some effort.

This is...really not that hard...The first function is basically one line manipulating the variable with the calculation you were given. The second function is the exact same thing but in a loop from lower bound to higher bound.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.