Check out my prog

manzoor

New Member
Messages
430
Reaction score
0
Points
0
yO

I have made a console based program
which converts Temperatures :biggrin:

Haven't coded for almost 3 months so was just checking how much have I forgotten :drool:

here's the link
http://mihd.net/7etqyz
download and comment please :)
I will port it to GUI when I'll learn Windows programming


Any C/C++ programmers here in X10hosting ?


 

Slothie

New Member
Messages
1,429
Reaction score
0
Points
0
What's so hard about that?

Code:
#include <iostream>
 
using namespace std;
 
int main()
{
  // enter the temperature in Celsius
  int celsius;
  cout << "Enter the temperature in Celsius: ";
  cin >> celsius;
 
  int fahrenheit;
  fahrenheit = 180* celsius/100 + 32;
 

  cout << "Fahrenheit value is: " << fahrenheit << endl;
 

  char ch;
  while ( cin.get ( ch ) && ch != '\n' )
	;
 

  cout << "Press Enter to continue...";
  cin.get();
}

I didn't look at your code, btw :)
 

mattura

Member
Messages
570
Reaction score
2
Points
18
me senses a hint of sarcasm lol
PS Slothie, isn't it f=8c/5 + 32? You have 9c/5
 

bigmanbfa2

New Member
Messages
67
Reaction score
0
Points
0
I'm pretty sure it's 9c/5 + 32. actually, im 100% sure.

Also, I used to make tons of those console things back in HS.

I code in C/C++/C#. also know quite a bit of ASM. If you need some GUI stuff with C/C++, I recommend looking into the FLTK wrapper. FLTK stands for Fast Light Tool Kit, it helps a bunch when making GUI's for C/C++ programs without having to go directly through the Win32 API.

also, I agree, this is not a very challenging program, I haven't looked at your code either, but it took me less than a min to whip this one up.

Code:
#include <stdio.h>

int main()
{
  int celcius, fahrenheit;
  
  printf("Enter a celcius value: ");
  scanf("%i", &celcius);
  
  fahrenheit = ((9 * celcius)/5) + 32;
  
  printf("Fahrenheit = %i\n", fahrenheit);
  
  system("PAUSE");	
  return 0;
}
 
Last edited:

warlordste

New Member
Messages
653
Reaction score
0
Points
0
i lernt that ages ago in year 11 of high school not very imoressive but meh we have to start somewhere
 

shaunak

New Member
Messages
320
Reaction score
0
Points
0
And with MS Visual studio C#, you can make a nice graphical one in bout 15 mins! :biggrin:

Down with the console!
 
Last edited:

Sharky

Community Paragon
Community Support
Messages
4,399
Reaction score
94
Points
48
Using 8/5 is for converting between MPH and KM/h. Or just miles to km for that matter.

F = (C*1.8)+32, and 9/5 = 1.8.
 
Top