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
Rainbow [258]
3 years ago
7

Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per l

ine. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies.
Computers and Technology
1 answer:
alexandr1967 [171]3 years ago
7 0

Answer:

a=input("Amount in pennies")

b=int(a)

dollars=0

dimes= 0

quarters=0

nickels=0

pennies = 0

dollars = int(b/100)

b= b- dollars *100

quarters=int(b/25)

b=b-quarters*25

dimes = int(b/10)

b = b -dimes*10

nickels=int(b/5)

b=b - nickels * 5

pennies = b

print(dollars)

print(dimes)

print(nickels)

print(pennies)

Explanation:

The required program is in answer section. Note, the amount is entered in pennies.

You might be interested in
Write a program for Horizon Phones, a provider of cellular phone service. Prompt a user for maximum monthly values for talk minu
Anarel [89]

Answer:

mport java.util.Scanner;

public class CellPhoneService

{

    public static void main (String args[])

    {

         Scanner sc=new Scanner(System.in);

         System.out.println("Enter the Talk minutes");

         int talkmin=sc.nextInt();

         System.out.println("Enter the text message");

         int textmsg=sc.nextInt();

         System.out.println("Enter the Gigabyte Data");

         int gbdata=sc.nextInt();

         if(talkmin<500 && textmsg==0 && gbdata==0)

         System.out.println("PLAN A IS RECOMMENDED FOR THIS USER at 49$ per month");

         else if(talkmin<500 && textmsg>0 && gbdata==0)

         {

              System.out.println("PLAN B IS RECOMMENDED FOR THIS USER at 55$ permonth");

         }

         else if(talkmin>=500 && textmsg<100 && gbdata==0)

         {

              System.out.println("PLAN C IS RECOMMENDED FOR THIS USER at 61$ permonth");

         }

         else if(talkmin>=500 && textmsg>=100 && gbdata==0)

         {

              System.out.println("PLAN D IS RECOMMENDED FOR THIS USER at 70$ permonth");

         }

         else if(gbdata>0 && gbdata<2)

         {

              System.out.println("PLAN E IS RECOMMENDED FOR THIS USER at 79$ permonth");

         }

         else if(gbdata>=2)

         {

              System.out.println("PLAN F IS RECOMMENDED FOR THIS USER at 87$ permonth");

         }

    }

}

Explanation:

  • Take the talk minute and text message as input from user.  
  • Apply the conditional statement to check if talk minute is less than 500 along with text message and GB data having a value 0.
  • At last check if GB data is greater than or equal to 2, then print the relevant response.
3 0
3 years ago
Why coaxil cable called coxial cable ?
Reika [66]

Answer: Coaxial Cable has got two physical channel layer in same axis of the cable that is why it is known as "coaxial cable".

Explanation: Coaxial cable is the main example for television cable and telephone cable that have two physical layer of channels and are separated by a insulating material layer and the outer layer working a ground section.The axis of both the physical layer are present on the same axis of the cable and thus is known as coaxial cable. They cable is usually made up of copper and some other materials.

7 0
3 years ago
Read 2 more answers
Write the definition of a method, isReverse, whose two parameters are arrays of integers of equal size. The method returns true
Marat540 [252]

Answer:

   public static boolean isReverse(int [ ]a, int [ ]b ){

       for (int i=0;i<a.length;i++)

       {

           if(!(a[i] == b[a.length-i-1]))

               return false;

       }

       return true;

       }

Explanation:

Using a for loop, we go through the elements of the first array. The if comapres and checks if any of the values are not the same as the appropriate value on the other array, if it is so, then it is not a reverse, and we return false. else  we return true.

7 0
3 years ago
If you’d like to have multiple italicized words in your document, how would you change the font of each of these words
Alex787 [66]

Answer:

Use styles and modify the font of the default style

Explanation:

4 0
2 years ago
Suppose I define some structure type ( studentInfo), then I declare an instance of it and I decide to also create a pointer to t
Nookie1986 [14]

Answer:

a. (p*Main).age = 20;

Explanation:

Pointers use ->

where as normal variable use . to access its members

pMain is the pointer.

*pMain is the value inside pMain.

pMain->age = 20;

This statement equals to

(*pMain).age = 20;

Answer is option a.

8 0
2 years ago
Other questions:
  • Given a computer running four types of instuctions, named classes A through D, calculate the execution time of a program that ha
    5·1 answer
  • Your friend sees an error message during Windows startup about a corrupted bootmgr file. He has another computer with a matching
    12·1 answer
  • epic poem - long narrative poem about heroic deeds about pharrell williams of the happy song please help i need the right answer
    11·1 answer
  • ____ is a method of querying and reporting that takes data from standard relational databases, calculates and summarizes the dat
    11·1 answer
  • What is gender bias?
    9·1 answer
  • CAN SOMEONE PLEASE HELP ME OUT I REALLY NEED THE ANSWER!
    14·1 answer
  • Write a program that produces an expense report for a trip to Lagos, Nigeria. Use the Internet to research the cost to travel to
    13·1 answer
  • Who is willam afton from five nights at freddy
    13·2 answers
  • Fields &amp; Methods
    5·1 answer
  • Create a file using any word processing program or text editor. Write an application that displays the files, name, containing f
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!