(Find the number of uppercase letters in an array) Write a recursive method to return the number of uppercase letters in an array of characters. You need to define the following two methods. The second one is a recursive helper method.
public static int count(char[] chars)
public static int count(char[] chars, int high)
Write a test
Want to see the full answer?
Check out a sample textbook solutionChapter 18 Solutions
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Additional Engineering Textbook Solutions
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Starting Out with Python (3rd Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Java: An Introduction to Problem Solving and Programming (8th Edition)
Database Concepts (7th Edition)
- 1.Answer the following questions: 1(a) Write a method to compute and return the value of maxEven and minOdd where maxEven is the largest even element of an int array and minOdd is the smallest odd element of the int array. The method is passed the int array and an int value that denotes the number of elements in the array. You may assume that the int array has at least 1 element in it. 1(b) Write a method to compute and return the value of countEven and countOdd where countEven is the number even elements in an int array and countOdd is the number of odd elements in the int array. The method is passed the int array and an int value that denotes the number of elements in the array. You may assume that the int array has at least 1 element in it.arrow_forwardWrite a program to accomplish the following tasks:- a) Write a method to print the ArrayList in the reverse order b) Write a method to sort the ArrayList, and display the data after sorting c) Write a method to print the largest and the smallest element in the ArrayList d) In the main method ask user to enter 10 integers, store them in the ArrayList, pass the ArrayList to above methods, and then display the result after each call.arrow_forwardPls please solve it quicklyarrow_forward
- (Intro to Java) Explain the answers to the below questions. include a written answer to the question using step-by-step explanation 4. Write the linearSearch method as follows using the algorithm provided in class: The method is named linearSearch It takes on array of doubles as a parameter It takes a double value to locate in the array as a second parameter It returns the integer location (index) in the array where the value is located Or, it returns -1 if the value cannot be foundarrow_forwardJava Programming [ Using Array] - 3arrow_forwardQuestion 3 : (Eliminate duplicates) Write a program Duplicate.java that reads in ten integers in an array T, creates a new array V by eliminating the duplicate values in the array, and displays the result. Here is the sample run of the program: Enter ten numbers: 1 2 3 2 1 6 3 4 5 2 The distinct numbers are: 1 2 3 6 4 5arrow_forward
- TASK 1 Write a Java method that returns the index of the smallest element in an array of integers. If the number of such elements is greater than 1, return the smallest index. Use the following header: public static int indexofLargestlestelement(double[] array) Write a test program that prompts the user to enter ten numbers, invokes this method to return the index of the smallest element, and displays the index.arrow_forwardWrite pseudocode that will a.) initialize an array with 5 values and declare a second empty array of the same size. b.) copy the contents of the first array into the second array. (Hint: use a loop.) Java 1 public class FinalGrade2 {3 public static void main(String args[])4 {5 //variable declarations and initialization6 String studentName = "Nicholas Simoneaux";7 final double QUIZ_PERCENTAGE = 0.5;8 final double TEST_PERCENTAGE = 0.5;910 double quizOne = 98.5;11 double quizTwo = 77.0;12 double quizAverage;13 double testOne = 85.0;14 double testTwo = 67.0;15 double testAverage;16 double extraCredit = 10.0;17 double finalGrade;1819 //calculations20 quizAverage = quizOne + quizTwo / 2;21 testAverage = testOne + testTwo / 2;2223 finalGrade = (quizAverage * QUIZ_PERCENTAGE) + (testAverage * TEST_PERCENTAGE) + extraCredit; 24 25 //output26 System.out.println("Student…arrow_forward[In c#] Write a class with name Arrays . This class has an array which should be initialized by user.Write a method Sum that should sum even numbers in array and return sum. write a function with name numFind in this class with working logic as to find the mid number of an array. After finding this number calculate its factorial.Write function that should display sum and factorial.Don’t use divide operatorarrow_forward
- c) Write a public static method getFirstD() with the following: o The method accepts 2 arguments: the first argument is an array of int, and the second is a value of int. The method returns a value of int type. o The method finds and returns the last element in the array which is divisible by the second argument, e.g. 8 is divisible by 4, but 9 is not divisible by 4. I The method returns your student ID number, if no divisible number is found in the array. Use a while loop to access the array elements. *NO more than 6 statement lines are allowed in the method body. YRIGHarrow_forwardWrite a recursive method that converts a decimal number intoa hex number as a string. The method header ispublic static String dec2Hex(int value)Write a test program that prompts the user to enter a decimal number and displaysits hex equivalent.arrow_forward(FYI: Pseudocode is required (Not any programming language) Design a pseudocode program that loads an array with the following 7 values. Add one more word (of your own choosing) for a total of 8 words. biffcomelyfezmottleperukebedraggledquisling Be sure to use lowercase, as shown above. This will make the processing easier. Ask the user to enter a word Search through this array until you find a match with the word the user entered. Once you find a match, output "Yes, that word is in the dictionary". If you get to the end of the array and do NOT find a match, output "No, that word is not in the dictionary". The program should work with any set of words in the arrays. If I were to change the words in the arrays, it should still work. If you need help, look at the search example in your textbook.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education