Welcome, Guest

Author Topic: I'm learning C++  (Read 3231 times)

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
I'm learning C++
« on: February 09, 2011, 04:15:10 PM »
yes

I made a Celcius to Fahrenheit converter last night.

Code::Blocks ftw

(adapted from "C++ For Dummies" (2009))
Code: [Select]
//
//Conversion - Program to convert temperature
// Celsius to Fahrenheit
//
#include <cstdio>

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int nNumberofArgs, char* pszArgs[])
{
    //enter the temp in Celsius
    int celsius;
    cout << "Enter the temperature in Celcius:";
    cin >> celsius;

    //calculate the conversion factor for Celsius
    // to Fahrenheit
    int factor;
    factor = 212 - 32;

    // use conversion factor to convert C to F values
    int fahrenheit;
    fahrenheit = factor * celsius/100 + 32;

    // output results
    cout << "Fahrenheit value is... ";
    cout << fahrenheit << endl;

    //wait until user is ready before terminating program to allow user to see output results
    system("PAUSE");
    return 0;

My Geometry teacher also takes us to the lab to do Java coding. We're making applets and stuff. So...

deoxy99

  • Universe Sandbox 1 Beta Team
  • *****
  • Posts: 872
  • ✨ the name's verb ✨
Re: I'm learning C++
« Reply #1 on: February 09, 2011, 04:46:36 PM »
Are you in College? That's when I'll understand C++ and Java.

Also, how did you get it to work?

Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: I'm learning C++
« Reply #2 on: February 09, 2011, 04:51:36 PM »
wow nue went from 13 to 18? wtheck

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: I'm learning C++
« Reply #3 on: February 09, 2011, 04:53:43 PM »
lol Darvince

deoxy, C++ is a "low-level" programming language. Alot like Perl and Ruby.

Use the GCC compiler on Code::Blocks... idk how I got it to work. I'm using an old version, cause it came in a CD with the book.

deoxy99

  • Universe Sandbox 1 Beta Team
  • *****
  • Posts: 872
  • ✨ the name's verb ✨
Re: I'm learning C++
« Reply #4 on: February 09, 2011, 04:54:23 PM »
wow nue went from 13 to 18? wtheck
Some people go to college when they are 14 or 13. Seriously, it happens.

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: I'm learning C++
« Reply #5 on: February 09, 2011, 04:56:06 PM »
I just can't find the exe files... boohoo

I can run them in Code::Blocks... I can't add tehm here... let alone find them on my computer.

Naru523

  • Universe Sandbox 1 Beta Team
  • *****
  • Posts: 1295
  • let's walk the true path of life
Re: I'm learning C++
« Reply #6 on: February 09, 2011, 05:11:38 PM »
Some people go to college when they are 14 or 13. Seriously, it happens.
Or under. It also happens backward.

and...
cool awesome story bro.

deoxy99

  • Universe Sandbox 1 Beta Team
  • *****
  • Posts: 872
  • ✨ the name's verb ✨
Re: I'm learning C++
« Reply #7 on: February 09, 2011, 05:31:37 PM »
Some people go to college when they are 14 or 13. Seriously, it happens.
Or under. It also happens backward.

and...
cool awesome story bro.
No, it rarely ever goes under 12, so not all the way under that age.

Naru523

  • Universe Sandbox 1 Beta Team
  • *****
  • Posts: 1295
  • let's walk the true path of life
Re: I'm learning C++
« Reply #8 on: February 09, 2011, 05:45:01 PM »
But it still happens.

deoxy99

  • Universe Sandbox 1 Beta Team
  • *****
  • Posts: 872
  • ✨ the name's verb ✨
Re: I'm learning C++
« Reply #9 on: February 09, 2011, 05:54:09 PM »
But it still happens.
Not like 1 - 9.