Sixty miles/hour is about how many meters/second?
How many significant figures are in 0.0037010?
I think their are seven significant figures is that correct?© BrainMass Inc. brainmass.com October 16, 2018, 5:01 pm ad1c9bdddf
0.0037010 can be expressed as 3.7010 x 10^(-3) The mantissa has 5 significant figures if indeed the last zero is significant. The positioning of the decimal is not significant.
For example 2 ...
This solution provides an explanation on how to convert miles per hour to meters per second.
Using a static method in Java
• Construct and use Objects
• Design the public interface of a class
• Implement methods and test code using conditionals
• Implement methods and test code using loops
• Access instance fields and local variables
The project directory should include the following files:
• Length.xml (the project file)
In the previous projects, you have written programs that convert between different units of length and manipulate Length objects. In this project, you will use loops for data entry and to print out conversion tables.
• Implement a loop to allow continuous input.
• Implement a loop to check for valid input.
• Implement a method with a loop to calculate and print conversions from one unit to another.
New Methods for the Length Class
In addition to the methods last project, you will have these methods:
/* Return true if unit is "meters", "inches", "feet", "yards", or "miles" */
static public boolean validUnit(String unit)
/* Print a table showing conversions from the unit of this object to meters */
public void printConversionTable()
The validUnit method will be used to streamline data entry.
The printConversionTable method will be used to print a conversion table from the unit of this object to meters. For example, if this object is 36 inches, a table like the following should be printed.
Due to rounding errors, your values might be slightly different from the above table.
To determine the values to be printed in the first column, perform the following calculation.
double start = Math.pow(10, Math.floor(Math.log10(myNumber)));
The values in the first column will include 1*start, 2*start, and so on up to 10*start. This will be done using a for loop. In addition, myNumber should appear in the first column in the appropriate row.
When the printConversionTable method is finished, be sure that myNumber is equal to its original value.
Testing your Length class:
Use a do-while loop to allow the user to enter and add up a series of lengths. At the end of each iteration, ask the user if they would like to continue. In this loop do the following.
1. Ask the user to enter a number as a double from the keyboard. Store the response in number1.
2. Ask the user to enter a unit as a String from the keyboard. Store the response in unit1.
3. Use a while loop to ensure that the value of unit1 is valid. This will be done using the validUnit method, i.e., calling Length.validUnit(unit1). While unit1 is not valid, obtain a new value for unit1 from the user.
4. Instantiate a Length object named length1 using the input from above, and print length1 using the toString method. Be sure to use a descriptive label.
5. Invoke length1.printConversionTable() to print out a conversion table.
6. Print the values from calling length1 with the getMeters, getInches, getFeet, getYards, and getMiles methods. Be sure to use descriptive labels.
7. Print the sum of the lengths that have been entered by the user so far. You will need to declare a Length variable before the do-while loop, initialize it to 0 meters, and update the variable in the do-while loop.