Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

problem 1) The code given defines the start of the class to represent bank accounts:

class BankAccount(object):
interest_rate = 0.3
def __init__(self, name, number, balance):
self.name = name
self.number = number
self.balance = balance
return

a) prepare down the name of the class variables and instance variables in the given code.

b) Add instance methods called deposit() and withdraw() that increase and decrease balance of the account. Ensure that withdraw() method does not permit the account to go into overdraft. Add a third method called add_interest() that adds interest to balance (the interest must be the interest rate multiplied by the present balance).

c) Create subclass of BankAccount known as StudentAccount. Every StudentAccount must have the overdraft limit of 1000. prepare down a constructor for the new class. Override the withdraw() method to ensure that students can withdraw money up to their overdraft limits.

problem 2)A palindromic word is one which reads same backwards as forwards. Therefore the words peep and deed are palindromes.

a) Create down a class called Palindrome.

b) In your Palindrome class, produce a method called reverse() that takes a string argument. Your method must return reverse of the argument as a string. For instance, if argument is Foobar then your method must return rabooF.

c) Make a second method in Palindrome called isPalindrome() that takes a string argument. This method must return True if argument is a palindrome and False otherwise.

d) prepare some code to test your new Palindrome class and print out results of your testing to the user. Provide some consideration to what sort of strings you might want to use for your testing.

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M910507

Have any Question? 


Related Questions in C/C++

1 we know that from ece 109 to calculate the

1. We know that from ECE 109, to calculate the equivalent resistance of a network of resistors in series in parallel are given by: Write a C++ program that asks the user to input values for resistors (as many as they wou ...

Bankers algorithmimplement the bankers algorithm for

Banker's Algorithm Implement the Banker's algorithm for deadlock avoidance, that works on a given set of N processes and M resource types (N The input data and result is then displayed on the screen. You may use your pro ...

Write a c program that prompts the user to enter a line of

Write a C program that prompts the user to enter a line of text (up to 50 characters). It should then convert the text entered to uppercase letters and then to lowercase letters, and then to Sentence case. Your program s ...

Computer applications divisionassignment c programmingstl

COMPUTER APPLICATIONS DIVISION Assignment: C++ PROGRAMMING STL Vector For this assignment, you will be starting with an example program that demonstrates the use of a STL vector. In addition to this, you may need to look ...

Programming assignmentwrite a c program that allows the

PROGRAMMING ASSIGNMENT Write a C program that allows the user to make some banking transactions. The program should first prompt the user to enter the current balance of his/her bank account (in dollars and cents). The p ...

Discussionkeyboard versus file input please respond to the

Discussion "Keyboard versus File Input" Please respond to the following: • Suppose you are designing a C++ application that needs to capture user input specifically via a keyboard or from a file. Determine the method tha ...

Programming assignment 5write a c program that allows the

PROGRAMMING ASSIGNMENT #5 Write a C program that allows the user to make some banking transactions. The program should first prompt the user to enter the current balance of his/her bank account (in dollars and cents, not ...

Transaction processing system tpsxyz electronics is one of

Transaction Processing System (TPS) XYZ Electronics is one of the most popular electronics companies In Sultanate of Oman the company offers affordable electronic gadgets such as mp3 players, portable movie players, mobi ...

Assignmentobjectivespractice reading characters from a

Assignment Objectives Practice reading characters from a file Practice using command line input Practice using command-line redirection of files Practice implementing a double transposition ciphering algorithm Summary In ...

Intro to programming in c programming assignmentassignment

Intro to Programming in C Programming Assignment Assignment purpose: User defined functions, pointers, Menu driven program A Company needs to create software for their new line of phone applications. Customers will have ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen