User forums > General (but related to Code::Blocks)

Welcome Newcomers - PLEASE READ!!!

<< < (178/352) > >>

Jose Martins:
I'm here, I'm new in code:blocks

I come for the (good old) fortran team... :D

ahsten84:
I am new, I am here

Melchior:
better late then never!
I know some C from college (2001-2002), and a bit of C++
I have my own Console program, temperature converter program which originally began as a class assignment in either CS 140 or CS185,
I can't recall if a temperature converter was the assignment and I merely choose the way to write it myself ( I use switches),
or i choose to do a temperature converter....

since then I have worked on a number of times, and as of December 2012 or so... I completed it
i.e. it converts Fahrenheit, Celsius, and Kelvin back and forth


--- Code: --- cout << "Please select how You would like to convert.\n"            /* Prompts user to make a selection */
<< "Enter the # 1, to convert Fahrenheit to Celsius.\n"    /* Prompts user with an option. */
<< "Enter the # 2, to convert Celsius    to Fahrenheit.\n" /* Prompts user with an option. */
<< "Enter the # 3, to convert Fahrenheit to Kelvin.\n"     /* Prompts user with an option. */
<< "Enter the # 4, to convert Celsius    to Kelvin.\n"     /* Prompts user with an option. */
<< "Enter the # 5, to convert Kelvin     to Fahrenheit.\n" /* Prompts user with an option. */
<< "Enter the # 6, to convert Kelvin     to Celsius.\n"    /* Prompts user with an option. */
<< "Enter the # 9, to end the program right now.\n"        /* Prompts user with an option. */
<< endl;             /* Prints new line, and clears cout buffer. */

--- End code ---

after completing it I converted it to C++ which really wasn't that hard.. ^_^
and added validation checks to prevent crashing or INFINITE loops

--- Code: --- do
{
cout << "Please enter your selection now."   /* Prompts for the user's selection.        */
<< endl;                            /* Prints new line, and clears cout buffer. */
cin.clear();                                 /* Clears input buffer, to avoid garbage.   */
cin  >> check;                               /* Gets user's input from the keyboard.     */
cin.ignore();                                /* Ignores return key stroke.               */
cout << endl;                                /* Prints new line, and clears cout buffer. */

if(cin == NULL)   /* Validation of Input buffer, IS NOT NULL. */
{
cout << "\nERROR:\n"
<< "DO NOT ENTER ANY THING OTHER THEN A NUMBER FROM 1 to 6 or 9,\n"
<< "OR THE PROGRAM COULD GO NUTZ...\n"
<< endl;

cin.clear();  /* Clears input buffer to avoid NULL loops. */
cin.ignore(); /* Ignores return key stroke.               */
}

}while( (check<1) || (check>6) && !(check==9) ); /* Input selection Validation of check.          */

if(check == 9) end();                            /* If the User's input is 0, calls end function. */

--- End code ---

I am here mainly to bug report when/if i run into anything...

CutNGlass:
Hi,

I am new, I am Here, I  am a "REAL Person".

Would like to mention that you may want to update the "correct answer" for the registration question regarding the next year to be 2016, rather than 2015.  Even though I am still writing 2014  :o

Thank you very much for Code::Blocks.

Attanasso:
I am New, I am Here, I  am a "REAL Person" , ask my Dog , He'll vouch for Me !! I , too , had to Go Back In Time to Register ... Even though it is 2015 in this quadrant of the MWG , I had to shift into an alternate universe to write the incorrect year in order to register ... already I'm lying just to be accepted by a bunch of people I don't even know !?!?!? Boy , the more I think about it the more apprehensive I become about all this ... What kind of group have I become a part of ? Help Me ...... my brains won't compile .... " Daisy , Daisy , give Me your answer do , I'm half crazzzzy ...... ( phhffft ...... ) {} ...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version