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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started