SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 305 Weeks Ago, 1 Day Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 09 Nov 2017 My Price 10.00

Unauthorized distribution (including uploading to any non-Regis Internet website)

Can someone please help me out with this assignment?

©Regis University, All Rights Reserved Unauthorized distribution (including uploading to any non-Regis Internet website) violates copyright law Regis University CC&IS CS210 Introduction to Programming Java Programming Assignment 3: Expressions, class Methods, and Parameter passing Problem Summary A person would like to know how to determine his/her blood alcohol content (BAC). In Colorado, the legal driving limit is 0.08. Blood alcohol content (BAC) is usually expressed as a percentage of ethanol in the blood in units of mass of alcohol per volume of blood or mass of alcohol per mass of blood. So, for example, in North America a BAC of 0.1 (0.1% or one tenth of one percent) means that there are 0.10 g of alcohol for every dL (deciliter) of blood. A standard American drink contains 0.5 US fl oz (15 ml) of alcohol by volume, and is equivalent to: 12 oz of beer (5% alcohol) 5 oz of wine (12% alcohol) 1.5 oz shot of 80 proof liquor (40% alcohol) This means that there are 14 grams of alcohol in one standard American drink. Back in 1932, Swedish scientist Eric Widmark established the following formula for determining a person’s initial BAC is: ??? = ??????? ???????? (?? ?????) ?????? (?? ?????) ? ?????? ???????????? (?? ??????) ? ??? In the original formulas, the volume distributions of alcohol in the blood by gender were fixed values. One value (0.68) was used for males, and another value (0.55) was used for females. However, in 1986, English chemist Robert Forrest came up with a better way to calculate the volume distribution (by gender), taking the person’s weight and height into account. ???? ?????? ???????????? = ?. ???? − (?. ?????? ? ??????) ??????? ?????? ?????? ???????????? = ?. ???? − (?. ???? ? ??????) ??????? where weight is in kilograms and height is in meters Using the above formulas allow a person to calculate their BAC immediately after drinking. The volume distribution is calculated first, and then the volume distribution is used in the Widmark formula. However, most of the time, people consume drinks over a period of time. So the current BAC is further calculated by: ??????? ??? = ??? − (??????? ???? ?? ????? ? ????????? ????) The metabolic rate, characterizes the speed of alcohol absorption and elimination. Females demonstrated a higher average rate of elimination (mean, 0.017; range, 0.014 to 0.021) than males (mean, 0.015; range, 0.013 to 0.017). Due to these factors, and other differences between people, the BAC calculated in this program is only an ESTIMATE. For this program, we will use the low end of the ranges. ©Regis University, All Rights Reserved Unauthorized distribution (including uploading to any non-Regis Internet website) violates copyright law Program Overview In your last two Alice assignments, you:  Created programs that were broken down into multiple methods.  Used variables to store user input and calculation results.  Used parameters and return values to pass information between methods. This assignment will require you to do the same things in Java. This program will contain:  A main method to read the inputs from the user, convert some values, and call the other methods.  A method (1) to display a description of what the program will do.  A method (2) to calculate the volume distribution of alcohol in the body for men.  A method (3) to calculate the volume distribution of alcohol in the body for women.  A method (4) to calculate the current BAC.  A method (5) to display the results of the program. Program Requirements 1. Create a new Java NetBeans project for this program, named as follows: LastnameJavaAssn3 For example: SmithJavaAssn3 2. Within the project, create only one Java class, named as follows: LastnameJavaClassName For example: SmithBACcalculator 3. The methods described above will be implemented within this class, as follows: NOTE: All of these methods should have descriptive names that include a verb, describing the methods action. Method 1: A method to display an explanation of what the program will do to the user. o This method will not have any parameters or a return value. Methods 2 & 3: Two methods to calculate the volume distribution of alcohol, one method for men and one method for women. These methods will: o Have 2 parameters: weight in kilograms and height in meters o Compute the volume distribution of alcohol in the body using the formulas on page 1  Use a method from the Math library to compute the square. o Return a double value: the volume distribution of alcohol in the body Method 4: A method to calculate the current BAC. This method will: o Have 5 parameters:  weight in pounds  volume distribution to use  metabolic rate to use  number of drinks consumed  number of hours elapsed ©Regis University, All Rights Reserved Unauthorized distribution (including uploading to any non-Regis Internet website) violates copyright law o Define and use two local (non-static) constants, that contain the values for:  the number of grams in one pound (453.592)  the grams of alcohol in one drink (14) Reminder: CS210 coding standards require: Local constants will be declared at the top of the method in which they are used, before any other executable statements or variable declarations. o Convert the weight to grams. o Calculate the grams of alcohol in the drinks consumed. o Compute the initial BAC using the Widmark formula on page 1. o Compute the current BAC using the last formula on page 1. o Return a double value: the current BAC. Method 5: A method to display the results, with no return value. This method will: o Have 4 parameters:  number of drinks consumed  number of hours elapsed  current male BAC  current female BAC o Use the println and printf statements to:  Display a few blank lines before displaying any output  Display the output, exactly as shown in the sample below.  Both BAC values should be displayed to 3 decimal places, and should line up.  Display one final blank line. 4. Within the main method, write the Java code to: NOTE: The main method will be defined first, at the top of the class, before all the other methods.  Define and use four local (non-static) constants, that contain the values for: o the number of pounds in one kilogram (2.20462) o the number of inches in one meter (39.3701) o the metabolic rate for men (0.015) o the metabolic rate for women (0.014)  Call method 1 to display the program description.  Prompt for (using descriptive prompts) and read the user inputs (height in inches, weight in pounds, number of drinks consumed, number of hours elapsed while drinking). ©Regis University, All Rights Reserved Unauthorized distribution (including uploading to any non-Regis Internet website) violates copyright law Sample Display and Input from main method  Convert the weight to kilograms and the height to meters, and store the results into new variables.  Call the volume distribution calculations methods (methods 2 and 3) to separately compute the volume distribution for men and for women, and save the results returned from each.  Call the current BAC calculation method (method 4) twice: o The first call should pass in the volume distribution computed for men and the metabolic rate for men. o The second call should pass in the volume distribution computed for women and the metabolic rate for women. o Save the results returned from each call.  Call the method to display the results (method 5) as shown below. Sample Results Output 5. You must also define and use: o Local variables for each input or computed value, defined using descriptive names and appropriate data types. WARNING: The methods must be implemented exactly as specified in these requirements. If your program produces correct output, but you did not implement the methods as specified (with correct parameter passing and return values), you will lose a significant number of points. This program implements a Blood Alcohol Content (BAC) Calculator Given a drinker’s weight and height, and the number of drinks consumed over how many hours, it will compute the person’s approximate current blood alcohol content. Please enter drinker's height (in inches): 66 Please enter the drinker's weight (in pounds): 150 How many drinks were consumed? 4 How many whole hours have elapsed since drinking began? 2 After drinking 4 drinks, in 2 hours: Current BAC for a male will be approximately 0.084 Current BAC for a female will be approximately 0.116 ©Regis University, All Rights Reserved Unauthorized distribution (including uploading to any non-Regis Internet website) violates copyright law Coding Standards The program must also follow the CS210 Coding Standards from Content section 6.10. You must include the following comments: o Comments at the top of the file, above the main class, describing what the class does  Include tags with the author’s name (i.e. your full name) and the version of the code (e.g. @version 1.0, Java Assn 3) o Comments at the top of each method, above the method header, describing what the method does (only this method – do not refer to actions of any other methods)  Include tags with names and descriptions of each parameter and return value. Delete any default comments supplied by the IDE that you did not use. See below for an outline of what your code should look like. Debugging and Testing Run, test, and debug your Java program, until it works. Then test your program with different inputs to make sure it provides correct results. Outline of what your .java program code should look like: /* * The blood alcohol content calculator program will do the following: * Put program description here (expand to as many lines as needed) */ import java.util.Scanner; /** * @author Mary Jones // your full name * @version 1.0, Java Assn 3 */ public class JonesBACcalculator { public static void main(String[] args) { // Constant definitions go here // Call to method 1 goes here // Statements to read user input & do conversions go here // Statements to call other methods go here } /** * Method 1 description */ public static datatype method1name () { // Method 1 body statements go here } ©Regis University, All Rights Reserved Unauthorized distribution (including uploading to any non-Regis Internet website) violates copyright law /** * Method 2 description * * @param name - description of parameter * (one @param comment line for each parameter) * @return name - description of return value */ public static datatype method2name (datatype parameter, ...) { // Method 2 body statements go here } /** * Method 3 description * * @param name - description of parameter * (one @param comment line for each parameter) * @return name - description of return value */ public static datatype method3name (datatype parameter, ...) { // Method 3 body statements go here } /** * Method 4 description * * @param name - description of parameter * (one @param comment line for each parameter) * @return name - description of return value */ public static datatype method4name (datatype parameter, ...) { // Method 4 body statements go here here } /** * Method 5 description * * @param name - description of parameter * (one @param comment line for each parameter) */ public static datatype method5name (datatype parameter, ...) { // Method 5 body statements go here } } Submission This programming assignment is due by midnight of the date listed in the Course Assignments by Week. Submit your program source code (the .java file) to the Java Prog Assn 3 assignment submission folder (located under the Assignments/Dropbox tab in the online course). For example: SmithBACcalculator.java ©Regis University, All Rights Reserved Unauthorized distribution (including uploading to any non-Regis Internet website) violates copyright law Grading Programs will be graded using the rubric that is linked on the same assignment page as this file. WARNING: Programs submitted more than 5 days past the due date will not be accepted, and will receive a grade of 0.

Attachments:

Answers

(5)
Status NEW Posted 09 Nov 2017 02:11 PM My Price 10.00

----------- He-----------llo----------- Si-----------r/M-----------ada-----------m -----------Tha-----------nk -----------you----------- fo-----------r y-----------our----------- in-----------ter-----------est----------- an-----------d b-----------uyi-----------ng -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------. P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll -----------be -----------qui-----------ckl-----------y

Not Rated(0)