Write an algorithm that gets as input your current credit card balance, the total dollar amount of new purchases, and the total dollar amount of all payments. The algorithm computes the new balance, which this time includes an 8% interest charge on any unpaid balance below $100 , 12% interest on any unpaid balance between $100 and $500, inclusive, and 16% on any unpaid balance about $500.

Answers

Answer 1
Answer:

Answer:

balance = float(input("Enter the current credit card balance: "))

purchases = float(input("Enter the amount of new purchases: "))

payments = float(input("Enter the amount of all payments: "))

unpaid = purchases - payments

if unpaid >= 0 and unpaid < 100:

   balance = balance + payments - purchases - (unpaid * 0.08)

elif unpaid >= 100 and unpaid <= 500:

   balance = balance + payments - purchases - (unpaid * 0.12)

else:

   balance = balance + payments - purchases - (unpaid * 0.16)

   

print("The balance is " + str(balance))

Explanation:

*The code is in Python.

Ask the user to enter the balance, amount of purchases, and amount of payments

Calculate the unpaid balance, subtract payments from purchases

Check the unpaid balance. If it is smaller than 100, calculate the new balance, add payments, subtract purchases and the 8% interest of unpaid balance. If it is between 100 and 500, calculate the new balance, add payments, subtract purchases and the 12% interest of unpaid balance. If it is greater than 500, calculate the new balance, add payments, subtract purchases and the 16% interest of unpaid balance

Print the balance


Related Questions

A database is composed of several parts known as database ____
1.What is the ITIL? A.A set of process-oriented best practices B.A group of metrics that govern the program C.Focuses on value delivery D.All of the above
Create a Produceclass that hasan instance variable of type Stringfor the name, appropriate constructors, appropriate accessor and mutator methods, and a public toString() method. Then create a Fruitand a Vegetableclass that are derived from Produce. These classes should have constructors that take the nameas a Stringand invoke the appropriate constructor from the base class to set the name.Also, they should override toStringmethod to display the nameof the produce and its type. For instance, Mangois a Fruitand Caulifloweris a Vegetable. Finally, create a class called TruckOfProducethat will keep track of the boxes of Vegetablesand Fruitsadded in to the truck. This class should use an array of Produceto store both Vegetableand Fruitobjects.
At what layer in the TCP/IP protocol hierarchy could a firewall be placed to filter incoming traffic by means of:a) message content b) source addressc) type of application​​
Define the role of websites in internet.also write the importance of internet in our daily life.

What is the main purpose of the status report? O A. To ensure that management and the team has a clear picture of the state of the project. B. To alert management to exceptional or unusual situations, C. To document the impact of change requests from the client. D. To detail the mistakes made in planning and budgeting,​

Answers

Answer:

A. To ensure that management and the team has a clear picture of the state of the project

Explanation:

hope this helps!

Answer:

A

Explanation:

What is the output, if userVal is 5? int x; x = 100; if (userVal != 0) { int tmpVal; tmpVal = x / userVal; System.out.print(tmpVal); }

Answers

Answer:

The output is 20

Explanation:

This line divides the value of x by userVal

tmpVal = x / userVal;

i.e.

tmpVal = 100/5

tmpVal = 20

This line then prints the value of tmpVal

System.out.print(tmpVal);

i.e 20

Hence, The output is 20

Final answer:

The provided Java code checks if the variable userVal does not equal 0. As this is the case when userVal is 5, another variable tmpVal is assigned the value of another variable x (which is 100) divided by userVal. Hence, the output of the code would be 20.

Explanation:

In the given piece of code, the variable userVal is assigned a value of 5. The program also contains a variable x which is assigned a value of 100. An if statement checks whether userVal does not equal 0 - since 5 != 0, the condition is true. A new variable tmpVal is then declared and assigned the value of x divided by userVal, so tmpVal equals 100 / 5, which is 20. So, the output of this code when userVal is 5 would be 20.

Learn more about Java Programming here:

brainly.com/question/34106786

#SPJ3

Which statement prints "hi" on the screen?(a) puts("hi");

(b) put "hi";

(c) puts "hi";

(d) none of the above

Answers

Answer: (A) Puts("hi");

Explanation:

 Puts() is the type function that uses the file handling in the programming language. It basically use to compose or write the function or line that displaying the output screen of the computer system.

The puts() function is the type of function which basically allow the user to read the characters or line include all the space until entering into the new character or line.

The declaration of the puts(0 function is as follows:

   int puts (char *STRING);

Answer:

a

Explanation:

You text file begins with the following rows. The pattern is a description of the item to be repaired, its color, and the issue. bike, red, flat tire bike, blue, broken chain skate, blue, loose wheel mitt, red, torn lace Your program starts with the following lines. import csv aFile = open("data\broken.txt","r") aReader = csv.reader(aFile) countRed = 0 for item in aReader: When you write code to count the number of times red is the color, what is the index of "red"?

Answers

Answer: the answer is 1

Explanation:

edge 2021

A firewall is either software or dedicated hardware that exists between the __________ being protected.

Answers

A firewall is either software or dedicated hardware that exists between the network and the resource being protected. this network security device monitors traffic to or from the network. It is based on set of rules about what data packets will be allowed to enter or leave a network.

- If we place records from different tables in adjacent____________, it would increase efficiency of a database.Physical location
Table
Form
empty location

Answers

Answer: Physical location

Explanation:

If we place records from, different tables in adjacent physical location, it would increases efficiency of a databases as, database consolidates records from previously store in separate files into a common file. Databases are fast and efficient when they are dealing with large data. When all the information is stored in multiple physical location it is also known as distributed database, as physical location helps to provide the physical and logical path and also protect from default locations in the database.