Classes: Math, Point, String, BufferedReader, Date (only to get the current date), write your own class from a given design
If you have not completed the HiWorld application from the Start Java page from Orientation, please use that program to verify that your environment is set up and that you can compile and run a Java application. Show the completed program to one of your TAs by early Monday evening.
Note that there are no loops in this assignment.
Please make sure to include your name, Andrew ID, and the honor statement in all your submissions for htis course (see the starting DigitTester.java code).
Due Thu Week 2, by 10pm.
Write the following programs:
Enter the seconds: 3712 ** Output ** Hours: 1 Minutes: 1 Seconds: 52
The provided code demonstrates using asserts to test the results. They are turned off by default; execute with this command to enable them:
java -ea DigitTester
If you are using an IDE, figure out how to enable them in your environment.
Note that this program has no input. Read the comments in the code for more instructions.
You should write and use the following methods:
public static String permissionString(String perms)
Call this method from your main(). This method returns the 3-digit string for chmod.
public static String onePermission(String perms)
Call this method from permissionString() to get the individual decimal number. Your permissionString() method should call this three times, concatenate the results together, then return the answer.
As an example, if the user enters rwxr-xr-x, your permissionString() method should return the string 755, and your main should print it. The permissionString() method should call onePermission() three times - once with "rwx", once with "r-x", and once with "r-x". It should combine the results from these 3 calls into a String, and return that answer.
Be sure to follow the basic algorithm discussed in class.
Update your code that calculates the age to get and use the current year, day, and month to determine the correct value. These values will come from a Date object that represents the current date.
Note: you may not use the Date class for the calculation, but must write the logic yourself based on the three attributes.
Add a static method to your HeartRateTester code that will take an int and return it in hex. Call it with the age to show the person's age in hex too. Note that the return-type for this method is String. You may use any algorithm you like to do this calculation.