I would make my class an empty template so I could use it over and over. Each time you use it you can initialize the values by passing parameters. The constructor should look something like this:
Make up some defs to test your classes while you are learning. Python has good error reporting built in.
In the main body of your script is where you run the tests and other functions you built into the class.
I would make my class an empty template so I could use it over and over. Each time you use it you can initialize the values by passing parameters. The constructor should look something like this:
Make up some defs to test your classes while you are learning. Python has good error reporting built in.
In the main body of your script is where you run the tests and other functions you built into the class.
okay, I have this so far:
How can I change part of this so I can test it by typing:
$ Cashregister purchase 38 = 0 0 0 2
on the command line?
You've been busy.
For something as advanced as this it would help you to no end to learn more about Python containers; dictionaries, tuples, lists, etc.
You are passing around lists of numbers here and you need to manage them as groups.
I liked this part, the rest I doctored a little.
Not bad so far. We're still a ways from running from the command line though.
Keep pluggin'.
There are people out here better qualified than me, and there's probably many different ways to do this stuff, but here's what I've come up with; based on my understanding of what you want to do. You might have to work out a few bugs. --------- Post updated at 08:18 PM ---------- Previous update was at 01:36 AM ----------
EDIT:
Found some ugly bugs.
Did some renaming because vars were getting clobbered in the Helper functions.
Errors 0, 2, 3 were causing confusion with dollar output.
Added a few helper functions to ease the use of the class in a progamming sense.
Made several other changes and reposted the code.
Hi,
There is a process ( built in C/C++) which starts with my user id and I need to execute a specific function with a different user id. Is there any api so that I provide userid, passwd and the next instance the process will have the new user id privileges.
- Pranav (3 Replies)
Hi everyone, I have an issue with a project of mine. I have to run a program on a terminal which requires to be logged in as su to have it run it. Given that I'm having problem to use expect to give the password I'd like to change the privilege of that program from SU to normal user ( I have the SU... (13 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I need to create a simple ATM (Cash machine simulation in unix) which shows a welcome screen, then a login screen... (2 Replies)
I need to create a simple ATM (Cash machine simulation in unix) which shows a welcome screen, then a login screen to enter 3 users details. help please on the coding
The users details need to be in a txt file: the details are: (PIN No, First name last name, Account number, Balance, Histrosy)
... (1 Reply)
I am very new at programming and this is probably an easy question, but I am desperate. I need to change this low level code into a C program that I can run so I can print out every "A" that appears with the fork() command. You help is greatly appreciated.
PRINT A
p=fork()
if( p == 0) {... (0 Replies)
How can i find( or list) contents of all registers being used by my program?
Is there any system call or library available for this?:confused:
At runtime in my c/c++ program. At runtime using may be some assembly hack!!!!!!!!!!! (2 Replies)
hi,
Somebody have or known where i can find a perl small perl program to change the password.
The point: First it verify is the user exist, checking the old typed password and replace it with new. The passwords must be encoded.
Thanks, very much! (0 Replies)
I am an IT auditor with a big 4 accounting firm and am cur the process of conducting an application program change audit for a large public company related to Sarbanes Oxley. This is my first time using this forum and need some assistance in verifying a fact that I believe to be true.
My client... (1 Reply)