Hello everyone, i am new here.

I am taking a class inro to programing in C. I have to do this program, and i have no idea what it asks me to do. I am very lost in the class there fore i do not understand what i have to do. I am not asking anyone to do the assignment for me, but to put it in simple words that i can understand. The assignments is as follows.

In this assignment you will implement a program called celsius2.c (see sample_celsius2.c file below) that uses several functions, get_input, output, and determine_c. You must use get_input to read the Fahrenheit degrees and return the value that was read to a variable in main. Then you will call determine_c with the value returned from get_input as an actual argument, and return the value you calculated for degrees Celsius. Then you will pass this value to the function output to print the value calculated for degrees Celsius. You will invoke all the functions from the main program.

ANy help will be greatly appreciated. Thank you all.

2. Well, I guess there are a few things you need to know to write this program. You need to understand some programming concepts, such as functions. You need to know how to pass variables between functions, and indeed how to read numbers from the user in the first place.

You also need to know the algorithm (formula, whatever) to convert Fahrenheit into Celsius.

I'd start with a simple program to read in a number and print it out. Then convert the number into Celsius before printing it out. Then you could separate it into functions. Or you could do it the other way around and create the functions right off the bat.

I guess the first step would be reading about functions, if you're not very familiar with C.

3. Yea i mean, i know like the simple stuff, printf , scanf, double, int, all that simple stuff. I also know how to write the formula. We already did the simple program that converts Fahrenheit to Celsius, now this is the second, we are supposed to use prototypes.

The thing that throws me off is the get_input, output, calculate_c. are those actual functions. or user defined stuff?

4. They're used-defined. You make up those functions.

Here's a short tutorial about them: http://www.cprogramming.com/tutorial/c/lesson4.html

Here's an example of a function . . . .
Code:
```#include <stdio.h>

/* this is the prototype of a function */
int square(int x);

int main() {
int r = square(3);
printf("3 squared is &#37;i\n", r);
return 0;
}

int square(int x) {
int s = x * x;
return s;
}```
Basically, a function has several parts.
Code:
```<return-type> <function-name>(<parameters>) {
<code>
<return-statement>
}```
The return type is what the caller of the function will receive. For example, if this was int, the caller could go
Code:
`int x = function();`
The value returned from a function is specified by a return statement, like so:
Code:
```int function(void) {
return 3;
}```
If the return type is "void", the function doesn't return anything and you use use
Code:
`return;`
or leave out the return statement entirely.

The parameters are a comma-separated list of variables that are passed into the function -- data from the original caller function. For example:
Code:
```#include <stdio.h>

int main() {
return 0;
}

void add(int x, int y) {
printf("%i\n", x + y);
}```
If a function doesn't pass any parameters, you can use "void" for the parameter list.

Anyway -- for a much clearer explanation, check out the nearest C book . . . .

5. Hey thanks alot man, i really appreciate it. This will help me alot.

6. hello again i have read he turorials, and some of my book. Just when i thinki get it , when it comes to the actuall coding i loose it al over again. This is ike the "skeleton of the program".. if anyone can take a look at it and help me out. ***Im not asking anyone to do the programfor me, just a little further assitace** Thank you!

Code:
```#include <stdio.h>

/*********Prototype go here******

double get_input();

double calculate_c(double);

void output(double);

******************************/

/**********implement function here**************

double get_input( )

{

/** get the degrees Fahrenheit temperature from the user   using a scanf statement.

Prompt the user with something like this:

Enter the degrees Fahrenheit:               **/

}

double calcuate_c(double fahrenheit)

{

/** calculate the degrees Celsius from the degrees Fahrenheit using the following formula:

celsius = 5/9 ( Fahrenheit –32).                                                                             **/

}

void output(double celcuis)

{

/** Print you results to the screen in the following format :

Degrees Celsius = what was computed in the program                                    **/

}

***************************************/

int main()

{

/************Declare variables here  **********/

double Fahrenheit;              /* temperature in degrees Fahrenheit     */

/***invoke get_input  ***/

/**invoke calculate_c ***/

/** Print you results to the screen in the following format :

Degrees Fahrenheit  = whatever the user entered

**/

/***invoke output  ****/

return 0;

}```

7. Code:
```#include <stdio.h>

/*********Prototype go here******

double get_input();

double calculate_c(double);

void output(double);

******************************/

/**********implement function here**************

double get_input( )

{

/** Declare a variable of type double to hold the input from the user **/
/** Use printf to output "Enter the degrees Fahrenheit:"**/
/** Then use scanf to get the input and save it to the variable **/
/** Return the variable **/

}

double calcuate_c(double fahrenheit)

{

/** Declare a variable called 'celsius' of type double **/

celsius = 5/9 * ( fahrenheit –32);

/** Return celsius **/

}

void output(double celcius)

{

/** Use printf to output "Degrees Celsius =", and then the variable celsius **/

}

***************************************/

int main()

{

/************Declare variables here  **********/

double Fahrenheit;              /* temperature in degrees Fahrenheit     */

/** You would probably need a variable to hold the celsius value aswell? **/

/***invoke get_input  ***/

/**invoke calculate_c ***/

/ ** Again, use printf for this **/
/** Print you results to the screen in the following format :

Degrees Fahrenheit  = whatever the user entered

**/

/***invoke output  ****/

return 0;

}```

You are definetly on the right track, i've added the steps you need to complete the program. You said you knew how to use printf and scanf, so it should be a breeze from now on...

Oh, and i've fixed some of the variable names that was in the program for you, remember, C is case-sensitive. So Celsius and celsius is not the same...