Question: JAVA ONLY PLEASE 1) create a class with the method: public static String repeat(String str, int n) that returns the String str repeated n times.

JAVA ONLY PLEASE

1) create a class with the method:

public static String repeat(String str, int n)

that returns the String str repeated n times. For example, repeat("ho", 3) returns hohoho.

Provide a program that tests your methods from a different class in a static manner.

2) Having a secure password is a very important practice, when much of our information is stored online. Write a program that validates a new password, following these rules:

must be 8 characters long

at least one upper case letter and one lower case letter

at least on digit

Write a program that asks for a password, than asks again to confirm it. If the passwords do not match or the rules are not fulfilled, prompt again. Your program should include a method that checks whether a password is valid.

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!