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
‘The increased availability of mobile digital devices has had a positive impact on how young people use their free time’. Make a
Law Incorporation [45]
"The increased availability of mobile digital devices has had a positive impact on how young people use their free time."

There are many different views that you could take upon this subject.  

1) You could say that the increased availability of mobile digital devices has allowed children to increase their academic success, by being able to search for and complete assignments using these devices.

2) You could say that the increased availability of mobile digital devices allows for children to occupy themselves by providing games, videos, books, and other things to provide them with entertainment, a learning experience, and more.

Hope this helps!
4 0
3 years ago
According to the text, the three IT trends that are having the greatest impact on the IT environment are:
maksim [4K]

Answer:

B. GRID COMPUTING , ON - DEMAND COMPUTING AND REAL TIME COMPUTING

Explanation:

Grid computing, on-demand computing and real time computing are currently the most impactful information technology processes. The Grid computing from example entails distributed computing whereby computing resources are distributed across different systems for a computing task. This is seen in server systems where a super virtual computer composed of a network of computers are connected to share resources and perform large tasks. This form of computing has majorly affected and improved complex computing tasks today.

On demand and real time computing are also other notable trends in IT with real time computing bringing the power of live and direct coverage of information to our screens and on demand making it possible for the average user to access computing resources as needed such as in the services of cloud computing providers

4 0
3 years ago
Help? brainliest and point
stiks02 [169]

Answer: second one

Explanation:

sorry lol

7 0
3 years ago
Cual es el procedimientos para asistir en el transporte publico a personas discapacitadas
artcher [175]

Answer:

Una discapacidad física o motora en una o más partes del cuerpo obstaculiza las acciones y / o movimientos de la persona con discapacidad. La discapacidad puede surgir porque las partes del cuerpo no han crecido completamente o están dañadas (anomalías físicas) o porque las funciones físicas están alteradas (anomalías funcionales).

En la mayoría de los casos, se proporciona una ayuda a las personas con discapacidades físicas graves para que puedan desenvolverse más fácilmente en la sociedad. Alguien con una discapacidad motora severa en las piernas a menudo usa una silla de ruedas. Las personas con una discapacidad motora de las manos (pérdida de la motricidad fina) o de los brazos pueden compensar esto con un manipulador o ayudas especializadas en tareas, como un dispositivo para comer o un dispositivo para girar las hojas.

Así, todos estos elementos deben ser posibles de ser insertados en los medios de transporte público como forma de ayudar a estas personas a trasladarse por estos medios, es decir, los autobuses, trenes, etc., deben estar adaptados para poder recibir allí a pasajeros en sillas de ruedas o con necesidades motoras especiales.

7 0
2 years ago
What would a match() property that passed the expression /^[0-9]/ check for?
lord [1]

Answer:

E

Explanation:

I took the test

7 0
2 years ago
Read 2 more answers
Other questions:
  • Write a Tip Calculator in code in VMware Fusion
    13·1 answer
  • What is the name of a robot astronaut created by NASA
    14·2 answers
  • There are many careers within the IT industry. _____ are responsible for organizing a company's data, making sure all the data i
    9·1 answer
  • The following program includes fictional sets of the top 10 male and female baby names for the current year. Write a program tha
    15·1 answer
  • If a computer is capable only of manipulating and storing integers, what di themselves? How are these difficulties overcome
    13·1 answer
  • . Database connectivity software is also known as:
    11·1 answer
  • Suppose I create a new kind of Java object, called "Kangaroo". Further suppose that at any given time, all instances of this new
    6·1 answer
  • Implementing an interface means that you are adding to your class any mechanisms defined in an abstract class. Your class essent
    12·1 answer
  • Site at least 3 articles of impact of internet that affect in our daily lives.
    15·1 answer
  • Is Filmora 9 or Final Cut Pro Better for personal use?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!