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

  Auditing focuses on failures

Under normal situations, auditing focuses on failures to access rather than successful accesses. Explain why it might be a good concept to audit successful access to documents in a directory that contains highly confidential documents.

  Creating java programming scripts

Discuss how does a programmer typically get access to a Graphics object when coding an applet?

  Draw the recursive process of quicksort

Draw the recursive process of Quicksort and Mergesort for sorting the sequence {5, 1, 2, 9, 7}. You will get a recursion tree for Quicksort and Mergesort respectively. What are their depths?

  Data structures and algorithm design

Data Structures and Algorithm Design

  How many different undirected graphs are there with v vertix

Graph enumeration: How many different undirected graphs are there with V vertices and E edges (and no parallel edges)? Assume the graph is represented in adjacency-list form

  Conduct time complexity analysis of the algorithm

Hand test your algorithm using your allocated 10-element long list of alphabetic charactersas an illustrative/working example (see the Data Set below),

  Design a flowchart or pseudocode

Design a flowchart or pseudocode for the following: A program that accepts the following data about one customer's bill: customer area code (three digits), customer phone number (seven digits), and number of text messages sent. Display all the dat..

  Find combination of projection and inverse projection map

Find the combination of projection and inverse projection maps which finds all authors by whom I have horror books

  Queue and content of countdown timer-using priority queue

At time 230 five processes (P1 - P5) are waiting for timeout signal. They are scheduled to wake up at times: 260, 320, 360, 430, 450. Using priority queue with time differences illustrate queue and content of countdown timer at time 230.

  Find a shortest-path from u to v

find a shortest-path from u to v, and we have a *valid* heuristic, i.e.: For every node w, we have a value a(w) such that the distance from w to v in G is at least a(w) for all nodes w.

  Explain types of information systems

Question 1. Explain five types of information systems, and give an example of each. Question 2. Describe three common reasons for a systems request. Try and find one not listed in the text.

  Choose a combination of meaningful data structures

Describe a mechanism to access the telephone customer records by telephone #. Assume that we have a huge data in hand, say a million records or so.

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