Question: Q1, Q2 & Q3.. Please 01.(10 pts) Write a Java program that reads a string then calls function checkPassword to check if the string is
01.(10 pts) Write a Java program that reads a string then calls function checkPassword to check if the string is a validpassword or not A string is a valid password: 1. have at least ten characters. 2. consists of only letters and digits. 3. contain at least two digits. Q2. (10 pts) Write a program to score the paper-rock-scissor game. A player will play against the computer. The player enters a types in either P.R or S. Computer randomly selects paper, rock, or scissor. The program calls function FindWinner to announces the winner For determining the winner: Paper covers rock, Rock breaks saissors, Scissors out paper, or it is a tie. Be sure to allow the users to use lower case as well as uppercase leters. Your program should include a loop that lets the user play again until the user says she or he is done. 03 (10 pts) Write a java program that reads 20 integer values within the array. For this program, there will be only one array. In your main function, define a constant MAXSIZE for an array. Initialize the MAXSIZE to 20 Initialize the array to contain the values from O to MAXSIZE 1, in array positions 0 to MAXSIZE-1,i.e, aray position 3 has the value 3 A user selects a transformation to apply to the array from a menu: 1. square 2. halve 3. accumulate 4. transpose 5. shit right 6. reverse 7. quit program void square(int atl-Square every value in the array void halve(nt al1)-Halve every value in the aray (rounding down), for example if an element in the array is equal to 3 after calling function have the element will be 1 vold accumulate (int al1) sum all elements of the aray vold transpose(int at1)-For every pair of neighbors in the array, switch their akes. That is, switch the value ofwith that of a(1], and with apl etc. I of 3 Oriented Paradi 2019 void shiftRight (int atl)- Move every value in the array to the next index position on the right side, e.g the value of al3] is moved to af41 Except a[19] move the value of the last index to the first index, e.g., a(19] is moved to al0] for an array of size 20 void reverse (int a1) - Reverse the values in the array, e.g., in an array of size 20 switch a10) with a[191, al1] with al18), etc
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
