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
matrenka [14]
3 years ago
10

Write a program that prompts the user to input the number of quarters, dimes, and nickels. The program then outputs the total va

lue of the coins in pennies.
Computers and Technology
1 answer:
Anni [7]3 years ago
7 0

Answer:

The program to this question can be given as follows:

Program:

#defining variable quarters, dimes, and nickels.

quarters=int(input("Enter value of quarters: ")) #input value by user  dimes=int(input("Enter value of dimes: ")) #input value by user  nickels=int(input("Enter value of nickels: ")) #input value by user  

#defining variable pennies

pennies = ((25*quarters)+(10*dimes)+(5*nickels)) #calculate value in pennies variable

print('Total number of coins in pennies is: ',pennies)#print value

Output:

Enter value of quarters: 3

Enter value of dimes: 2

Enter value of nickels: 1

Total number of coins in pennies is:  100

Explanation:

In the above python program code, firstly three variable "quarters, dimes, and nickels", all of these variable uses input function, that is used to take input value from the user side, in these variable, an int is used that defined, that user input only integer value.

  • After taking input from the user a new variable "pennies" is defined, which is uses the user input values and calculates its addition.
  • In the next line, print function is used, which uses variable "pennies" to print its calculated value.
You might be interested in
Shortly after its introduction, the unix software was rewritten in the popular c programming language.?
nirvana33 [79]
Of course it was rewritten in the popular C++ Programming Language.

a. True
5 0
3 years ago
What is the output of the following C++ program?
KIM [24]

Answer:

Output:<em> </em><em>15 11/16 inches</em>

Explanation:

#include <iostream>

using namespace std;

////////////////////////////////////////////////////////////////////////

class InchSize {

public:

   InchSize(int wholeInches = 0, int sixteenths = 0);

   void Print() const;

   InchSize operator+(InchSize rhs);

   

private:

   int inches;

   int sixteenths;

};

InchSize InchSize::operator+(InchSize rhs) {

   InchSize totalSize;

   totalSize.inches = inches + rhs.inches;

   totalSize.sixteenths = sixteenths + rhs.sixteenths;

   

   // If sixteenths is greater than an inch, carry 1 to inches.

   if (totalSize.sixteenths >= 16) {

       totalSize.inches += 1;

       totalSize.sixteenths -= 16;

   }

   return totalSize;

}

InchSize::InchSize(int wholeInches, int sixteenthsOfInch) {

   inches = wholeInches;

   sixteenths = sixteenthsOfInch;

}

void InchSize::Print() const {

   cout<<inches<<" "<<sixteenths<<"/16 inches"<<endl;

}

////////////////////////////////////////////////////////////////////////

int main() {

   InchSize size1(5, 13);

   InchSize size2(9, 14);

   InchSize sumSize;

   sumSize = size1 + size2;

   sumSize.Print();

   return 0;

}

////////////////////////////////////////////////////////////////////////

sumSize variable was printed in the end. Print() prints the calling object's inches and sixteenths variables' values.

sumSize's inches is equal to size1 plus size2's inches.

Because the sum of sixteenths was greater than 16, sumSize's sixteenth was decreased by 1 and inches was increased by 1.

3 0
4 years ago
Which of the following best explains the different between Cut and Copy? a. When you copy text you are permanently deleting it,
Vilka [71]
B. When you copy text it remains in its original location and places it on the clipboard. Cutting text removes it from its original location and places it on the clipboard

5 0
3 years ago
Read 2 more answers
An end-user device requires a specific IP address every time it connects to the corporate network. However, corporate policy doe
sesenic [268]

Answer:

DHCP reservation  is the correct answer.

Explanation:

It is the Internet Protocol assignment which is not temporary. It is the particular address of the Internet Protocol within a DHCP set, which is not temporarily assigned to a particular DHCP client for lease use.

So, the device of the last user required the address of the Internet Protocol whenever they linked to the company's server. The following reservation provides the permission to use static addresses of the Internet Protocol without affecting the company's server.

6 0
3 years ago
Why is self-esteem important in self-representation
german
Hello! Self-esteem is important in self-representation, because the way you feel yourself can affect how you represent yourself as well. For example, if you have low self-esteem, you may present yourself as sad and shameful. However, if you have high self-esteem, you present confidence and happiness to other people.
3 0
4 years ago
Other questions:
  • What would the output be if we replaced the math expression in the last line with dependents * ((yearsOnJob - 1) * 4) - 6 and th
    5·1 answer
  • • Describe the steps in detail that the operating system performs to handle interrupts, including ISRs, the stack, and hardware?
    5·1 answer
  • The set of instructions that directs the computer to perform a variety of tasks is known as a
    9·1 answer
  • Help me please............
    6·2 answers
  • What is thhe name of service included with windows server operating systemthat manages a centralized database containing user ac
    5·1 answer
  • What specific tool allows you to create GPOs, view a GPO's settings, link and unlink GPOs with containers, and manage the inheri
    10·1 answer
  • In ____________, a large address block could be divided into several contiguous groups and each group be assigned to smaller net
    7·1 answer
  • Consider an array of integers consisting of the numbers: 8 12 19 32 45 55 67 72 89 90 92. Suppose the binary search algorithm is
    11·1 answer
  • Please help i have 15 mins
    5·1 answer
  • Assume that the client wants to retrieve the www.cnn home page but has no information about the www.cnn web server IP address. D
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!