In [1]: In [2]: Q1. Define a class which has at least two methods: getString: to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In [1]: In [2]: Q1. Define a class which has at least two methods: getString: to get a string from console input printString: to print the string in upper case. Also please include simple test function to test the class methods. Hints: Use init method to construct some parameters (30 points) #Your Code is here Q2. Create a Python class called BankAccount which represents a bank account, having as attributes: accountNumber (numeric type), name (name of the account owner as string type), balance. Create a constructor with parameters: account Number, name, balance. Create a Deposit() method which manages the deposit actions. Create a Withdrawal() method which manages withdrawals actions. Create an bankFees() method to apply the bank fees with a percentage of 5% of the balance account. Create a display() method to display account details. Give the complete code for the BankAccount class. For example: Testing the code: newAccount = BankAccount(2178514584, "Albert", 2700) Creating Withdrawal Test newAccount. Withdrawal (300) Create deposti test newAccount. Deposit(200) Display account informations newAccount.display() (40 points) #Your Code is Here #Hints: # create the class # create the constuctor with parameters: account Number, name and balance #create Deposit() method #create Withdrawal method # create bankFees() method # create display() method # Testing the code : # Creating Withdrawal Test # Create deposit test # Display account informations In [3]: Q3. a) Define two classes, called Dog and Cat, which have the same 3 methods including the contstuctor. After defining the classes, create two objects then write a for loop to obtain the following output: (30 points) Meow I am a cat. My name is Kitty. I am 2.5 years old. Meow Bark I am a dog. My name is Fluffy. I am 4 years old. Bark Hint: The Method names, other than the constructor, can be make_sound and info methods #Your code here In [1]: In [2]: Q1. Define a class which has at least two methods: getString: to get a string from console input printString: to print the string in upper case. Also please include simple test function to test the class methods. Hints: Use init method to construct some parameters (30 points) #Your Code is here Q2. Create a Python class called BankAccount which represents a bank account, having as attributes: accountNumber (numeric type), name (name of the account owner as string type), balance. Create a constructor with parameters: account Number, name, balance. Create a Deposit() method which manages the deposit actions. Create a Withdrawal() method which manages withdrawals actions. Create an bankFees() method to apply the bank fees with a percentage of 5% of the balance account. Create a display() method to display account details. Give the complete code for the BankAccount class. For example: Testing the code: newAccount = BankAccount(2178514584, "Albert", 2700) Creating Withdrawal Test newAccount. Withdrawal (300) Create deposti test newAccount. Deposit(200) Display account informations newAccount.display() (40 points) #Your Code is Here #Hints: # create the class # create the constuctor with parameters: account Number, name and balance #create Deposit() method #create Withdrawal method # create bankFees() method # create display() method # Testing the code : # Creating Withdrawal Test # Create deposit test # Display account informations In [3]: Q3. a) Define two classes, called Dog and Cat, which have the same 3 methods including the contstuctor. After defining the classes, create two objects then write a for loop to obtain the following output: (30 points) Meow I am a cat. My name is Kitty. I am 2.5 years old. Meow Bark I am a dog. My name is Fluffy. I am 4 years old. Bark Hint: The Method names, other than the constructor, can be make_sound and info methods #Your code here
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
IST 8100 Supplemental Cases Inside Microsoft During last fall's United Way campaign at Microsoft, two vice-presidents made a wager on whose division would generate the most contributions. The loser,...
-
Discuss the role of intrinsic & extrinsic cues in the perceived quality of you product/service(Unilever company; Lipton tea as an example). Include it in the about section of assignment
-
1. The lower court concluded that the note was non-negotiable and dismissed the bank's attempt to enforce it. Was this an error? 2. Suppose that the note in this case had stated, "The terms of the...
-
Duval Company issues four-year bonds with a $117,000 par value on January 1, 2021, at a price of $112,870. The annual contract rate is 9%, and interest is paid semiannually on June 30 and December...
-
Find the z-score that has 88.9% of the distributions area to its right. Find the indicated z-score.
-
B. S. International, Ltd. (BSI), makes costume jewelry. JMAM, LLC, is a wholesaler of costume jewelry. JMAM sent BSI a letter with the terms for orders, including the necessary procedure for...
-
Why are there such discrepancies in the view of performance by the manager and the employees? Is this a good place for 360 feedback? How much should the manager be influenced by employee opinions?...
-
You work in the human resources department of your company helping new employees fill out the necessary paperwork to get their first paycheck. There are a number of decisions that employees must make...
-
Select a company. Establish an internal leadership blog based on your selected company (a blog for your company employees only) by incorporating the following criteria and using the Leadership Blog...
-
We define the even and odd parts of a sequence \(x(n), \mathcal{E}\{x(n)\}\) and \(\mathcal{O}\{x(n)\}\) respectively, as \[\begin{aligned}\mathcal{E}\{x(n)\} & =\frac{x(n)+x(-n)}{2}...
-
Prove that the Fourier transform of \(x(n)=\mathrm{e}^{\mathrm{j} \omega_{0} n}\) is given by Equation (2.216) by computing \[X\left(\mathrm{e}^{\mathrm{j} \omega} ight)=\lim _{N ightarrow \infty}...
-
Mensa International calls itself the international high IQ society, and it has more than 100,000 members. Mensa states that candidates for membership of Mensa must achieve a score at or above the...
-
If 25 women are randomly selected, find the probability that the mean of their red blood cell counts is less than 4.444. Assume that red blood cell counts of women are normally distributed with a...
-
An Office Team survey of 150 executives found that 93.3% of them said that they would be concerned about gaps in a rsum of a job applicant. Based on these results, such randomly selected groups of...
-
Let S(t) denote the supply of a certain commodity as a function of time t. Suppose the rate of change of the supply is proportional to the difference between the demand D(t) and the supply. Find a...
-
Consider a closed, rigid tank with a volume of 0.8L, filled with cold water initially at 27C. The tank is filled such that there are no voids (air pockets) within. The initial pressure within the...
-
Clipper Company bought three used machines located in Toronto for $10,000,000. The arrangement with the seller is to move all the equipment to Clippers factory in Edmonton. It is understood that some...
-
A bond has a maturity value of $100,000 payable in 10 years. These bonds have a 5% coupon rate payable annually, and the market yield was 6% when the bonds were purchased. Required: a. Is this a...
-
November Raincoats uses three different machines to manufacture raincoats. Due to climate change and changes in consumer preferences, demand for raincoats has declined in recent years. The following...
-
The equity section of Atrio Ltd. showed the following: share premium 6,101, share capitalordinary 925, share capitalpreference 58, retained earnings 7,420, and treasury shares 2,828. (All amounts are...
-
The following equity accounts are in the ledger of Eudaley Group at December 31, 2025. Instructions Prepare the equity section of the statement of financial position at December 31, 2025. Share...
-
Travis Mordica asks, Since share dividends dont change anything, why declare them? What is your answer to Travis?
Study smarter with the SolutionInn App