1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mama L [17]
2 years ago
6

Python Programming

Computers and Technology
1 answer:
Phoenix [80]2 years ago
8 0

The python program that creates a Bankaccount class for a Bank ATM that is made up of the customers and has a deposit and withdrawal function is given below:

<h3>Python Code</h3>

# Python program to create Bankaccount class

# with both a deposit() and a withdraw() function

class Bank_Account:

def __init__(self):

 self.balance=0

 print("Hello!!! Welcome to the Deposit & Withdrawal Machine")

def deposit(self):

 amount=float(input("Enter amount to be Deposited: "))

 self.balance += amount

 print("\n Amount Deposited:",amount)

def withdraw(self):

 amount = float(input("Enter amount to be Withdrawn: "))

 if self.balance>=amount:

  self.balance-=amount

  print("\n You Withdrew:", amount)

 else:

  print("\n Insufficient balance ")

def display(self):

 print("\n Net Available Balance=",self.balance)

# Driver code

# creating an object of class

s = Bank_Account()

# Calling functions with that class object

deposit()

s.withdraw()

s.display()

Read more about python programming here:

brainly.com/question/26497128

#SPJ1

You might be interested in
Question 3
goldfiish [28.3K]

Answer: Zero is output.

8 0
3 years ago
Words like "free" or "percent off" will not only trigger spam filters for your email, but will also ___________
weeeeeb [17]

Answer:

eliminasnados

Explanation:

6 0
3 years ago
A standard computer monitor is 1024 pixels wide and 768 pixels tall
Annette [7]
If this is a true or false question the answer is true
8 0
4 years ago
Claire is a manager at an information technology (IT) firm. She notices a consistent drop in the productivity of her employees.
Karolina [17]
D identifying decision criteria
3 0
3 years ago
3. (20 points) Write a C++ recursive function that finds the maximum value in an array (or vector) of integers without using any
Luden [163]

Answer:

Following are the code to this question:

In option (i):

#include <iostream>//defining header file

using namespace std;

int findMax(int B[], int x)//defining recursive method findMax

{

if (x == 1)//defining condition when value of n==1

return B[0];//return array first element

return max(B[x-1], findMax(B, x-1)); // calling recursive method inside max method and return value

}

int main() //defining main method  

{

int B[] = {12, 24, 55, 60, 50, 30, 29};//defining array B

int x= 7;//defining integer variable and assign a value

cout << "Maximum element value of the array is: "<<findMax(B, x)<<endl;//calling method findMax and print value

return 0;

}

Output:

Maximum element value of the array is: 60

In option (ii):

\Rightarrow \ T(n) = 1 + T(n-1)\\\Rightarrow  1 + 1 + T(n-2)\\ \Rightarrow  1 + 1 + 1 + ... n \ times \\\Rightarrow  O(n) \\

Explanation:

In the above-given program a recursive method "findMax" is defined, which accepts an array "B" and an integer variable "n" in its parameter, inside the method a conditional statement is used that, checks value of x equal to 1.

  • If the above condition is true it will return the first element of the array and find the max number.
  • Inside the main method, an array B is declared that assigns some values and an integer variable is declared, that also assigns some values, in the last step print method is used that pass value in method and prints its return value.
  • In the option (ii) we calculate the Big-O notation algorithm value.
5 0
4 years ago
Other questions:
  • Tag groups can be nested up to ____ levels deep, with up to _______ tag subgroups under a single parent.
    14·1 answer
  • What the difference between a battery and power supply?
    15·1 answer
  • What is grid computing? It is distributed computing where autonomous computers perform independent tasks. It is interconnected c
    12·1 answer
  • âthe first line in a hypertext markup language (html) file is the _____, which is a processing instruction indicating the markup
    9·2 answers
  • Can some one help me on 4&amp;5
    6·1 answer
  • IfL = 4.4H and the inductive reactance of an inductor is 620 Omega find the frequency of the alternating current​
    5·1 answer
  • Kurtz &amp; Kemeny created an easy-to-learn programming language called?
    15·1 answer
  • How do I make someone "Brainiest". <br> First person to reply will get "Brainiest"
    8·2 answers
  • 3 uses of Microsoft word in hospital
    10·1 answer
  • Match the index with the value
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!