First Program

Posts 1627 of 27 · Page 2 of 2
Next time use

using namespace std, please :*

But congratz.
Quote Originally Posted by SuicidalCupcake View Post
Do you really need the std::?

Quote Originally Posted by K00ky View Post
Next time use

using namespace std, please :*

But congratz.
Pretty sure this is bad practice.
Quote Originally Posted by D3v17Dy7 View Post
Pretty sure this is bad practice.
It is, that never stopped a beginner from using it though :\
Quote Originally Posted by Hell_Demon View Post
It is, that never stopped a beginner from using it though :\
Yeah I used it when I was a beginner, I'm complaining that people are trying to tell someone not using it to use it.
Quote Originally Posted by D3v17Dy7 View Post
Pretty sure this is bad practice.
?

he didn't use using namespace std so he has to use std::, otherwise he'd get an undeclared identifier error c2065 I believe.
Quote Originally Posted by Astralblack View Post
Hello all just wrote a basic program that's main purpose is too take in information for said account and display it back to you.

Code:
#include <iostream>
#include <windows.h>
#include <stdio.h>
#include <string>

class Account 
{

    public:
    std::string name, pin;

    void Register()
    {
        std::cout << "Please enter you're name: " << std::endl << std::endl;
        std::getline(std::cin, name);
        std::cout << "Please enter a pin: " << std::endl;
        std::getline(std::cin, pin);
        system("cls");
        std::cout << "Thank you for registering  " << name << std::endl;
        Sleep(2000);
        std::cout << "Please wait a moment while we take you to you're account " << std::endl;
        Sleep(7000);
	Login();
    }

    void Login()
    {
        std::cout << "Account information: " << std::endl << std::endl;
		std::cout << "Name : " << name << std::endl;
		std::cout << "Pin  : " << pin << std::endl;
        Sleep(3000);
		std::cout << "Thank you for testing this system" << std::endl;
		std::cout << "goodbye " << std::endl;
		Sleep(1000);

    }

};

int main()
{
    std::cout << "Hello welcome!" << std::endl << std::endl;
    Account accountobject;
    accountobject.Register();

    return 0;
}
Nice. I made a similar program for my Intro to Programming class. Only difference was that it was in VB. I have the file somewhere and will try to remember to post it here for ya so that you could take a few things from it. For example, I made a form/screen where it had 2 text fields (Username, Password) and a (Login) button. When password was entered, it replaced the characters with dots. I stopped working on it, but I was going to add a storing feature to it, where the user would be able to click Remember Me and not input everything again. Also was working on making the thing more secure, since you could easily extract the username/password from it at the time. lol
Nice Work! Keep Going!
Is this your first program?
Pretty neat,Nice work
Looks good for your first program.
Posts 1627 of 27 · Page 2 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?