• ### What is your GameDev Story?

Public Group

#### Archived

This topic is now archived and is closed to further replies.

# A little more help......

This topic is 5825 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello again..... i have a simple question, i have the C++ for dummies book, and im working on the fist porogram it tells you to make. (im using the Dev-C++ 4 program insted of the GNU compiler that the C++ dummmies supplies). any way, what exactly is supposed to happen when i run this program?. im sorry for bothering you people with my troubles. Source code, ok. // // Program to convert temperature from Celsius degree // units into Fahrenheit degree units: // Fahrenheit = Celsius * (212 - 32)/100 +32 // #include <stdio.h> #include <iostream.h> int main(int nNumberofArgs, char* pszArgs[]) { // enter the temperature in Celsius int celsius; cout << "Enter the temperature in Celsius:"; cin >> celsius; // calculate conversion factor for Celsius // to Fahrenheit int factor; factor = 212 - 32; // use conversiot factor to convert Celsius // into Fahrenheit values int fahrenheit; fahrenheit = factor * celsuis/100 + 32; // output the results cout << "Fahrenheit value is :"; cout << fahrenheit; return 0: } _________________________________________________________________ thats the sorce code, Right? is there something im doing wrong? Thank you for you help, kind one. may the wheel turn in your favor. P.S. im not sure if im asking the right question for the answer im looking for..... what is supposed to happen when you run the program. [edited by - Mindless Thrall on February 7, 2003 1:39:58 PM]

##### Share on other sites
I''m not sure because I don''t have the book, but if you post the source code we will be able to help you.

:::: Lektrix ::::
[ Google || ACCU || BarrysWorld || E-Mail Me ]

##### Share on other sites
probably a console window with the words "Hello World"

##### Share on other sites
Do you know anything about how to turn this source code into machine code, i.e. compiling? Just compile it and run it in MS-DOS. Incidently, it doesn't seem to resemble much of a typical first program, and also includes errors. Are you sure that you have posted the correct source code?

:::: Lektrix ::::
[ Google || ACCU || BarrysWorld || E-Mail Me ]

[edited by - Lektrix on February 7, 2003 4:30:04 PM]

##### Share on other sites
quote:
Original post by Lektrix
Do you know anything about how to turn this source code into machine code, i.e. compiling? Just compile it and run it in MS-DOS. Incidently, it doesn't seem to resemble much of a typical first program, and also includes errors. Are you sure that you have posted the correct source code?

I have that book and it is loaded with errors. The author "can't find no main function."

[edited by - evil sausage on February 7, 2003 4:50:12 PM]

##### Share on other sites
Ooooh, k, Mindless Thrall: May I suggest a new book?

:::: Lektrix ::::
[ Google || ACCU || BarrysWorld || E-Mail Me ]

##### Share on other sites
The code is pretty simple; I think I''ve seen it before. The comment at the top says it all. IT should open with a black screen and white text (ala DOS). It should then ask you to put in the temperature in celsius. It does a calculation or two and then outputs the value of the same temperature in degrees farenheit.

##### Share on other sites
all spelling and syntax errors aside...

quote:

factor = 212 - 32;

Why?

##### Share on other sites
I noticed that too, and thought "why?" as well. However, it is kind of smart in some ways. At least you have an idea of what it is. If I just wrote "int factor = 180;", I am more likely to forget what it is. Then again, what are comments for?

That''s my interpretation, anyway :D

Peon

##### Share on other sites
It''sa a program to convert celsius to Fahrenheit. Unless you run it under DOS, that program will exit straight after it says the output value. You should add getch() or system("pause") before the return 0;

Yo Tyler, I hear your mum''s goin out with... SQUEEK!

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 27
• 16
• 10
• 10
• 11
• ### Forum Statistics

• Total Topics
634101
• Total Posts
3015528
×