Write a class called beer

Assignment Help Data Structure & Algorithms
Reference no: EM13893763

Write a class called Beer in which it follows this format:

• Instance Variables

. Name
. Alcohol content. Beer is around 0.05 or 5%

• Methodes
. Amason and Mutators the instance variables

• Make sore in the mutator. for the alcohol content contains a check to make sure the value is between 0 and I exclusively.

. Intoxicated

• Takes in a parameter of type double corresponding to weight

• Calculates the number of drinks required to make a person intoxicated based on this fomlula (0.08 0.015) x. Weight / (12 x 7.5 x Alcohol)

 • Returns the number of beers it would take before they are .Intoxicated

Next write another class

       • Contains a main method
       • Creates two instances of the type Beer
       • Have the user enters in the name and alcohol contents for both
       • Next enter in a weight value and it calculates how many drinks it would take for a person at that weight to become intoxicated

       • Print out the results

Example Output

Let's Party! Responsibly...
What's the name of the first beer?
Pabst Blue Hipster
What's the alcoholic content?
0.05
What's the name of the second beer?
Moo Brew
What's the alcoholic content?
0.08
What's the weight of the person consuming said beverages? 150
It would take 3.166 Pabst Blue Hipster beers to become intoxicated. It would take 1.979 Moo Brew beers to become intoxicated.
Later Tater

Reference no: EM13893763

Questions Cloud

Why is this dimension useful to understanding the country''s : Why is this dimension useful to understanding the country's culture?
Question regarding the clothing consumption : Describe the conclusions of your analysis assuming the same tax is present in both the clothing and the food markets. Further assume that the tax revenue is returned in equal lump-sum transfers to all citizens.
What is a revertant mutation : What is a revertant mutation (in general) and What was the genetic event that caused the original lac- mutation (ie did not allow for the expression of lacZ, lacY, or lacA)?
Create opportunities for conflict and cohesion : create opportunities for conflict and cohesion
Write a class called beer : Write a class called Beer in which it given this format:- Intance variables, methodes, intoxicated Etc.
What are the determinants of supply : What are the determinants of supply? How is the supply curve impacted by changes in determinants? What is the difference between a change in supply and a change in the quantity supplied and what are the causes of each?
Beginning and ending amounts of equity : a. Office Store has assets equal to $123,000 and liabilities equal to $47,000 at year end. What is the total equity for Office Store at year end?
Describe the biochemical composition, structure : Describe the biochemical composition, structure, and replication of DNA. Detail the role of specific RNA's in the process of protein transcription and translation.
How a current employee''s social media use could jeopardize : how a current employee's social media use could jeopardize their job and professionalism in the workplace.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd