Question: Please use Java Problem 1. String Statistics (StringStatistics.java) Description Write a Java class named String Statistics that prompts the user to enter a string. If
Problem 1. String Statistics (StringStatistics.java) Description Write a Java class named String Statistics that prompts the user to enter a string. If the entered string is empty. quit the program. Otherwise, analyze the entered the string and report the following findings: 1) The ASCII value of the firs letter in the string 2) The number of alphabetical letters contained the string, 3) The number of digital letters contained in the string, 4) The number of upper case letters contained in the string 5) The number of lower case letters contained in the string 6) The number of letter 'e contained in the string 7) Is the string initialized with letter "A? 8) Whether the string contains a substring as "tion". Outputs: Please enter a string: Happy Summer 2020 Senester The ASCII value of the first letter is 72 There are 19 alphabetical letters. There are 4 digital letters. There are 3 upper case letters. There are 16 lower case letters There are 3 'e's in the string. The string does not initiate with 'A'. It does not contain a substring as "tion, Problem 2: Factorial class (Factorial.java) Description: In mathematics, the notation nl represents the factorial of the nonnegative integer n. The factorial of n is the product of all the nonnegative integers from 1 ton. For example: 7! = 1x2x3x4x5x6x7 = 5040 and 41 = 1x2x3x4 = 24 Write a Java class named Factorial that prompts the user to enter a nonnegative integer, and then uses a loop to calculate the factorial of that number. Please note that a negative number has no factorial number, and therefore if the user enters a negative number, you need to report an error message. Please implement your codes by using the for-loop and while-loop respectively, Outputs: Your output should look similar as follows $java Factorial Please enter a number: 7 The factorial of 7 is (for-loop): 5040 The factorial of 7 is (while-loop): 5048
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
