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
Answer to this problem
True [87]

Answer:

hi..,.................................................

3 0
3 years ago
Alburry and wagga wagga are 130km apart. How many centimeters apart are they on a map with a scale factor of 1:250000?​
lapo4ka [179]

Answer:

The distance from Alburry to Wagga wagga on the map is 52 centimetres

Explanation:

The parameters given are

Actual distance between Alburry and Wagga wagga = 130 km.

130 km = 13,000,000 cm

Scale of map = 1:250000

Therefore;

1 unit on the map is equivalent to 250000 units in real measurements

Hence;

130 \, km \equiv \dfrac{130 \, km}{250000} = \dfrac{130 \times 1000 \times 100 \, cm}{250000}  = \dfrac{13,000,000 \, cm}{250000}  = 52 \, cm

Therefore, on the map, Alburry and Wagga wagga are 52 cm. apart.

7 0
4 years ago
Explain a business scenario where management information systems plays a part.
Leokris [45]

Answer:

In this article, we'll cover what is happening with MIS in both business and ... is when you're notified or your credit card is frozen, depending on the situation.

Explanation:

3 0
3 years ago
Write a program using integers user_num and x as input, and output user_num divided by x three times. Ex: If the input is: 2000
tankabanditka [31]

Answer:

The program written in Python is as follows:

<em>user_num = int(input("Number: ")) </em>

<em>x = int(input("x: ")) </em>

<em>for i in range(1,4): </em>

<em>      user_num = user_num/x </em>

<em>      print(user_num," ")</em>

Explanation:

This line gets user_input from the user

<em>user_num = int(input("Number: ")) </em>

<em />

This line gets x from the user

<em>x = int(input("x: ")) </em>

<em />

This line iterates from 1 to 3

<em>for i in range(1,4): </em>

This line divides user_num by x

<em>      user_num = user_num/x </em>

<em />

This line prints the result of the division

<em>      print(user_num," ")</em>

7 0
4 years ago
What are the common operations performed on character strings?
monitta
<h3>Answer(:</h3>

•concatenation

• scanning

• substringing

• translation

• verification

<h3>if you want to remember means csstv;-)</h3>
7 0
2 years ago
Other questions:
  • An internal _____ refers to a specific representation of an internal model, using the database constructs supported by the chose
    8·1 answer
  • Which of the following is not a benefit of normalization?
    5·1 answer
  • Which entity has the principal responsibility to control the execution of processes?
    14·1 answer
  • Assume that PrecinctReport is a structured type with these fields, address (a string), and three int fields which are counts of
    9·1 answer
  • If your computer has a ________, someone else can gain access to it undetected.
    10·1 answer
  • A set of parentheses that contain zero or more arguments
    12·1 answer
  • Which of the following is a separate summary worksheet in the same workbook?
    14·1 answer
  • PLS HELP I WILL MARK BRAINLIEST
    5·1 answer
  • Create a relational database table in Microsoft Excel for the grocery store of 20 employers.
    12·1 answer
  • When using a self-contained recovery device on a cfc, hcfc, or hfc system with an operating compressor, technicians must?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!