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

  Calculate the cost of sorting relation in seconds

Assume a flash storage device is used instead of disk, and it has seek time of 1 microsecond and transfer rate of 40 MB per second. Recompute the cost of sorting the relation in seconds.

  2n-1 comparisons are necessary in the worst case

Prove that 2n-1 comparisons are necessary in the worst case to merge two sorted lists containing n elements each.

  Finding approximation algorithm and ratio of the algorithm

finding approximation algorithm and the ratio of the algoirthm.

  Analyze algorithm to determine length of longest substring

Explain and analyze the algorithm to determine the length of longest substring that appears both forward and backward in an input string T[1 . n].

  Users and it organizations arm against phishing attacks

How users and IT organizations must arm themselves against these attacks?

  How to move from any spanning tree to other spanning tree

Illustrate that it is possible to move from any spanning tree T to any other spanning tree T0 by performing series of edge-swaps, that is, by moving from neighbor to neighbor.

  Proof the correctness of the algorithm

Take a look at the sudocode of FIND-MAXIMUM-SUBARRAY. Try to proof the correctness of the algorithm.

  Question about isdn

Today ISDN cost $40 every month for BRI service which includes 1 D Channel and 2 B Channels. Every channel is capable of transmitting 64kbps of voice, data, video or fax for a total of 128 kbps.

  System analyst

A huge, well regarded supplier of key raw materials to your corporation's production process requires a year-end summary report of totals purchased from it.

  Creating database for charity event

Your Project is to organize a charity event. You must use at least two events, one of which must be a Windows program such as Word, WordPad, or Paint.

  Determine the average complexity of an enqueue

question suppose we implement a priority queue as a heap. assume the queue has thousands of elements. suppose further

  Use sequential search algortithm to locate the number

These numbers should be stored in an array. Use the sequential search algortithm to locate the number entered by the user. If the number is in the array, the program should display a message.

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