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

  Show the brute-force attack against single des

Your task is to show that breaking the scheme is approximately as difficult as a brute-force attack against single DES.

  Design algorithm to find the average miles per gallon

Design an algorithm to find the average miles per gallon. Sample data: 68723, 71289, 15.75, 16.30, 10.95, 20.65, 30.00.

  Give an algorithm that takes an n-node path g with weights

Give an algorithm that takes an n-node path G with weightsand returns an independent set of maximum total weight. The runningtime should be polynomial in n, independent of the values of theweights

  Write an algorithm that converts a decimal number

Write an algorithm that converts a decimal number between 0 and 15 into its 4 bit unsigned binary representation.

  Explain pros and cons of algorithm

You can start by taking 3-4 schemes for example and then show each step of the GA based algorithm numerically. Explain each step (selection, cross-over, mutation) in detail. You can show in any way as long as each step is shown and explained numer..

  Design and develop a linked list

Your first task in developing the application for tracking contributors is to load a list of the people who are helping the cause. Design and develop a linked list, implemented as a stack, to track all of the contributors

  Design and build a prototype data warehouse

Design and build a prototype data warehouse using the data on Spend over £500 in the Department of Energy and Climate Change for the financial year 2012-2013 (April 2012 to March 2013 inclusive).

  Implement a nice graph datastructure

Implement a nice graph datastructure. Implement two different greedy graph coloring algorithms. Shortest path algorithm and MST algorithms.

  Creating a bash script

Create a Bash script that will prompt for the user's first and last names and store the responses in two variables. Then it will show the stored data in the format "You entered lastname, firstname."

  Question 1you are required to create a detailed analysis

question 1you are required to create a detailed analysis for each of the following array-based sorting algorithmsa

  Lets examine the heap enqueuedequeue operations with

lets analyze the heap enqueuedequeue operations with different assumptions. imagine that the elements already in the

  I this assignment you will implement the compact

in this assignment you will implement the compact representation of the compressed suffix trie adt for dna analyses.a

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