Subscribe to CecilMan Want's To Code: A Journey        RSS Feed
-----

Registering.

Icon Leave Comment
Okay so I was playing with strings and arrays and wanted to see if I could make a mock registration screen :D

Half way there, I can take the user's name and a mock date of birth (stored as a string, not actually date data that will come next)
I was having trouble with a y/n option but in the end decided to use an array and cleaned up the if statements.

void Yn()
{
     char yesno[] = {'y','Y','n','N'};
     char c;
     cin>>c;
     if(c==yesno[0] || c==yesno[1])
     {
                 cout<<endl<<endl<<"Thank you for registering your details.";
                 }
                 else if(c==yesno[2] || c==yesno[3])
                 {          
                 cout<<endl<<endl<<"Please re-enter your details."<<endl;
                 system("CLS");
                 Register();
                 }
                 else
                 {
                     cout<<endl<<endl<<"Please use either y or n to make your selection."<<endl<<endl;
                     Yn();
                     }
     }


Feeling glad that it no longer always returns on the else statement, figured that I had set the if's up wrong (noob mistake) but now this is done I can look at getting the program to take actual date of birth and then look at having the name so that it inputs as first and last on the same line, (eg. Please enter your first and last name: Leslie Wessling) and have it stored as two seperate strings (eg. NameFirst and NameLast) so that they can be called later.
I want to do the same with the date of birth (eg. dd/mm/yyyy and have the day the month and the year stored separately for use in determining the users age.)

After that I want to find out how to use #include <ctime> (or a better way) to get the local date from the computer, thus able to use the date of birth and local date to determine age in years months and days (will have to look at calendars to determine which years are leaps or maybe just do that as some kind of factor of 4) and also notify the user that it is their birthday (not that they won't already know).

the next challenge I set for myself is having them insert other data such as a user name and password and have it stored to an external file, when prompted on the first screen they will choose to either login or create new user and be able to use previously entered data to login and access previously stored data. a side project for this would be to make it so that the password can be changed at any time (or even set a limit per day/week/month that it can be changed per user).

After all this I will make a series of programs that can be accessed once inside the users account: their account details, the calculator I have been working on, a calendar that they can use to set event notifications, and maybe some kind of word processor.

I think the hardest part for all this will be the data storage and login data stuff, add to that I want to make a GUI somehow to make it all work (from scratch using .pdf or bitmap images) in with input fields and buttons :)

Prepare for google-fever fingers and failing that get ready for the various questions I will no doubt be asking on the c++ forums guys! :D

Signing out, I am CecilMan.

0 Comments On This Entry

 

Trackbacks for this entry [ Trackback URL ]

There are no Trackbacks for this entry

July 2014

S M T W T F S
  12345
6789101112
13141516171819
20212223242526
27 28 293031  

Tags

    Recent Entries

    Search My Blog

    0 user(s) viewing

    0 Guests
    0 member(s)
    0 anonymous member(s)

    Categories