Results 1 to 8 of 8
  1. #1
    JimTheGreat's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Location
    USA
    Posts
    6,771
    Reputation
    125
    Thanks
    714
    My Mood
    Aggressive

    Exclamation A little help? C++

    ::WARNING:: LOTS OF WRITING BELOW.
    @~FALLEN~ @giniyat101 @Skrillex @tryhacker @BACKD00R @CFhackerfree @BarleyCandy @pceumel @Exsilium @Lebaa @skiddy2

    I finally gathered my thoughts and told my dad that I wanted to learn some C++. He said there are many types of "programming", like java, science, and etc. But, he just explained to me in detail today that will get me started on C++, and make me kind of realize things.
    My dad gave me a project for me to start. I need to make a simple program, he doesn't care about looks, that if I type in a degree (temperature), and when I click a button, it will convert to fahrenheit.
    My dad's at work and will NOT be coming back until tomorrow afternoon, so I will ask.

    1. What is the difference between "sub" and "function"?

    2. What is the difference between "Sub Process" and "SubRoutine"?

    3. What exactly IS iostream? Like #include <iostream>?

    4. What is #include <iosys.h> and what does that do?

    5. If I type "#include <math.h>, would the program be able to do ANY type of math? Like roots, sin cos tan, anything?

    6. For variable inputs, is this right or wrong?

    int = ONLY POSITIVE numerics. (fahrenheit)
    float= BOTH negative AND positive. (degree)
    float degree=0; (im trying to make float value (degree) nothing. Meaning, no value for degree is set as of now.)
    int farenheit=0; (im trying to make float value (degree) nothing. Meaning, no value for degree is set as of now.)

    7. What does "int main ()" do if the first statement in question 6 is right?

  2. #2
    Hero's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    memes
    Posts
    40,134
    Reputation
    4764
    Thanks
    9,674
    Since I'm learning C++ as well, all I know is <iostream> is known as a header. It is used for input and output. The i in <iostream> means input, while the o means output.

    #include Tells your program the header you are using.

    So if you do #include <iostream> - You're basically telling your program that you are using the input and output stream in your program.
    [] [] [] [][]

    Editor from 06•14•2011 • 2014
    Donator since 09•16•2011
    Minion from 10•10•2011 • 01•06•2011
    Minion+ from 01•06•2012 • 08•08•2012
    Moderator from 08•08•2012 • 10•06•2012
    Global Moderator from 10•06•2012 • 12•05•2017
    Staff Administrator from 12•05•2017 • 05•01•2019
    Trusted Member since 07•13•2019
    Global Moderator since 09•11•2020




  3. The Following User Says Thank You to Hero For This Useful Post:

    JimTheGreat (06-17-2012)

  4. #3
    JimTheGreat's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Location
    USA
    Posts
    6,771
    Reputation
    125
    Thanks
    714
    My Mood
    Aggressive
    Quote Originally Posted by Hero View Post
    Since I'm learning C++ as well, all I know is <iostream> is known as a header. It is used for input and output. The i in <iostream> means input, while the o means output.

    #include Tells your program the header you are using.

    So if you do #include <iostream> - You're basically telling your program that you are using the input and output stream in your program.
    oh okay so I NEED the #include <iostream> command for my project right? Because for input I'm using degree, and output for fahrenheit?

  5. #4
    giniyat101's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Location
    Not telling.
    Posts
    1,935
    Reputation
    130
    Thanks
    1,380
    My Mood
    Dead
    okay this is the wrong section and iam pretty sure

    1- both sub and function keywords are not defined in c++ they are probably from vb
    sub doesnt return a value (aka void) while function does

    2- i dont know really, maybe u tell me where u got this 2 words?

    3- iostream is a header files contains some functions (and subs before you say it ) which deals with the console input and output like cout and cin etc

    4- never heared about it sorry but its another header file ofc

    5- yes you may access alot of math functions there like square root , power , trigonometric functions etc

    6- int : signed 4 bytes integer, can be positive or negative

    7- float: singned 4 bytes number, can have decimal points, can be positive or negative

    8-int main():

    defines the first controlable code by the programmer, but your program routine here

    example (conversation between fahrenheit and celsius):

    Code:
    #include <iostream> //so we can use the console functions cout and cin
    using namespace std; //now u dont need to use std::cout or std::cin
    
    int main()
    {
        float tempf, tempc; //variables to keep the temperatures.. i picked float because temperaturs can be negative, and can have decimal points ofc
        cout << "enter fahrenheit temperature"; //output the message you see
        cin >> tempf; //get fahrenheit from user input
        //not sure about the converting i have almost forgot everything about last year's physics xD
        tempc = (tempf-32)/1.8; //calculate celsius value
        cout << "the temperature in celsius equals " << tempc << endl; //output the result and ends the line
        return 0;//return to windows
    }
    you may put in your compiler and press ctrl+f5 yourself
    Last edited by giniyat101; 06-17-2012 at 09:00 PM.


     



    [img]https://i43.photobucke*****m/albums/e367/DeteSting/Steam-update.gif[/img]

  6. The Following User Says Thank You to giniyat101 For This Useful Post:

    JimTheGreat (06-17-2012)

  7. #5
    JimTheGreat's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Location
    USA
    Posts
    6,771
    Reputation
    125
    Thanks
    714
    My Mood
    Aggressive
    Quote Originally Posted by giniyat101 View Post
    okay this is the wrong section and iam pretty sure

    1- both sub and function keywords are not defined in c++ they are probably from vb
    sub doesnt return a value (aka void) while function does

    2- i dont know really, maybe u tell me where u got this 2 words?

    3- iostream is a header files contains some functions (and subs before you say it ) which deals with the console input and output like cout and cin etc

    4- never heared about it sorry but its another header file ofc

    5- yes you may access alot of math functions there like square root , power , trigonometric functions etc

    6- int : signed 4 bytes integer, can be positive or negative

    7- float: singned 4 bytes number, can have decimal points, can be positive or negative

    8-int main():

    defines the first controlable code by the programmer, but your program routine here

    example (conversation between fahrenheit and celsius):

    Code:
    #include <iostream> //so we can use the console functions cout and cin
    using namespace std; //now u dont need to use std::cout or std::cin
    
    int main()
    {
        float tempf, tempc; //variables to keep the temperatures.. i picked float because temperaturs can be negative, and can have decimal points ofc
        cout << "enter fahrenheit temperature"; //output the message you see
        cin >> tempf; //get fahrenheit from user input
        //not sure about the converting i have almost forgot everything about last year's physics xD
        tempc = (tempf-32)/1.8; //calculate celsius value
        cout << "the temperature in celsius equals " << tempc << endl; //output the result and ends the line
        return 0;//return to windows
    }
    you may put in your compiler and press ctrl+f5 yourself
    hmm...my dad wrote out to me a completely different coding.

  8. #6
    giniyat101's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Location
    Not telling.
    Posts
    1,935
    Reputation
    130
    Thanks
    1,380
    My Mood
    Dead
    Quote Originally Posted by Infractured View Post

    hmm...my dad wrote out to me a completely different coding.
    whatever, thats an easy example nothing else..


     



    [img]https://i43.photobucke*****m/albums/e367/DeteSting/Steam-update.gif[/img]

  9. #7
    JimTheGreat's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Location
    USA
    Posts
    6,771
    Reputation
    125
    Thanks
    714
    My Mood
    Aggressive
    Quote Originally Posted by giniyat101 View Post
    whatever, thats an easy example nothing else..
    Alright I'll try this in my coding, and I'll open another thread if really needed.
    /req close @Hero, as of now.
    Thanks @giniyat101

  10. #8
    Hero's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    memes
    Posts
    40,134
    Reputation
    4764
    Thanks
    9,674
    Closed Upon Request.
    [] [] [] [][]

    Editor from 06•14•2011 • 2014
    Donator since 09•16•2011
    Minion from 10•10•2011 • 01•06•2011
    Minion+ from 01•06•2012 • 08•08•2012
    Moderator from 08•08•2012 • 10•06•2012
    Global Moderator from 10•06•2012 • 12•05•2017
    Staff Administrator from 12•05•2017 • 05•01•2019
    Trusted Member since 07•13•2019
    Global Moderator since 09•11•2020




  11. The Following User Says Thank You to Hero For This Useful Post:

    JimTheGreat (06-18-2012)

Similar Threads

  1. [Help Request] NEED A LITTLE HELP AGAIN ... PLS...
    By wackx26 in forum CrossFire PH Help
    Replies: 5
    Last Post: 06-10-2012, 10:11 AM
  2. [Help Request] Little help with some simple stuff
    By Nercrojuice in forum Visual Basic Programming
    Replies: 17
    Last Post: 05-31-2012, 03:11 PM
  3. [Help Request] Little help, Please.
    By GoOd_LoOk_BrOo in forum Call of Duty Modern Warfare 2 Help
    Replies: 0
    Last Post: 01-18-2012, 07:02 PM
  4. [Help Request] Little Help with KAVA
    By 24s25 in forum Alliance of Valiant Arms (AVA) Help
    Replies: 9
    Last Post: 07-11-2011, 01:16 PM
  5. [Help Request] A little help..
    By AlphaTeam in forum CrossFire Help
    Replies: 2
    Last Post: 07-08-2011, 09:16 AM