Click here to Skip to main content
15,907,687 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCan I add picture with SetBitmap function ? Pin
Alexej23-Feb-03 8:08
Alexej23-Feb-03 8:08 
AnswerRe: Can I add picture with SetBitmap function ? Pin
MAAK23-Feb-03 9:10
MAAK23-Feb-03 9:10 
Generalwhich function is in the middle of ... Pin
includeh1023-Feb-03 8:06
includeh1023-Feb-03 8:06 
GeneralRe: which function is in the middle of ... Pin
Stephane Rodriguez.23-Feb-03 9:32
Stephane Rodriguez.23-Feb-03 9:32 
GeneralCDROM manage Pin
Anonymous23-Feb-03 6:20
Anonymous23-Feb-03 6:20 
GeneralPlease Help! c++ newbie Pin
Pete Forster23-Feb-03 5:30
sussPete Forster23-Feb-03 5:30 
GeneralRe: Please Help! c++ newbie Pin
valikac23-Feb-03 7:46
valikac23-Feb-03 7:46 
GeneralRe: Please Help! c++ newbie Pin
Pete Forster23-Feb-03 9:01
sussPete Forster23-Feb-03 9:01 
Well unfortunatly i don't really know enough about C++ (and programming genrally) to ask any specific questions

i'll paste the code here (bearing in mind how new i am to this so it's very basic and untidy) - any tips anyone could give me would be greatly apprieciated

