How many steps in a mile?
A stepsβtoβmiles calculator determines the distance a person should walk in order to attain a specific number of steps. The formula is specific to every person and should be based on the length of their stride. A personβs stride is calculated based on their gender, height, and whether they are walking or running.
For this assignment we will implement a very simple walking steps to miles calculator using the formulas provided next.
Disclaimer: this assignment is only meant as a programming assignment and is not meant for any other purposes. Note:Β
- this is an individual assignment; please do your own work, sharing and/or copying code and/or solution ideas with/from others will result in a grade of 0 and disciplinary actions for all involved parties. If you run into problems and have done your best to solve them, please contact me before/after class or by e-mail.
- A 20% grade deduction for every day the assignment is late.
Assignmentβs Requirements:
- Program should compile and run in order to be graded
- You must use ππ‘ππππ ππππππ‘π‘πππ π. π. πππππ‘π β¦ for ALL output statements. Your solution should NOT contain the methods πππππ‘ OR πππππ‘ππ .
- You should not need any 3rd party libraries (i.e. libraries besides Javaβs API). If you think some libraries maybe useful, please check with me first.
- Comment your code:
- Javadoc comments for the class
- Javadoc comments for each of the classβ members (variables and methods)
- Comments for major steps in your code
- Submit two separate classes each in its own JAVA file. Please use Blackboardβs upload feature and donβt submit your compiled code or LINKS to online editors.
- ππ‘πππ πππππππ β a container and operations class for the calculator. Follow the names shown in the UML diagram in Figure 1 exactly. I use a test script to examine your code which fails if you do not follow the naming convention.
- πππ π‘ππ‘πππ πππππππ β This class contains the main method to perform unit testing on the previous class.
Class πΊπππππ»ππ΄ππππ:
- Four variables: ππππ (String), ππππ‘ (double), and πππβππ (double).
- Default ππππ π‘ππ’ππ‘ππ to initialize the variables to their default values β null for strings and β1 for numeric.
- πππ πππππ’ππ‘ constructor to initialize the variables using the constructorβs parameters.
- π΄ππππ π πππ (setters) and ππ’π‘ππ‘πππ (getters) methods for all four variables β 6 methods in total.
- βπππβπ‘_πππβππ returns the height in inches. Conversion: 1ππ‘ Β Β Β Β Β 12 πππβππ
- π π‘πππππΏππππ‘β_πππβππ returns the length of a personβs stride. Remember to invoke the previous method:
- π π‘ππππ βͺ βπππβπ‘_πππβππ β« Β Β Β Β Β 413
- πππππ π π‘πππ returns the number of miles to walk given the desired number of steps. Remember to invoke the previous methods:
- πππππ
- ππ’πππ·ππ‘π returns todayβs date as a String. One way is to use Javaβs πΊπππππππππΆπππππππ to first extract the ππππ‘β, π·ππ¦, ππππ values, then build a string representing todayβs date. https://docs.oracle.com/javase/8/docs/api/java/util/GregorianCalendar.html)
- ππππππ‘π΄π ππ‘ππππ: receives one input for the numbers of steps and formats and returns the classβ members as a multiβline string. Use the String format method to format and return the values as shown in Figure 2.
- All leading labels should have column widths of 13 characters
- All floatingβpoint numbers have precision 2 and the thousands comma (i.e. decimal separator)
Class π»ππππΊπππππ»ππ΄ππππ:
- Remember to show a message string before each prompt and use πππππ‘π ONLY
- Create an instance of class ππ‘πππ πππππππ using the πππππ’ππ‘ Use the mutator methods to assign values to the classβ private members. See Figure 2 for a sample test.
- Prompt the user to enter a ππππ and βπππβπ‘ in ππππ‘ and πππβππ . See Figure 2 for a sample test. These values will be used in the next step.
- Create a second instance of ππ‘πππ πππππππ using the nonβdefault Use the values entered in the previous step.
- Using πππππ‘π :
- Using the 1st instance, print todayβs as shown in Figure 2
| pass the value 12345 |
- Using the 1st instance, print the results of calling the function ππππππ‘π΄π ππ‘ππππ, for the steps parameter.
| pass the value 1000 |
- Using the 2nd instance, print the results of calling the function ππππππ‘π΄π ππ‘ππππ, for the steps parameter.

