DEV C++ DIRE NEED OF HELP
Feb 4, 2017 at 3:35am UTC
Hello Guys, I know this is too much to ask for but not getting sleep for 3 days is also too much for me. We have been assigned to make a dev C++ proj but I dont have any idea about it. Please help me create a program with these basic functions
My portfolio
User 3 trials
Enter your name :
Enter your password:
Invalid user name and pass
You only have 2 trials
Do you want to try again <y/n>?
Sorry you have reached the maximum trial .
MAIN MENU
Choose the letter for each topic to view some sample programs.
Basic C++
a.Variables
b.Constants
C .Operator
D basic input/output
Control structure
E.control structures
Compound data type
F .arrays
G.exit
Please choose the letter
You choose ___
1.system color
2.sleep
3.Cls
4.Clrscr
5.exit function
any answer would be so much appreciated :( I am starting to lose hope deadline is near if anybody could help me with this it's my savior. Thank you :(
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
#include<iostream>
#include<string>
#include<stdlib.h>
#include<conio.h>
using namespace std;
int main()
{
system ("color 7" );
cout <<" **************************************************************** " <<endl;
cout <<" **************************************************************** " <<endl;
cout <<" ******************* *** **** *** ********************* " <<endl;
cout <<"*********************** ** ** **** *** *************************" <<endl;
cout <<"*********************** ** ** ******** *****************************" <<endl;
cout <<"*********************** ****** ********* ******************************" <<endl;
cout <<"*********************** ****** ********* ******************************" <<endl;
cout <<"******************************************************************************" <<endl;
cout <<"******************************************************************************" <<endl;
cout <<"******************************************************************************" <<endl;
cout <<"** ** ** ** ** ** ** ***** ** *******" <<endl;
cout <<"** ** ** ** ** ** ** ****** ** ***** ** *******" <<endl;
cout <<"** ** ** ** ******* ***** ** ** ** ***** ** ** *******" <<endl;
cout <<"** ***** ** ** ***** ***** ****** ** ***** ** *******" <<endl;
cout <<"** ***** ** **** *** ***** ****** ** ** ** *******" <<endl;
cout <<"******************************************************************************" <<endl;
cout <<"******************************************************************************" <<endl;
cout <<"******************************************************************************" <<endl;
cout <<"******************************************************************************" <<endl;
cout <<" ****************************************************************** " <<endl;
cout <<endl;
cout <<endl;
string username;
string password;
char c;
int attempts = 0;
for (int attempts = 0; attempts < 3; ++attempts )
{
START:
cout <<" User has 3 trials" <<endl;
cout <<" Enter Username: " ;
cin >>username;
cout <<" Enter Password: " ;
char pass[32];
int i = 0;
char a;
for (i=0;;)
{
a=getch();
if ((a>='a' &&a<='z' )||(a>='A' &&a<='Z' )||(a>='0' &&a<='9' ))
{
pass[i]=a;
++i;
cout<<"*" ;
}
if (a=='\b' &&i>=1)
{
cout<<"\b \b" ;
--i;
}
if (a=='\r' )
{
pass[i]='\0' ;
break ;
}
}
if (username=="1234" && password=="12345" )
{goto loop2;}
else
loop:
cout <<" Invalid input you only have 2 trials left" ;
cout <<" Do you want to try again (y/n)?" ;
cin >> c;
++attempts;
switch (c)
{
case 'Y' :
case 'y' :
goto START;
case 'N' :
case 'n' :
break ;
default :
cout <<" please choose only <Y,y> or <N,n>\n" ;
goto loop;
}
}
system("cls" );
loop2:
string answer;
cout <<" MAIN MENU\n" ;
cout <<"\nchoose the letter for each topic to view some sample program: \nBasic in c++: " ;
cout <<" \n a.variables" ;
cout <<" \n b.constant" ;
cout <<" \n c.operators" ;
cout <<" \n d.basic input/output" ;
cout <<" \n e.control structure" ;
cout <<" \n f.arrays" ;
cout <<" \n g.Exit" ;
cout <<endl;
cout <<endl;
cout <<"Please Enter the letter you choose: " ;
cin >> answer;
if (answer == "a" )
{
system("cls" );
string variable;
cout <<"VARIABLE in C++ is name for a piece of memory that can be used to store informa-tion" <<endl;
cout <<" \n a. identifier, data types, declaration, and introduction of variables" ;
cout <<" \n b. introduction of strings" ;
cout <<" \n c. go back to main menu" ;
cout <<" \n d. Exit" ;
cout <<endl;
cout <<"Please Enter the letter you choose: " ;
cin >>variable;
}
if (answer == "b" )
{
string constant;
cout <<"CONSTANT expression with a fixed value" <<endl;
system ("pause" ); }
}
}
return 0;
system ("pause" );
}
Topic archived. No new replies allowed.