Question: Question 2. (question2.java) (25 marks) Write a class that has the following methods power: This method takes two integers as arguments, one representing the base

 Question 2. (question2.java) (25 marks) Write a class that has the

Question 2. (question2.java) (25 marks) Write a class that has the following methods power: This method takes two integers as arguments, one representing the base and another representing the exponent. The method then uses a for loop to compute and return the result of basnnt Eg. 23-8 passwordCheck: This method takes a single String argument and returns a boolean value. The purpose of this method is to test the strength of a password. To be considered strong a password must have the following properties: -at least 8 characters in length -at least one uppercase and one lowercase letter -at least one digit If the string parameter passed to the method passes all of these tests, return true, else return false. Use your main method to report whether or not the password is strong. fix: MatlabM has a great method called fix which returns the decimal portion of a floating point number. Write a method that takes in a double and returns only the decimal portion. Eg. 3.14159 passed in would return 0.14159. There may be some rounding issues as you test your method. Don't worry about that too much but if you want to try and solve that, that's ok too Finally, write a main ) method that prompts the user to enter inputs appropriate for testing your methods. Remember, to do al input and output in your main method. Pass the input to your methods and collect the results using assignment statements. You don't need to do any input checking. Assume the user enters appropriate values. I suggest your write and test your methods one at a time. You can get part marks for the methods that work. halfLife: Radioactive decay of materials can be modeled by the equation shown below. Write a method that takes in all the necessary arguments to compute and then return the amount of material (A) after it has decayed for a period of time (t) given a half-life value (h) A.-Age Finally, write a main ) method that prompts the user to enter inputs appropriate for testing your methods. Remember, to do all input and output in your main) method. Pass the input to your methods and collect the results using assignment statements. You don't need to do any input checking. Assume the user enters appropriate values. I suggest your write and test your methods one at a time You can get part marks for the methods that work

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!