
The functionality of each file is described below:
Class BankAccount
This class has two instance variables:
name
balance
Create a constructor that takes two parameters to initialize the instance variables name and balance. The name must not be an empty string. The name also must not include any numbers or symbols. The balance must be zero or more to be used.
If the name was an empty string a Value Error will be raised with the message “name cannot be empty”
If the name contained numbers or symbols a Value Error will be raised with the message “name cannot include numbers or symbols”
If the name was valid, it will be formatted properly and assigned to the instance variable.
The valid name consists of alphabetical characters lowercase or upper case, may include space, underscore or hyphen.
The name may consist of first, middle and last name.
One way to validate the name is using Regular Expressions.
Proper name format is the first character uppercase and the rest of the name lowercase character. For example, if the value “joHn jAcK bLaCk” was given the name instance variable would hold “John Jack Black”.
If the balance was less than zero a Value Error will be raised with the message “balance cannot be negative”
If the balance was 0 or a positive number it will be assigned to the instance variable balance
Create method displayDetails(), the method will display the name and the balance in an organized manner
Create method deposit(), the method accepts amount as a parameter. If the passed parameter was positive it will be added to the balance otherwise, a Value Error will be raised with the message “amount cannot be zero or less”
Create method withdraw(), the method accepts amount as a parameter.
If the passed parameter was negative or zero a Value Error will be raised (“ amount cannot be zero or less than zero”
If the passed parameter was greater than balance a Value Error will be raised “Insufficient funds”
If the amount was valid i.e. greater than 0 and less or equal to the balance, the amount will be deducted from the balance
main.py
This file will import BankAccount.py and create the main method
The main method will handle all the errors in a try-except block
The main method will implement the following
Ask the user to input name and balance and use them to create a BankAccount object.
If some or all are values were invalid the user will be asked again to input the name and the balance
If all the provided values were valid, the loop will be terminated and the values will be used to create a BankObject.
The main method will display the following choices:
deposit
withdraw
The user will be asked to choose the transaction type and the transaction will be completed.
If an Error was raised, the user will be notified and he/she will be asked if he/she wants to continue
If the transaction was successful the details of the BankAccount object will be displayed
The user will be asked if he/she wants to make another transaction
The process will be repeated until the user chooses to terminate the loop

Step by stepSolved in 3 steps

Python code?
Python code?
- Create a student class: • Store a name Store a list of assignments • Override init to take a name Override str to output the name, average assignment percentage, letter grade to match that average Calculate the student's average grade Create an assignment class: • Store the assignment name • Store the assignment date • Store the assignment grade • Override init to take a name and date Override str to output the name, date, and grade of the assignment Create a class class: • Store a list of students • Store the name of the class • override init to take the class name • override str to output the class name, and its list of students • Be able to write the class name, list of students, and their assignments to a file 'm a little stuck on where to begin. I'm still new to programming and not very good with object programming. I was wondering if I could get some insight on how this is structured.arrow_forwardBread Class -breadType: String - caloriesPerslice: integer + Bread(String breadType, integer caloriesPerslice) + getBreadType(): String + setBreadType(String breadType): void + getCaloriesPerslice(): integer + setCaloriesPerSlice(integer calories): voidarrow_forwardQUESTION 7 Final data/code constructs are only inheritable once. O True O False QUESTION 8 You can include code in an interface by using the keywordarrow_forward
- C# Console Application for Minesweeper In this milestone, students will create three classes: Cell, Board, and Program. Create a class that models a game cell. A game cell should have the following properties: a.Its row and column. These should initially be set to -1. b.Its visited boolean value. This should initially be set to false. c.Live boolean value. This should initially be set to false. "Live" set to true will indicate that the cell is a "live bomb" cell. d.The number of neighbors that are "live." This should initially be set to 0. The Cell class should have a constructor, as well as getters and setters for all properties. 3.Create a class that models a game board. A game board should have the following properties: a.Size. The board will be square, where the size includes the dimensions of both the length and width of the board. b.Grid. The grid will be a 2-dimensional array of the type cell. c.Difficulty. A percentage of cells that will be set to "live" status. 4.The Board…arrow_forwardCreate etBeans project with the following configuration: Project Name: Assignment_3_6_1 Package: makechange • Class Name: MakeChange Write a program that calculates the number of coins necessary to make change for any amount the user types in. The program should have variables for the amount of: • toonies • loonies quarters • dimes nickels pennies (even though they don't exist any more) Display all of the information clearly in tl.e output of the program. HINT: Use integer division (/) and modulus (8) in your calculations. Your tion could look similar to:arrow_forwardInstructions The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly. An example of the program is shown below: Enter a radius for a circle >> 7 The radius is 7 The diameter is 14 The area is 153.93791 Task 1: The DebugPen class compiles without error. This task is dependent on completing task #2. Task 2: The DebugCircle class methods work without errors. Task 3: The DebugFour1 class compiles without error. Task 4: The DebugFour1 program accepts user input and displays the correct output.arrow_forward
- is defined as where a variable is accessible or can be used. Private Class Scope Private Method None of thesearrow_forward1arrow_forwardWhen you instantiate an object from a class, you give a name to this particular object so that your program can distinguish it from other objects you instantiate from the same class. True Falsearrow_forward
- Summary In this lab, you create a derived class from a base class, and then use the derived class in a Python program. The program should create two Motorcycle objects, and then set the Motorcycle’s speed, accelerate the Motorcycle object, and check its sidecar status. Instructions Open the file named Motorcycle.py. Create the Motorcycle class by deriving it from the Vehicle class. Call the parent class __init()__ method inside the Motorcycle class's __init()__ method. In theMotorcycle class, create an attribute named sidecar. Write a public set method to set the value for sidecar. Write a public get method to retrieve the value of sidecar. Write a public accelerate method. This method overrides the accelerate method inherited from the Vehicle class. Change the message in the accelerate method so the following is displayed when the Motorcycle tries to accelerate beyond its maximum speed: "This motorcycle cannot go that fast". Open the file named MyMotorcycleClassProgram.py. In the…arrow_forwardWhen a class uses dynamically allocated objects for its members and it does not have a copy assignment operator what of the following could happen (mark all that apply) There could be runtime errors There could be a double frees (double delete errors) There could be memory leaks Nothing happens the compiler provides the correct constructor There could be compile time errorsarrow_forward9arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





