Question: Please I need the answer for this as soon as possible. Can anyone help? 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 baen Eg. 23-8. passwordCheck: This method takes a single String argum ent and returns a boolean value. The ose of this method is to test the strength of a password. To be consi purp have the following properties: dered strong a password mus -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: MatlabTM 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 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. halfLife: Radioactive decay of materials can be modeled by the equation shown below. Write a
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
