Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

Test 1

You are permitted the use of pre-written notes, previous labs and the textbook. You are NOT permitted the help of the Lab TA or the Internet. Any cheating will result in a report Academic Integrity Violation and an ‘F' in the course.

Document your code with inline comments and javadoc comments. This is a majot portion of your grade.

Read this entire document before starting to write code.

Write and test a Java project that satisfies the following requirements:

Create a measurement converter project that can convert between grams, ounces, pounds and kilograms.

The constants for conversion are:

1 ounce = 28.35 grams
16 ounces = 1 pound
1 kg = 1000 grams

Write a class definition file named WeightConverter that has these fields:

weightInOunces
weightInPounds
weightInGrams
weightInKiloGrams

The class also needs the three constant fields for the conversions as listed above.

Write the following methods:

Two constructor methods:

The default constructor sets all the field values to zero except the constant. The constant is set using the conversion given above.

The overloaded constructor accepts a value for the weight of an item in pounds and calculates the values for the remaining three fields.

Write four set( ) methods that allows the user to change any measure (setOunces, setPounds, setGrams, setKiloGrams) The set methods must ensure all the fields are consistent.

Write four get( ) methods. One get method for each of the four fields (not including the constants.

Write a driver class that has the main( ) method. This main method should provide the following utility:

Create an instance of the WeightConverter class using the default values.

Write a loop that allows the user to reset any of the measures. Ask the user to enter which measure to change, read in the value and call the appropriate set method. Then print the value of each of the four fields. This process continues until the user indicates he/she wants to quit.

Once the loop exits, print a Goodbye message.

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M92075940
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Programming Language

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Assignment task -q1 a the fibonacci numbers are the numbers

Assignment Task - Q1. (a) The Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and are characterised by the fact that every number after the first two is the sum of the ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Question 1 what is hadoop explaining hadoop 2 what is

Question: 1. What is Hadoop (Explaining Hadoop) ? 2. What is HDFS? 3. What is YARN (Yet Another Resource Negotiator)? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow t ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Assignment - haskell program for regular expression

Assignment - Haskell Program for Regular Expression Matching Your assignment is to modify the slowgrep.hs Haskell program presented in class and the online notes, according to the instructions below. You may carry out th ...

1 write a function named check that has three parameters

1. Write a function named check () that has three parameters. The first parameter should accept an integer number, andthe second and third parameters should accept a double-precision number. The function body should just ...

Background informationthis assignment tests your

Background Information This assignment tests your understanding of and ability to apply the programming concepts we have covered throughout the unit. The concepts covered in the second half of the unit build upon the fun ...

Php amp session managment assignment -this assignment looks

PHP & SESSION MANAGMENT ASSIGNMENT - This assignment looks at using PHP for creating cookies and session management. Class Exercise - Web Project: Member Registration/Login This exercise will cover adding data connectivi ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As