Post: My first command prompt program [no viruses]
12-27-2010, 07:11 PM #1
Girby2K11
☮ ☯ ☢ ✔ ➝
(adsbygoogle = window.adsbygoogle || []).push({}); hey i am currently studying C++ can people give me some links what you learnt from thanks..... but anyway here is my program can you post a comment if you think it is good Smile also it is my first command prompt program.....

it includes: a calculator which i add your * sum up by 8 then divide it by 5....... has a lot of text.

and a age teller for getting a girlfriend like if you put your age as 23 it will say 18 <----- that is the age you have to get a girlfriend at no younger and if you put a different age if wont be 18 it would be something else Smile

You must login or register to view this content.
(adsbygoogle = window.adsbygoogle || []).push({});
01-11-2011, 02:16 PM #2
Default Avatar
skab
Guest
Nice work man will check it out.
01-12-2011, 07:14 PM #3
Girby2K11
☮ ☯ ☢ ✔ ➝
Originally posted by skab View Post
Nice work man will check it out.


thnx :bro:
01-21-2011, 09:05 AM #4
Broke it with in 5 seconds Happy, do you want some input validation functions?

---------- Post added at 04:05 AM ---------- Previous post was at 04:01 AM ----------

Originally posted by Girby2K11 View Post
hey i am currently studying C++ can people give me some links what you learnt from thanks..... but anyway here is my program can you post a comment if you think it is good Smile also it is my first command prompt program.....

it includes: a calculator which i add your * sum up by 8 then divide it by 5....... has a lot of text.

and a age teller for getting a girlfriend like if you put your age as 23 it will say 18 <----- that is the age you have to get a girlfriend at no younger and if you put a different age if wont be 18 it would be something else Smile

You must login or register to view this content.


this is a program i wrote You must login or register to view this content.

Basically to make sure the user does not axidently enter a character to a number input and the program breaks, you use this (it is inside a for(;Winky Winky loop, so the continue, refreshes menu.

getline(cin,input);

if(input.length()==0) //if string length is 0
continue;
//if user enters nothing (just pressed enter by mistake)

if(numberval(input)) //numberval checks if string is a valid number
{
side_a=atoi(input.c_str()); //side_a (int), atoi is a c function that converts string to number, the string we are using is a C++ string so we use .c_str() to convert it to a c string to use in a c function.
break;
}
else
{
invalid(); //must have a invalid function or just cout a message
continue;
}

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo