Ask Question, Ask an Expert


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): = name
self.number = number
self.balance = balance

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++

For this program you will add and test 2 new member

For this program you will add and test 2 new member functions to the IntSLList class posted on the website. The two member functions are: insertByPosn(int el, intpos) Assuming that the positions of elements of a list beg ...

Problem 1overview for problem 1a of this assignment you

Problem #1 Overview: For problem 1(a) of this assignment, you will need a C++ compiler. In order to receive credit, your program must compile and run; and you must provide the actual source code file so that I can compil ...

More often than not entrepreneurs will fail several times

"More often than not, entrepreneurs will fail several times before they make it and will usually learn a lot in the process. To help these entrepreneurs to succeed will require a cultural shift. We need to encourage Aust ...

Cs492 programming assignment-the program must be written in

CS492 Programming Assignment- The program must be written in C or C++, and run on a linux machine. ALL source code you submit must be well documented (documentation is an indicator of understanding!) Programs that cannot ...

Problem 1 you are tasked to write a program that outputs

PROBLEM 1 You are tasked to write a program that outputs the following amplifier system specifications: Voltage amplification: 25 Input voltage: 50 mV Power output: 2.5 W Bandwidth: 15 kHz Type: Class A a. For this progr ...

Only one programwrite a c program to find fibonacci numbers

Only one program Write a C++ Program to Find Fibonacci Numbers using Dynamic Programming.

1 learner objectivesat the conclusion of this programming

1. Learner Objectives: At the conclusion of this programming assignment, participants should be able to: * Apply repetition structures within an algorithm * Construct while (), for (), or do-while () loops in C * Compose ...

This program involves using stl listsfor this program you

This program involves using STL lists. For this program you will implement three functions whose prototypes are given below: list ::iterator mxIter(list ::iterator first, list ::iterator last); void selectSort(list & aLi ...

C program codeoverviewfor this assignment write a program

C++ program code Overview For this assignment, write a program that will simulate a single game of Craps. Craps is a game of chance where a player (the shooter) will roll 2 six-sided dice. The sum of the die will determi ...


Write a C++ program that will use loops to perform each of the following tasks: 1. Ask the user for two characters from the keyboard and read them into char variables. Determine which input is larger and which is smaller ...

  • 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

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate