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
torisob [31]
4 years ago
4

python A credit card company computes a customer's "minimum payment" according to the following rule. The minimum payment is equ

al to either $10 or 2.1% of the customer's balance, whichever is greater; but if this exceeds the balance, then the minimum payment is the balance. Write a program to print out the minimum payment using min and max. Assume that the variable balance contains the customer's balance. Your program does not need to print the dollar sign. Example 1: if your balance is 1000, then your program should print 21.
Computers and Technology
1 answer:
larisa86 [58]4 years ago
6 0

Answer:

# user is prompt to enter balance

balance = int(input("Enter your balance: "))

# 21% of the balance is calculated

balancePercent = 0.021 * balance

# The greater of $10 and balance persent is assigned to minimumPayment using max()

minimumPayment = max(10, balancePercent)

# the least between minimumPayment and the balance is assigned to minimumPayment using min()

minimumPayment = min(minimumPayment, balance)

# minimumPayment is displayed to user

print(minimumPayment)    

Explanation:

The program is written in Python3 and well commented. First the user is prompt to enter the balance. Then 21% of the balance is computed and assigned to balancePercent. Then using max( ) we find the maximum between 10 and the balancePercent which is assigned to minimumPayment.

The we use min( ) to find the minimum between the existing minimumPayment and the balance and assigned to minimumPayment.

The minimumPayment is then displayed to user.

max( ) and min( ) are inbuilt function of python that is use to get the maximum and minimum of the passed arguments.

You might be interested in
What does the following code print?
Gennadij [26K]

Answer:

a. 32

Explanation:

Form the above code

{ *yPtr +=3 ;

*zPtr,

c+=3;

func(c,bPTR,&c);

the a=*bPtr c

return value 32 after execution

8 0
3 years ago
2.13.4 Colorful Caterpillarhel ????
exis [7]

Answer:

sorry don't know :(8685

3 0
3 years ago
What is the significance of the following terms A A L U control unit in the CPU​
WARRIOR [948]

Answer:

Explanation:

The function of ALU is to perform arithmetic operations(add,subtract, multiply,division) as well as logical operations(compare values).

The function of CU is to control and coordinate the activities of the computer.

8 0
3 years ago
COMPUTER SCIENCE HELP!!!!!
maw [93]
1.( I need to know what program this is for to answer this one)
2.Explain a game you played for this one and include a interactive element it had like a Side-quest/Npc/Cool Background ect.
3.For 3D games you have to worry about smoothing and lighting, as for 2D you have to worry about keeping the objects within the players POV as they are usually locked to character and stuck facing one direction.
4.???(need progam name)
5.If the game is based in a snow biome you would use snow landscape textures.
8 0
4 years ago
What are some catchy names for computer basics that you would put on a childrens poster?
Triss [41]

Answer:

not sure

Explanation:

6 0
3 years ago
Other questions:
  • Which of these is important to consider before believing health or fitness information you find online? Where the information wa
    5·2 answers
  • Scavenging is a form of fraud in which the perpetrator uses a computer program to search for key terms in a database and then st
    14·1 answer
  • You are assigned to modify an existing Webpage by adding several tables that contain precise wording. The Webpage has had severa
    14·1 answer
  • How to delete a virus that act by restarting u r computer? I am in safe mood to aviod restart.
    10·1 answer
  • Consider the following short paragraph:
    7·1 answer
  • How many bits would be needed to count all the students in class today
    9·1 answer
  • Point out the wrong statement:
    7·1 answer
  • Answer this crossword for brainliest and 15 points
    9·1 answer
  • Your friends are having difficulties with their computer setups. Can you suggest a way to help each friend?
    5·1 answer
  • Why do you need to learn about engineering and technology.
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!