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
jeff has just upgraded from windows 7 to windows 10 and he is confused. He has started several universal apps but he can't figur
Andre45 [30]

Answer: Find the app you want to close, then go to the moveable panel and click the X.

3 0
3 years ago
give the difference between functional and functional tools in the middle of to the circle give importance​
bija089 [108]

Answer:

hakkuna matata is the radious of a circle

5 0
3 years ago
What are the different types of application architecture
ivann1987 [24]

Answer: There are many different types of application architectures, but the most prominent today, based on the relationships between the services are: monoliths and N-tier architecture, microservices, and event-driven architecture and service-oriented architecture.

Explanation: A layered or N-tier architecture is a traditional architecture often used to build on-premise and enterprise apps, and is frequently associated with legacy apps.

A monolith, another architecture type associated with legacy systems, is a single application stack that contains all functionality within that 1 application. This is tightly coupled, both in the interaction between the services and how they are developed and delivered.

Microservices are both an architecture and an approach to writing software. With microservices, apps are broken down into their smallest components, independent from each other. Each of these components, or processes, is a microservice.

With an event-driven system, the capture, communication, processing, and persistence of events are the core structure of the solution. This differs from a traditional request-driven model.

The service-oriented architecture (SOA) is a well-established style of software design, that is similar to the microservices architecture style.

3 0
3 years ago
Suppose Alice, Bob, and Carol want to use secret key technology to authenticate each other. If they all used the same secret key
HACTEHA [7]

Answer:

No. This is not more secure.

Explanation:

this is not more secure than having all of Carol, bob and Alice having the same key.

alice would be able to know Carol's key for her to be able to verify the answer Carol gave to a challenge by her. she would also have to know bob's key to do the same.

any of these 3 would have to know someone else's secret key to verify answers to any challenge.

the challenge is to know the secret keys if the other two and if done, decryption can easily be done and they can impersonate.

8 0
3 years ago
Select the correct answer.
miv72 [106K]

Answer: Format

Explanation: My head

3 0
3 years ago
Read 2 more answers
Other questions:
  • Into which of these files would you paste copied information to create an integrated document?
    13·2 answers
  • How does scarcity affect what gets produced
    5·1 answer
  • You support Richman Investments, a brokerage firm that employs 20 brokers. Each broker has his own client computer, and the firm
    15·1 answer
  • Press the _______ key to move to the next cell in a row.
    12·2 answers
  • By applying styles, _______ formats are being applied each time. A. various B. different C. the same D. similar
    6·2 answers
  • Do debit cards offer the highest level of fraud pretection?
    10·1 answer
  • PLEASE HURRY 30 POINTS
    15·2 answers
  • Complete the sentence.
    5·1 answer
  • The sun can be an excellent source of natural light.<br> True.<br> False.
    8·2 answers
  • YASHARI earns $27,000 per year, is single, and lives in Wyoming. She has $7000 in Direct Subsidized loans and another $19,000 in
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!