For all problems you must:
I have implemented the classes but i ran out of time to write the test cases for them.
=========================================================================================
class Person():
def __init__(self, n, e, p):
self.name = n
self.email = e
self.phone = p
def __str__(self):
return self.name + ' ' + self.email + ' ' + str(self.phone)
def get_name(self):
return self.name
def set_name(self,n):
self.name=n
def get_phone(self):
return self.phone
def set_phone(self,p):
self.phone=p
def get_email(self):
return self.email
def set_name(self,e):
self.email=e
jon = Person('John','John@coursera.com','456-789-1233')
print(jon)
jon.set_phone('457-888-9999')
print(jon)
=========================================================================================
class Account():
def __init__(self,person,num,bal):
self.person=person
self.account_number=num
self.balance=bal
if self.balance<0:
self.balance=0
def get_Person(self):
return self.person
def set_Person(self,p):
self.person=p
def get_AccountNumber(self):
return self.account_number
def set_AccountNumber(self,num):
self.account_number=num
def get_balance(self):
return self.balance
def set_balance(self,bal):
if bal>0:
self.balance=bal
class Savings_Account(Account):
def __init__(self,person,num,bal,min_bal):
super().__init__(person,num,bal)
self.minimum_balance=min_bal
def deposit(self,amount):
if amount>0:
self.balance+=amount
def withdrawl(self,amount):
if 0<amount and amount<=self.balance:
self.balance-=amount
def __str__(self):
return self.person+" Account number: "+str(self.account_number)+\
", Balance: $"+str(self.balance)
class Loan_Account(Account):
def __init__(self,person,num,bal,max_balance):
super().__init__(person, num, bal)
self.max_balance = max_balance
def withdrawl(self, amount):
if 0 < amount and amount <= self.balance:
self.balance -= amount
def __str__(self):
return self.person + " Account number: " + str(self.account_number) + \
", Balance: $" + str(self.balance)
==========================================================================================
For all problems you must: Write a Python (.py) program Test, debug, and execute the Python...
For each problem, you must: Write a Python program Test, debug, and execute the Python program Save your program in a .py file and submit your commented code to your Student Page. Note regarding comments: For every class, method or function you create, you must provide a brief description of the what the code does as well as the specific details of the interface (input and output) of the function or method. (25 pts.) Write a program that reads in...
In C++, Step 1: Implement the Student Class and write a simple main() driver program to instantiate several objects of this class, populate each object, and display the information for each object. The defintion of the student class should be written in an individual header (i.e. student.h) file and the implementation of the methods of the student class should be written in a corresponding source (i.e. student.cpp) file. Student class - The name of the class should be Student. -...
Create the Python code for a program adhering to the following specifications. Write an Employee class that keeps data attributes for the following pieces of information: - Employee Name (a string) - Employee Number (a string) Make sure to create all the accessor, mutator, and __str__ methods for the object. Next, write a class named ProductionWorker that is a subclass of the Employee class. The ProductionWorker class should keep data attributes for the following information: - Shift number (an integer,...
Please help with this assignment. Thanks.
1. Write a C++ program containing a class Invoice and a driver program called invoiceDriver.cpp. The class Invoice is used in a hardware store to represent an invoice for an item sold at the store. An invoice class should include the following: A part number of type string A part description of type string A quantity of the item being purchased of type int A price per item of type int A class constructor...
code must be in java.
Assignment 5 Purpose In this assignment, you will implement a class hierarchy in Java. Instructions The class hierarchy you will implement is shown below account Package Account manager Package SavingAccount CheckingAccount AccountManager The descriptions of each class and the corresponding members are provided below. Please note that the Visibility Modifiers (public, private and protected) are not specified and you must use the most appropriate modifiers Class AccountManager is a test main program. Create it so...
IN PYTHON Assignment Overview This assignment will give you experience on the use of classes. Understand the Application The assignment is to first create a class calledTripleString.TripleStringwill consist of threeinstance attribute strings as its basic data. It will also contain a few instance methods to support that data. Once defined, we will use it to instantiate TripleString objects that can be used in our main program. TripleString will contain three member strings as its main data: string1, string2, and string3....
In C++ Write a program that contains a BankAccount class. The BankAccount class should store the following attributes: account name account balance Make sure you use the correct access modifiers for the variables. Write get/set methods for all attributes. Write a constructor that takes two parameters. Write a default constructor. Write a method called Deposit(double) that adds the passed in amount to the balance. Write a method called Withdraw(double) that subtracts the passed in amount from the balance. Do not...
Assignment Overview In Part 1 of this assignment, you will write a main program and several classes to create and print a small database of baseball player data. The assignment has been split into two parts to encourage you to code your program in an incremental fashion, a technique that will be increasingly important as the semester goes on. Purpose This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of...
The class declaration (interface) and the function definitions (implementation) must be in separate files - the interface or "header" file has a .hpp extension and the implementation has a .cpp extension. As usual, all data members should be private. Write a class called BankAccount that has: a string data member called customerName, a string data member called customerID, and a double data member called customerBalance a constructor that takes two strings and a double (name, ID, balance) and uses them...
When answering this question, can you please specify what you name your files? Thank you! Write a Java application, and an additional class to represent some real-world entity. Keep in mind that a class is a model in code of something real or imagined, which has attributes (member variables) and behaviors (member methods). The class will: a. Create a total of 5 member variables for the class, selecting the appropriate data types for each field. For example, a class to...