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
enyata [817]
3 years ago
9

Write a program. Commence the change to be dispensed from a vending machine. An item machine can cost between $0.25 send a dolla

r in five cent and crew( 25 30 35 90 95 or 100 and the Machine accepts only a single dollar to pay for the item for example a possible
Computers and Technology
1 answer:
SSSSS [86.1K]3 years ago
4 0

Answer:

Explanation:

The objective of this question is to write a java program for a vending machine.

/* This program finds out what amount the vending machine is going to dispense. A given item in the machine can cost between $0.25 and a dollar in five-cent increments (25, 30, 35, 40...90, 95 or 100), and the machine accepts only a dollar bill to pay for the item. */

// Compile: javac PP10. java

// Run: java PP10

// imported the scanner class from util package.

import java. util. Scanner;

//class declaration

public class PP10 {

// main method is defined here.

       public static void main(String[]   args)

          {

// declaration of the variables.

             Scanner keyboard=new Scanner (System.in):

//taking the string type input

              int nl, amount, n2, n3, n4, n5;

            System.out.println("Enter price of item (from 20

cents to a dollar, in 5-cents) :");

             n1=keyboard. nextInt ();

            System.out.println("You bought an item for "+n1+"

cents and gave me a dollar");

            System.out.println ("so your change is ");

//the amount is first calculated.

          amount=100-n1;

// quarter value is calculated

            n2=amount/25;

// rest amount is get here.

            amount=amount%25;

// dime value is calculated

             n3-amount/10;

// rest amount is calculated

            amount=amount%10;

// value of nickel is calculated here

            n4=amount/5;

// rest amount is calculated

            amount=amount%5;

//at last the number of pennies is get

            n5=amount;

// Display output

              System. out . println(n2+" quarters") :

              System. out . println(n3+" dimes") ;

              System. out . println(n4+" nickels") ;

              System. out . println(n5+" pennies") ;

       }

  }

Output:

Enter the price of the item (from 20 cents to a dollar, in 5 - cents):

So, you bought an item for $0.45 and gave me one dollar; thus, your change is

2 quarters

0 dimes

1 nickel

0 pennies

You might be interested in
What is a user data?
Rom4ik [11]

Answer:   Any data the user creates or owns.

Explanation:

the user being the one on the otherside of the computer, usually a human.

but examples of user data are intalled programs, uploads, word documents created by user (computer user)

7 0
3 years ago
After an entry in the medical record has been written or keyed and an error is discovered, what procedure should be followed to
Readme [11.4K]

Answer:

(C) Draw a line through the error; then call the patient’s physician.

Explanation:

According to my research on medical procedures, I can say that based on the information provided within the question the best procedure that should be taken in this situation would be to draw a line through the error; then call the patient’s physician. By doing so you get rid of the the error and by telling the patient's physician you get rid of any possibility of the physician still thinking that the error was something that was already done.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

5 0
3 years ago
That's the code that's was already provided with the assignment
Law Incorporation [45]

Answer:

Code:-

// Program takes a hot dog order

// And determines price  

using System;

using static System.Console;  

class DebugFour1

{

   static void Main()

   {

       const double BASIC_DOG_PRICE = 2.00;

       const double CHILI_PRICE = 0.69;

       const double CHEESE_PRICE = 0.49;

       String wantChili, wantCheese;

       double price;

       Write("Do you want chili on your dog? ");

       wantChili = ReadLine();

       Write("Do you want cheese on your dog? ");

       wantCheese = ReadLine();

       if (wantChili == "Y")

       {

           if (wantCheese == "Y")

               price = BASIC_DOG_PRICE + CHILI_PRICE + CHEESE_PRICE;

           else

               price = BASIC_DOG_PRICE + CHILI_PRICE;

       }

       else

       {

           if (wantCheese == "Y")

               price = BASIC_DOG_PRICE + CHEESE_PRICE;

           else

               price = BASIC_DOG_PRICE;

       }

       WriteLine("Your total is {0}", price.ToString("C"));

   }

}

8 0
2 years ago
The results of the spec cpu2006 bzip2 benchmark running on an amd barcelona has an instruction count of 2.389e12, an execution t
saw5 [17]

Answer:

CPI = 0.94

Explanation:

The formula for execution time is given below:

Execution time = clock cycles * cycle time

As Execution time = 750 s

clock cycle time = 0.333 ns = 0.333 * 10^-9

so putting these values in the above formula, we get

750 = clock cycles * ( 0.333 * 10^-9 )

clock cycles = 750 / ( 0.333 * 10^-9 )

clock cycles = 2.25 * 10^12

As the results of the spec cpu2006 bzip2 benchmark running on an amd barcelona has an instruction count = 2.389 * 10^12

and the formula for clock cycles is:

clock cycles = number of instructions * CPI

CPI = clock cycles / number of instructions

CPI = 2.25 * 10^12 / 2.389 * 10^12

CPI = 0.94

5 0
3 years ago
Clicking the ____ deletes all letters in a box.
Luda [366]
Clicking Ctrl+a and backspace deletes all letters.<span />
6 0
3 years ago
Other questions:
  • Why is it unlikely that you will find the ip address 192.168.250.10 on the internet?
    15·1 answer
  • Which hardware component is most suspect if a user can barely make out
    10·1 answer
  • What is a new ransomware program that encrypts your personal files and demands payment for the files' decryption keys? Multiple
    10·1 answer
  • In most programming languages, the compiler carries a preprocessing step to determine if certain statements will compile. For in
    7·1 answer
  • What is the term for an understanding about the processes that underlie memory, which emerges and improves during middle childho
    7·2 answers
  • What is Sleep mode? Check all of the boxes that apply.
    12·1 answer
  • IF YOU PLAY SURVIV&gt;IO WITH ME RIGHT NOW I WILL GIVE YOU BRAINLIEST<br> AND IM NOT KAPPING
    5·1 answer
  • Hi, what’s up, im really bored and have nothing to do
    7·2 answers
  • Which header will be the largest?<br><br> Hello<br><br> Hello<br><br> Hello<br><br> Hello
    14·2 answers
  • DUE SOON NEED HELP FAST!!
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!