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
Evgen [1.6K]
4 years ago
5

Write a program that determines the value of the coins in a jar and prints the total in dollars and cents. Read integer values t

hat represent the number of quarters, dimes, nickels, and pennies. This program will require user input.
Computers and Technology
1 answer:
Shalnov [3]4 years ago
7 0

Answer:

The programming language is not stated. To answer this question, I'll make use of python programming language.

<em>The following units of conversions is used in this program</em>

<em>1 quarter = $0.25</em>

<em>1 dime = $0.10</em>

<em>1 nickel = $0.05</em>

<em>1 penny = $0.01</em>

<em>$1 = 100 cents</em>

This program makes use of few comment (See explanation for line by line explanation)

Having listed the above, the program is as follows:

#prompt user for inputs

quarters = int(input("Number of Quarters: "))

dimes = int(input("Number of Dimes: "))

nickels = int(input("Number of Nickels: "))

pennies = int(input("Number of Pennies: "))

#Convert coins to dollars

dollar = 0.25 * quarters + 0.10 * dimes + 0.05 * nickels + 0.01 * pennies

print("Dollar Equivalent")

print(str(round(dollar,2))+" dollars")

cent = dollar * 100

print("Cent Equivalent")

print(str(round(cent,2))+" cents")

Explanation:

This first line is a comment

#prompt user for inputs

This line prompts user for value of quarters in the jar

quarters = int(input("Number of Quarters: "))

This line prompts user for value of dimes in the jar

dimes = int(input("Number of Dimes: "))

This line prompts user for value of nickels in the jar

nickels = int(input("Number of Nickels: "))

This line prompts user for value of pennies in the jar

pennies = int(input("Number of Pennies: "))

Using the coin conversion listed in the answer section, the user inputs is converted to dollars in the next line

dollar = 0.25 * quarters + 0.10 * dimes + 0.05 * nickels + 0.01 * pennies

The string "Dollar Equivalent" is printed using the next line

print("Dollar Equivalent")

This line prints the dollar equivalent of the converted coins

print(str(round(dollar,2))+" dollars")

Using the coin conversion listed in the answer section, the user inputs is converted to cents in the next line

cent = dollar * 100

The string "Cent Equivalent" is printed using the next line

print("Cent Equivalent")

This line prints the cent equivalent of the converted coins

print(str(round(cent,2))+" cents")

Please note that the dollar and cent equivalents are rounded to two decimal places. Even though, it's not a requirement of the program, it's a good programming practice

You might be interested in
H&amp;R Block's stated purpose is: to be the leading global consumer tax company bringing tax and related solutions to clients y
jok3333 [9.3K]

Answer:

The correct answer is D.

Explanation:

In the given example, the task that the artificial intelligence system has to fulfill is to take control of an irregular task that is performed by humans. This requires a solution that depends on neural networks which work by evaluating given data sets and makes sense of them through the provided algorithms. They eventually come to a conclusion recognizing the relationships between the data points so that the system can decide what action to take. This procedure can be implemented to take control of the tax solution task that is performed by accountants.

I hope this answer helps.

5 0
3 years ago
What is the foundational domain for business
mr Goodwill [35]

a fundamental domain or fundamental region is a subset of the space which contains exactly one point from each of these orbits . It serves as a geometric realisation for the abstract set of representatives of the orbits . There are many ways to choose a fundamental domain .

hope this help

7 0
3 years ago
Which of the following formulas would you use to calculate the power requirements of an electrical load? 
Wittaler [7]
<span>Your Answer is c: P = E/R</span>
3 0
4 years ago
One disadvantage of online information sharing is that:
zubka84 [21]

Answer:

its b i just took the test

Explanation:

3 0
3 years ago
Read 2 more answers
Maria is starting a pet hotel and needs a website to promote her business and establish her brand. Which of the following is the
german

<em>The answer is </em><em>C. Maria should use turnkey solution that will allow her to use templates and management tools to create a site. </em>

<em> </em>

<em>Turnkey solution</em><em> is a type of business solution that can allow business owners to use these ready-made tools, templates and system to their existing process and business operations. Such tools include </em><em>CRM </em><em>and websites. For example, you are in need of a Loans Management System, that must be implemented next week. You can browse for Loans CRM that are widely available on the internet, subscribe to the service, make payment and this could be used right away in your business operation. Same thing with Maria's needs on the website. She could just subscribe to a website that can allow her to create pages and links with drag and drop and make it running right away.</em>

8 0
3 years ago
Other questions:
  • Which of the following is not anadvantage of simulation?
    14·1 answer
  • Select all that apply. To assist in document sharing, you should?
    12·2 answers
  • 30 points!! What should I do if I plug my computer in and it starts making noises and sounds and it starts smelling.
    9·1 answer
  • Apollo Couriers, a company providing international express mail services, has a proactive customer communications team. The prim
    8·1 answer
  • NEED BY 15 MINUTES PLEASE! WILL MARK BRAINLIEST!You can create special effects in an image using a camera or a photo-editing too
    5·1 answer
  • What is wrong with the following C++ code? How would you fix it? int sum; for (int i=0; i&lt;1000; ++i) sum += i; { printf("Sum
    5·1 answer
  • How to identify mistakes in a html code??​
    14·1 answer
  • PLEASE HELP ME ASAP!!!!
    11·1 answer
  • Create an application named SalesTransactionDemo that declares several SalesTransaction objects and displays their values and th
    12·1 answer
  • Write an if-else statement that determines whether the variable points is outside the range of 9 to 51. If points is outside the
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!