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
AleksAgata [21]
2 years ago
14

Need this java code its on zybooks. given two integers as user inputs that represent the number of drinks to buy and the number

of bottles to restock, create a vendingmachine object that performs the following operations:
purchases input number of drinks

restocks input number of bottles

reports inventory

the vending machine is found in vendingmachine.java. a vendingmachine's initial inventory is 20 drinks.


ex: if the input is:


5 2

the output is:


inventory: 17 bottles.


the file that comes with it:


// simulates a simple vending machine with operations to purchase drinks and check inventory.

public class vendingmachine {


// number of bottle in stock

private int bottles;


// initial inventory is 20

public vendingmachine(){

bottles = 20;

}


public void purchase(int amount){

bottles = bottles - amount;

}


public int getinventory(){

return bottles;

}


public void restock(int amount){

bottles = bottles + amount;

}


public void report(){

system.out.println("inventory: " + bottles + " bottles");

}


}
Computers and Technology
1 answer:
grandymaker [24]2 years ago
7 0

Answer:

5 bottles left and plus the amount of water they used

Explanation:

You might be interested in
What do you mean by computer ethics?​
STALIN [3.7K]

Answer:

Computer ethics is a field of applied ethics that addresses ethical issues in the use, design and management of information technology and in the formulation of ethical policies for its regulation in society.

3 0
2 years ago
Which things computer case contains
Ronch [10]

Inside the case are the components that make up the computer itself, such as the RAM memories, the processor and the hard disk, all of which are directly or indirectly connected to the motherboard. In addition, the case allocates the power suplly, which is responsible for supplying power to the computer.

<h3>What is a computer case?</h3>

The case is the hardware component used to house most parts of a computer. It is inside it that components such as CPU, motherboard, SSD, video card and power supply are placed.

In addition, it is where the outputs for connections to other equipment are found, such as USB and HDMI outputs, plug for sound box and microphone and input for memory card.

The case has the important function of protecting the internal components of a computer from knocks, heat, light, moisture and dust. That's because most of the electronic components inside a computer are very sensitive and need this protection.

It is also used to connect to other hardware components, such as a monitor, keyboard, mouse and headset, through the various outputs provided on its exterior.

See more about computing at: brainly.com/question/15707178

#SPJ1

5 0
2 years ago
Both the original location and destination must be visible in file explorer when you
Xelga [282]

When you drag-and-drop files

Dragging and dropping files between two open windows is a quick way to transfer files and folders. If the file or folder and both the original and destination location where you want to transfer it are visible, you can simply drag the item/items from one location to the other. Dragging is unlike moving a file of folder. Dragging from one disk to another copies the file/folder so that it appears in the two locations.

5 0
3 years ago
A light or optical microscope most commonly used is called a(n) _____. bright-field microscope dark-field microscope electron mi
puteri [66]
I think a bright field is most commonly used
5 0
4 years ago
Read 2 more answers
Web sites use _____ to track users while they are on the site.
Liula [17]
These are files called cookies. =)
6 0
3 years ago
Other questions:
  • What is true about using the reserved word super?
    9·1 answer
  • the list of available fonts in the fonts gallery may differ, depending on what fonts you have installed and the type of printer
    14·1 answer
  • describe what measures should have been taken by the educational service and test preparation provider to avoid the security bre
    11·1 answer
  • Dr.Sanchez is creating a quiz for a history class. It will have true or false questions. What kind of variable will be needed to
    10·2 answers
  • What is a graphics card?
    5·1 answer
  • You do not have to move your fingers to click the top row reach keys.<br> 1. True <br> 2. False
    15·1 answer
  • BOTH QUESTIONS ONLY FILL IN C++ CODEWrite a copy constructor for CarCounter that assigns origCarCounter.carCount to the construc
    12·1 answer
  • Write the application of computer in education and communication​
    9·1 answer
  • Contrast between functions of sort and sorted in python . ​
    10·1 answer
  • A maxillary partial denture will have a ____ connector, and the mandibular partial denture will have a ____ connector.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!