Very basic program.

Posts 1–9 of 9 · Page 1 of 1
Very basic program.
This is an EXTREMELY simple program I made from C++. I'm learning C++ and the book wanted me to do this. It's not encoded or anything so feel free to pick through it.
Test.rarattachment deleted · 11 downloads before removal
This is like a hello world program here is the code to make this
Code:
#include <iostream>
using namespace std;

int main()
{
system ("TITLE www.mpgh.net");// this is for the title only if u want
system ("COLOR 2"); // this is for the color only if u want u can use color 1,2,3... 
cout << "This is a simple program made for mpgh" << endl;// or whateer ur name is and what the console say
system("pause");
return 0;
}
If u use dev c++ if u use c++ 08 ohh i'm to lazy to make a code again just copy and paste go to new -> sourece file at dev c++ and paste the code
why are u posting this simple stuff be creative make something interesting like this ive made a console game like this.

Code:


#include <iostream>

using namespace std;
double x = 0;
class V 
{
public:
	void ask ()
	{
		cout<<"Enter a numbers"<<endl;
	}

	double times (double x)
	{
		cin>>x;
	x*=x;
	cout<<x;
		return 0;
	}
	
	double print()
	{
		cout<<" is the answer after multiplying by it self"<<endl;
		return 0;
	}


};








int main()
{

V copy;

copy.ask();
copy.times(x);
copy.print();




return 0;
}
Quote Originally Posted by Matrix_NEO006 View Post
why are u posting this simple stuff be creative make something interesting like this ive made a console game like this.

Code:


#include <iostream>

using namespace std;
double x = 0;
class V 
{
public:
	void ask ()
	{
		cout<<"Enter a numbers"<<endl;
	}

	double times (double x)
	{
		cin>>x;
	x*=x;
	cout<<x;
		return 0;
	}
	
	double print()
	{
		cout<<" is the answer after multiplying by it self"<<endl;
		return 0;
	}


};








int main()
{

V copy;

copy.ask();
copy.times(x);
copy.print();




return 0;
}
Man i tell ya the code ho this dude ho make the thread used to make the test
Do u wanna a complicated thing here are :
Code:
#include <iostream>
#include <windows.h>
#include <winable.h>

using namespace std;

int main(void)
{
    string password;
    cout << "Enter your password to acces the program" << endl;
    getline (cin, password);
    
    if(password == "thecode")
    {
        string answer;
        system("CLS");
        cout << "Welcome back Grisa";
        Sleep (2000);
        cout << "\nHow have you been?\n";
        getline(cin, answer);
        
    if(answer == "bad")
    {
        cout << "Sorry to hear that.";
    }
    else
    {
        cout << "Glad to hear that!";
    }
}
else
{
    BlockInput(true);
    system("CLS");
    cout << "Incorrect passwor, now closing!";
    Sleep(3000);
    return 0;
}
system("PAUSE>nul");
return 0;
}
Here are a passworld program
Quote Originally Posted by Matrix_NEO006 View Post
why are u posting this simple stuff be creative make something interesting like this ive made a console game like this.
Oh. I'll have hours of fun typing numbers into my console
I like using classes too, but ... there are times when it just makes simple things ridiculously over complicated. This was one of those times.

And again this file worries me because it is very large... My entire D3D_2D_Base is only 40 Kb... and this is 400... wdf?
Quote Originally Posted by why06 View Post
Oh. I'll have hours of fun typing numbers into my console
I like using classes too, but ... there are times when it just makes simple things ridiculously over complicated. This was one of those times.

And again this file worries me because it is very large... My entire D3D_2D_Base is only 40 Kb... and this is 400... wdf?
Hmmm don't worry dude this is not a virus i have tested it
Come on, a virus? I'm not smart enough to do that, and I wouldn't. I love MPGH.
I didn't say it was a virus, I'm just saying its a very large file is all. And Im wondering why it is so big. How did you compile it?

There can be other reasons for a file being large. A large file does not = virus. Perhaps you included some files that you didn't need to. It would be like if I included all the libraries and functions I needed for the DirectX Im programming right now in the executable itself rather then just calling resources from within .dll's on your system. Im really just more interested in how you made it... so I can figure out what the problem is.
All I did was build it, if I am correct, (I am typing the source from memory) the code is:

#include <iostream>

using namespace std;

int main()
{
cout<<"Enter any text here.\n";
cin.get();

return 1;
}


All I did was compile it normally by pressing the hotkey to compile, (F9). It's very basic, very short coding, no idea why it is such a big file.
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?