Cheers

}
<br />
<br />
/***********************<br />
* Program: Coursework  *<br />
* Author: Pete Forster *<br />
* Date 23/02/03        *<br />
* ATM                  *<br />
************************/<br />
<br />
<br />
#include<iostream> //IO Library Mandatory<br />
#include<stdlib.h> //Standard Library for DOS commands Mandatory<br />
//#include<string> //Includes String library<br />
using namespace std; //For object orientation Mandatory<br />
<br />
int main() //Main Function Mandatory<br />
{<br />
 //variables<br />
	int pin =1234;<br />
    int reg =0;<br />
    int wrongpin =0;<br />
    int mmchoice =0;<br />
    int withdraw =0;<br />
    int money =0;<br />
    int deposit =0;<br />
<br />
   //program start<br />
     cout<<"Welcome To Petes Bank "<<endl; //welcome screen<br />
     cout<<"Press any key to continue..."<<endl;<br />
     system("pause");<br />
<br />
	cout<<"Do you wish to register with us? "<<endl; //user prompt<br />
	cout<<"1 - Yes"<<endl;<br />
	cout<<"2 - No"<<endl;<br />
 	cin>>reg;<br />
    system("pause");<br />
<br />
	while ((reg !=1) && (reg !=2))<br />
	{	<br />
		cout<<"Error please retry"<<endl;<br />
        cout<<"Press Any Key"<<endl;<br />
    system("pause");<br />
    cout<<"Do you wish to register with us? "<<endl; //user prompt<br />
	cout<<"1 - Yes"<<endl;<br />
	cout<<"2 - No"<<endl;<br />
 	cin>>reg; //input reg variable<br />
	}<br />
	<br />
 if (reg==1)<br />
	{<br />
        cout<<"How Much do you have in your acount"<<endl;<br />
        cin>>money;<br />
<br />
		cout<<"Your Pin is 1234"<<endl;      //tells user what their pin number is<br />
  system("pause");<br />
  system("cls");    //clears screen<br />
<br />
        cout<<"Please enter pin"<<endl;<br />
        cin>>pin;<br />
<br />
        while ((pin !=1234) && (wrongpin !=3));<br />
	{	<br />
        wrongpin = wrongpin+1;<br />
		cout<<"Error Wrong Pin"<<endl;<br />
               cout<<"Please enter pin"<<endl;<br />
               cin>>pin;<br />
<br />
	}<br />
    else if ((pin==1234) && (wrongpin !=3));<br />
	{<br />
		cout<<"Welcome to the Main menu"<<endl;<br />
		cout<<endl;<br />
        cout<<"/t /t Please Select from the following options"<<endl;<br />
        cout<<endl;<br />
        cout<<"1 - Withdraw Cash"<<endl;<br />
        cout<<"2 - Deposit Cash"<<endl;<br />
        cout<<"3 - Request Overdraft"<<endl;<br />
        cout<<"4 - Quit"<<endl;<br />
        cin>>mmchoice;<br />
<br />
        while ((mmchoice !=1) && (mmchoice !=2) && (mmchoice !=3) && mmchoice !=4)<br />
	{	<br />
		cout<<"Error please retry"<<endl;<br />
        cout<<"Press Any Key"<<endl;<br />
    system("pause");<br />
    cout<<"Welcome to the Main menu"<<endl;<br />
		cout<<endl;<br />
        cout<<"/t /t Please Select from the following options"<<endl;<br />
        cout<<endl;<br />
        cout<<"1 - Withdraw Cash"<<endl;<br />
        cout<<"2 - Deposit Cash"<<endl;<br />
        cout<<"3 - Request Overdraft"<<endl;<br />
        cout<<"4 - Quit"<<endl;<br />
        cin>>mmchoice;<br />
	}<br />
<br />
  else if (mmchoice = 1);<br />
	{<br />
      cout<<"How much would you like to withdraw?"<<endl;<br />
      cin>>withdraw;<br />
      system("cls");<br />
      money = money - withdraw<br />
      cout<<"Please take your "<<withdraw<<" Pounds"<<endl;<br />
      cout<<"Your Balance is "<<money<<" Pounds"<<endl;<br />
      system("pause");<br />
<br />
      return 0;<br />
}<br />
  else if (mmchoice = 2);<br />
  {<br />
      cout<<"How much would you like to Deposit?"<<endl;<br />
      cin>>deposit;<br />
      system("cls")<br />
      money = money + deposit<br />
      cout<<"Your Balance is "<<money<<" Pounds"<<endl;<br />
      system("pause");<br />
<br />
      return 0;<br />
}<br />
 else if (mmchoice = 3)<br />
 {<br />
 if (money >500)<br />
 cout<<"Your overdraft has been approved!"<<endl;<br />
<br />
 system("pause");<br />
<br />
 return 0;<br />
<br />
 if ((money <=500) && (money >250));<br />
 cout<<"Please contact your branch"<br />
  system("pause")<br />
<br />
 return 0;<br />
<br />
 if (money <=250);<br />
 cout<<"Sorry you cannot have an overdraft"<br />
  system("pause")<br />
<br />
 return 0;<br />
}<br />
<br />
 else if (mmchoice = 4);<br />
  {<br />
      cout<<"thankyou for using Pete's bank"<br />
      system("pause")<br />
<br />
      return 0;<br />
}<br />
<br />
<br />
}<br />
    else if ((pin!=1234) && (wrongpin ==3))<br />
	{<br />
      cout<<"Sorry you have Entered the wrong pin 3 times, the system will now shut down"<<endl;<br />
      system("pause");<br />
<br />
      return 0;<br />
<br />
	   }<br />
<br />
 if (reg ==2)<br />
<br />
 cout<<"goodbye"<<endl;<br />
 system("pause");<br />
<br />
      return 0;<br />
<br />

GeneralRe: Please Help! c++ newbie Pin
Christian Graus23-Feb-03 9:59
protectorChristian Graus23-Feb-03 9:59 
GeneralRe: Please Help! c++ newbie Pin
Big Art23-Feb-03 10:23
Big Art23-Feb-03 10:23 
Generalconvert CString to HEX Pin
afender23-Feb-03 3:48
afender23-Feb-03 3:48 
GeneralRe: convert CString to HEX Pin
Abin23-Feb-03 4:13
Abin23-Feb-03 4:13 
GeneralRe: convert CString to HEX Pin
Gary R. Wheeler23-Feb-03 4:42
Gary R. Wheeler23-Feb-03 4:42 
Generalcheck box Pin
dudic23-Feb-03 1:05
dudic23-Feb-03 1:05 
GeneralRe: check box Pin
Hans Ruck23-Feb-03 3:28
Hans Ruck23-Feb-03 3:28 
QuestionHow to use Microsoft Layer for Unicode with MFC app Pin
Valera24117623-Feb-03 0:03
Valera24117623-Feb-03 0:03 
AnswerRe: How to use Microsoft Layer for Unicode with MFC app Pin
dan o23-Feb-03 23:32
dan o23-Feb-03 23:32 
GeneralBitmaps again... Pin
Dennis L22-Feb-03 22:46
Dennis L22-Feb-03 22:46 
GeneralRe: Bitmaps again... Pin
Joaquín M López Muñoz23-Feb-03 5:10
Joaquín M López Muñoz23-Feb-03 5:10 
GeneralRe: Bitmaps again... Pin
MAAK23-Feb-03 9:44
MAAK23-Feb-03 9:44 
GeneralSplitting a CString Pin
ROK_RShadow22-Feb-03 21:38
ROK_RShadow22-Feb-03 21:38 
GeneralRe: Splitting a CString Pin
Pavel Klocek23-Feb-03 1:25
Pavel Klocek23-Feb-03 1:25 
GeneralRe: Splitting a CString Pin
Big Art23-Feb-03 10:48
Big Art23-Feb-03 10:48 
GeneralRe: Splitting a CString Pin
ROK_RShadow23-Feb-03 12:36
ROK_RShadow23-Feb-03 12:36 
GeneralRe: Splitting a CString Pin
Big Art24-Feb-03 5:21
Big Art24-Feb-03 5:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.