assignment 10, Python Programming

#question.Program 10 Assignment
(Banking Objects – Savings/Checking Accounts)
Create a program named 10.py that performs the following:

Create a class named ChkAcct, and a class named SavAcct. Each class should have a “balance” property. Each class should also have a deposit method to add to the balance, and a withdraw method to subtract from the balance. Each class should also have a transfer method that calls the withdraw method in its own class, and invoke (call) the deposit method in the other class.

1. When you “open” an account by creating an instance of a class (an object), ask the user to input a beginning balance.

2. Have the user open a savings account and a checking account by entering a beginning balance for each account. Print the balance of each account.

3. Ask the user for an amount to deposit into the savings account, then add it to the balance for the savings account. Print the balance.

4. Ask the user for an amount to deposit into the checking account then add it to the balance for the checking account. Print the balance.

5. Ask the user for an amount to withdraw from the savings account then subtract that amount from the balance for the savings account. Print the balance.

6. Ask the user for an amount to withdraw from the checking account then subtract that amount from the balance for the checking account. Print the balance.

7. Ask the user to input the dollar amount to transfer from the checking account to the savings account. Print the balance of both the checking and savings accounts when the transaction is complete.

8. Ask the user to input the dollar amount to transfer from the savings account to the checking account. Print the balance of both the checking and savings accounts when the transaction is complete.


Posted Date: 12/22/2012 5:17:41 PM | Location : United States







Related Discussions:- assignment 10, Assignment Help, Ask Question on assignment 10, Get Answer, Expert's Help, assignment 10 Discussions

Write discussion on assignment 10
Your posts are moderated
Related Questions
how to calculate standard deviations in programming

Use the function to compute and print the sum of first n prime numbers.

Assume you have a truck which has to travel across a desert from the base camp at position 0 (left) to the target camp at position 4 (right). The intermediate positions 1,2, and 3

from urllib2 import urlopen # Open http://placekitten.com/ for reading on line 4! response = kittens.read() body = response[559:1000] # Add your ''print'' statement here!

Import the sample code below into the Python IDLE and enhance it, run it and debug it. Add features to make this a more realistic database tool by providing for easy data entry an

Define a function that draws a pentagon of a size you provide when you call the function. Include a ''''''docstring'''''' as the first line of the function''s body — it tells the p

Write a program that asks the user to enter a number of seconds. The responses of the program will vary depending on the length of seconds: • If the number of seconds is under 60

1)    Write a python programmecomparing for and while loops like the following. Math Times table For Loop: 2x1=2 2x2=4 ..... 2x12=24 While Loop: 3x1=3 3x

Print vs Return Here are two different method declarations: def f1(x): print x + 1 def f2(x): return x + 1 What happens when  we call them? >>> f1(3) 4 >>

Write an algorithm for a program that receives, as input from the user, 2 string variables and 2 integer variables; then joins together and displays the combined strings; and final