Create a Java class named Package that contains the following: a. Package should have three private...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a Java class named Package that contains the following: a. Package should have three private instance variables of type double named length, width, and height. b. Package should have one private instance variable of the type Scanner named input, initialized to System.in. c. No-args (explicit default) public constructor, which initializes all three double instance variables to 1.0. d. Initial (parameterized) public constructor, which defines three parameters of type double, named length, width, and height, which are used to initialize the instance variables of same name. e. Public copy constructor, with a parameter of type Package, used to duplicate an existing Package object. f. Three public void methods named inputlength, inputWidth, and inputHeight, Each method will prompt the user for the appropriate property, and input a double value using the Scanner object input to initialize the instance variables g. A public void method named displayDimensions, which prints the dimensions as length x width X height (each value separated by a "X"). h. A public method of type double named calcVolume that calculates the volume and returns the result as a double value. COLLEGE Online 2. Create a class named Shipment a. The program must ask for two separate packages to ship b. The program must calculate the cost difference using the difference in volume: i.e. The base price for a package with volume Create a Java class named Package that contains the following: a. Package should have three private instance variables of type double named length, width, and height. b. Package should have one private instance variable of the type Scanner named input, initialized to System.in. c. No-args (explicit default) public constructor, which initializes all three double instance variables to 1.0. d. Initial (parameterized) public constructor, which defines three parameters of type double, named length, width, and height, which are used to initialize the instance variables of same name. e. Public copy constructor, with a parameter of type Package, used to duplicate an existing Package object. f. Three public void methods named inputlength, inputWidth, and inputHeight, Each method will prompt the user for the appropriate property, and input a double value using the Scanner object input to initialize the instance variables g. A public void method named displayDimensions, which prints the dimensions as length x width X height (each value separated by a "X"). h. A public method of type double named calcVolume that calculates the volume and returns the result as a double value. COLLEGE Online 2. Create a class named Shipment a. The program must ask for two separate packages to ship b. The program must calculate the cost difference using the difference in volume: i.e. The base price for a package with volume
Expert Answer:
Answer rating: 100% (QA)
Answer import javautilScanner public class Package private double length private double width privat... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
2 . The Outpour Company has three matters that may need to be disclosed or reported as of the end of their fiscal year: a . Outpour has been sued for damages by a customer who was injured while using...
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
Design a Java class named Guitar that contains: A private int data field named numStrings that defines the number of strings on the guitar. The default value should be 6. A private double data field...
-
The following sequences of bits (rightmost bit first) appear at the inputs of a 4-bit parallel adder. Determine the resulting sequence of bits on each output. A1 1 0 0 1 A2 1 1 1 0 A3 0 0 0 0 A4 1 0...
-
Given the vectors A = 2.00i + 6.00j and B = 3.00i 2.00j, (a) draw the vector sum C = A + B and the vector difference D = A B. (b) Calculate C and D, first in terms of unit vectors and then in terms...
-
After the accounts are closed on April 10, 2016, prior to liquidating the partnership, the capital accounts of Zach Fairchild, Austin Lowes, and Amber Howard are $42,000, $7,500, and $36,500,...
-
Use a scatter plot to display the data shown in the table at the left. The data represent the numbers of coaching hours and the hourly fees (in dollars) of 12 cricket coaches. Organize the data using...
-
ESPN held its Action Sports and Music Awards ceremony in April, at which celebrities in the fields of extreme sports and popular music such as rap and heavy metal converged. Well-known musicians Ben...
-
The velocity v(t) of a ball thrown upward satisfies the equation v(t) = vo + at, where vo is the initial velocity of the ball in ft/s and a is the acceleration in ft/s2 Given the data find the...
-
The information provided in this project allows you to set up the General, Payables, and Receivables ledgers for an Ontario company named CHRIS'S WELDING, owned and run by Chris George, a master...
-
Prompt the user for a number of pints and convert those pints to equivalent gallons, quarts and residual pints and print The prompt and format of output must be duplicated. Just to remind you: There...
-
30) The fixed costs of operating the maintenance facility of General Hospital are $4,500,000 annually. Variable costs are incurred at the rate of $30 per maintenance-hour. The facility averages...
-
Prewriting Activities You have read about the writing process in an academic setting. You have also thought about the process itself and the stages of brainstorming, outlining and writing, editing...
-
EXPLAIN HOW A CONSUMPTION SUBSIDY LOOKS IN A GRAPH OF A SMALL COUNTRY AND A LARGE COUNTRY. Include the effects the subsidy has on world price, home price, export quantity, production surplus,...
-
1. Sketch indifference curves for each of the following consumers for a days worth of coffee and food, and describe why the indifference curves take the shape they do. Draw the indifference curves as...
-
Mortgage Loan with Blended, Equal Monthly Payments at Belair Ltd. On November 1, 2018, Belair Ltd. purchased land in Kamloops, B.C. for CAD 8,000,000. The land is being used to construct a new...
-
14. The diagrams below show two parts of two different cells which were observed during a photomicrograph study. diagram I a) Which of the diagrams was obtained from b) Give reasons for your answer...
-
d) For die casting processes: 1. What are the most common metals processed using die casting and discuss why other metals are not commonly die casted? 2. Which die casting machines usually have a...
-
Write a fragment of code that will read words from the keyboard until the word done is entered. For each word except done, report whether its first character is equal to its last character. For the...
-
Write a program that converts dates from numerical month-day format to alphabetic month-day format. For example, input of 1/31 or 01/31 would produce January 31 as output. The dialogue with the user...
-
Write a static method remove(int v,int[] in) that will return a new array of the integers in the given array, but with the value v removed. For example, if v is 3 and in contains 0, 1, 3, 2, 3, 0, 3,...
-
Steam from an engine exhaust at 1.25 bar flows steadily through an electric calorimeter and comes out at \(1 \mathrm{bar}, 130^{\circ} \mathrm{C}\). The calorimeter has two \(\mathrm{kW}\) heaters...
-
The properties of water and steam become identical at (a) 0.1 bar (b) 1 bar (c) \(100 \mathrm{bar}\) (d) 212.2 bar.
-
In thermodynamic analysis, a pure substance is that which (a) Consists of only a single chemical species (b) has no dissolved impurities (c) may have a number of chemical species but the composition...
Study smarter with the SolutionInn App