Reference no: EM132409039
Topic: Java Methods
1. Write a method to work out the sum of the first n odd numbers
2. Write a method that will add the first n even numbers.
3. Write a method that prompts the user to print out the smallest of three given numbers
4. Write a method that will work out the sum of the squares for the first n numbers
5. Write a method that will display the 1, 8, 27, 64, ... up to n and work out the sum for the first n sequence of numbers
6. Write one program that will call methods from each of the above five questions.
Challenge
Copy the BMI, UserDetails and Stars classes from week4 package to week5 package
7. You will use statements from the BMI and UserDetails classes to write methods for this task.
Your task should ask the end user for the following particulars:
Firstname, Surname, Age, Height and Weight.
You are to assume that if the end user is 21 years and above, they hold a driving licence.
Write methods to work out the end user’s BMI and advise them of their health status using the rules established in the previous exercise.
Write methods to work out the user’s username by taking the first 2 letters of their firstname and first 2 letters of their surname. The username should be in uppercase.
The final output should display fullname using title case, username, age , BMI, Health status and state if the user holds a driving licence.
8. Amend the class called Stars.

Write a method to generate a pattern similar to above for user defined number of * across and down. i.e. pattern(10,4) should give 10 rows of * across and 4 columns of * down.
9. Write one program that will call methods from each of the above challenging questions. i.e. Questions 8 and 9.