Jump to content

ATM assignment

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
ahmed

ahmed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 304 posts
My teacher just gave us an ATM assignment and today was our 4 week of programming , our teacher hasnt taught us about file linking or stuff , i wanted to ask that the problem which il be having is that my teacher told us that .

"When your program starts, it should be displaying a login screen. User will be asked to enter a login and 5 digit pin code. The system verifies the login and pin and displays an error if it is incorrect
You have to create a array that holds the username and password
Enter login: example
Enter Pin code: 12345 "

I dont know how how will i save the data of a user :$ , when it will ask login or stuff ? how can it be done ? storing data in a text file and then accessing it , please help me out with that part

#2
LukeyJ

LukeyJ

    Learning Programmer

  • Members
  • PipPipPip
  • 93 posts
Does it require you to save details? What are the specification of the program?

#3
ahmed

ahmed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 304 posts
Check the attachment , I just need help on how to store login name and pin code, Rest I am half done with the menus...

Attached Files



#4
LukeyJ

LukeyJ

    Learning Programmer

  • Members
  • PipPipPip
  • 93 posts
To me it doesn't seem to ask for it to be stored to a file. Just in an array.

So, initially you're program will initiate the data into an array and be able to read from it. It's probably best to write with that assumption and if it is needed, add it in later on.

Store in an array, say of 5 items where you can search for a username.

char user [5] [15];
char pin [5] [15]; // assuming a length of 15 characters max...

So, ask for two inputs of both. Search for the first, store key, check pin with index found by first, if correct, then carry on with that user...

#5
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
At no point in the directions is there a reference to a file. You can hard-code your arrays of usernames/passwords.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#6
ahmed

ahmed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 304 posts
I didnt get the array thing sorry.. Another Problem is about the cash transfer , Though now I am done with all the menus its just the username that is making me stop -_-