Lightbulb[Proof]I am learning C++

Posts 1–15 of 47 · Page 1 of 4
[Proof]I am learning C++
Hey guys, when I first started wanting to make hacks, I was told to learn C++.
Some of you don't believe it until you see it, and even though you see what my sig says, alot of people lie.
So, using the LOW amount of knowledge I have of C++ so far, I wrote a simple program that calculates my percentages that I update my sig with. That and another reason I made it, is to make it easier on me.
So I have to do less steps to calculate it.

All I have to do on it is type in the amount of pages I have read so far, and it automatically calculates the percentages for me.

Of course, I plan to make it alot more complex and everything, the more I learn but this took me 3 mins to write up. I thought of it about 20 mins ago while I was smoking a cigg.

Don't flame me, I am learning.

[PHP]
// Credits: D-Vid aka Illusionz
#include <iostream>

int main()
{
using namespace std;
float CppPrimer;
float total;
int pages;

cout << "Enter the total amount of pages that you've read so far: \n\n";
cin >> pages;
cout << endl;
CppPrimer = 1225;
total = 2501;
cout << "Percentage outta the C++ Primer Plus: 5th Edition: " << pages / CppPrimer * 100 << "%" << endl;
cout << "Percentage TOTAL outta all the books: " << pages / total * 100 << "%" << endl;
}
[/PHP]
Very nice, but you have a long way to go before you start making menus and hacks, and especially inventing new ones.

Good luck to you
Someone reading a book...Its the apocalypse!!!!!


Jk. Good Job to you.
Quote Originally Posted by whatup777 View Post
Someone reading a book...Its the apocalypse!!!!!


Jk. Good Job to you.
Lolz. I know what you mean.
Most people aren't very determined.

I am.

I am determined to learn C++ as a language, so I can make stuff that I can use for ANYTHING.
Not just for hacks.

Now, I know that's what my inspiration WAS to start this determination, but my inspiration changed now.

But ANYWAYS, I figured I would release that code, since it's proof that I AM in fact learning SOMETHING, cuz I wrote that all on my own.
Nice job i guess. i didnt read a c++ book. But im going to start soon.
Write me an RPG bich
Quote Originally Posted by Crash View Post
Write me an RPG bich
RPG??
Could you please explain yourself a little more, and a little bit more sophisticated? lolz.
Quote Originally Posted by DBag4Life69 View Post


RPG??
Could you please explain yourself a little more, and a little bit more sophisticated? lolz.
Text RPG. I don't care if it's only text or an RPG where the scenery is made of text.
Quote Originally Posted by Crash View Post
Text RPG. I don't care if it's only text or an RPG where the scenery is made of text.
Soo... Yer saying you basically want me to write a program that prints out IN text, a picture of an RPG(as in a rocket launcher)?

OR

You want me to write a program that is like a console based, text based RolePlayingGame?
Quote Originally Posted by DBag4Life69 View Post


Soo... Yer saying you basically want me to write a program that prints out IN text, a picture of an RPG(as in a rocket launcher)?

OR

You want me to write a program that is like a console based, text based RolePlayingGame?
Example of choice 1 :

Code:
Blah has attacked !
Blah has done 5 damage !
....
...

OR :

Code:
@@@@@@@@@@@@@@@@@@@@@@@
@_____________________@
@_____________________@
@_________O___________@
@_____________________@
@_____________________@
@@@@@@@@@@@@@@@@@@@@@@@

Arrow keys to move...
dont use int main(){} unless you use return(0); at the end like so

Code:
int main(){
//code
return(0);
}
instead use this style
Code:
void main(){
//code
}
it will drop out some errors you get later in longer programs

but with the int main your usen main as a function not a procedure
so with out the return you can get a unexpected end of program error
with the void your making a procedure not a function

the big difference is functions return a value
procedures dont, they do something and most of the time call functions
Quote Originally Posted by tahha View Post
dont use int main(){} unless you use return(0); at the end like so

Code:
int main(){
//code
return(0);
}
instead use this style
Code:
void main(){
//code
}
Definitely not, you NEVER use void main();
Quote Originally Posted by tahha View Post
dont use int main(){} unless you use return(0); at the end like so

Code:
int main(){
//code
return(0);
}
instead use this style
Code:
void main(){
//code
}
it will drop out some errors you get later in longer programs

but with the int main your usen main as a function not a procedure
so with out the return you can get a unexpected end of program error
with the void your making a procedure not a function

the big difference is functions return a value
procedures dont, they do something and most of the time call functions

so for this you could do

Code:
// Credits: D-Vid aka Illusionz
#include <iostream>
const int CppPrimer = 1225;
const int total = 2501;

int calcuCPPP(p){
    return(p / CppPrimer * 100);
}
int calcutotal(p){
    return(pages / total * 100);
}

void main(){
    using namespace std;
    int pages;

    cout << "Enter the total amount of pages that you've read so far: \n\n";
    cin >> pages;
    cout << endl;

    cout << "Percentage outta the C++ Primer Plus: 5th Edition: " << calcuCPPP(pages) << "%" << endl;
    cout << "Percentage TOTAL outta all the books: " << calcutotal(pages) << "%" << endl;
}
There's a big problem there with how you re-wrote that. :-|
p hasn't been defined, and pages is also not defined. I know HOW to do that, but no matter what, your code there WILL not work, unless you change a couple of things. ;-)
dang ive been loookking everyyyy wwweeerrreee on how to put the codes in and were and stuff i cant find out lolol
You need to pause it at the end so you can read what it says.
/
Posts 1–15 of 47 · Page 1 of 4

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us