Write the Java programs (not pseudo codes or algorithms) for the following problems: 1. Write a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write the Java programs (not pseudo codes or algorithms) for the following problems: 1. Write a value-returning method, is Vowel() that returns the value true if a given character is a vowel, and otherwise returns false. In main() method accept a string from user and count number of vowels in that string using is Vowel() method. 2. Write a value returning method factorial() that calculates and returns the factorial of a given number. In main() method, accept a number from the user and validate it. The number is valid if it is non- negative and less than or equal to 10. If the number is valid, call the factorial() method otherwise ask the user to input another number. 3. Write a Java program to find the largest and smallest element of an array. 4. Write a Java program to reverse the elements of an integer 1-D array with and without using a temporary array. [write two methods reversel() and reverse20): reversel() uses another temporary array while reverse2 does not use another array] 5. Write a user defined method named upperHalf() which takes a two-dimensional array A, with size N rows and N columns as argument and prints the upper half of the array. e.g., 23150 71531 25781 0 150 1 34915 23150 1531 The output will be 178 01 5 6. Next, define another method upperHalfSum() which find the sum of the upper half of the array. 7. Write a user-defined method sumArrays() that takes 2 two-dimensional arrays of same sizes. The method returns another array that contains the sum of the corresponding elements of these two arrays. Write the Java programs (not pseudo codes or algorithms) for the following problems: 1. Write a value-returning method, is Vowel() that returns the value true if a given character is a vowel, and otherwise returns false. In main() method accept a string from user and count number of vowels in that string using is Vowel() method. 2. Write a value returning method factorial() that calculates and returns the factorial of a given number. In main() method, accept a number from the user and validate it. The number is valid if it is non- negative and less than or equal to 10. If the number is valid, call the factorial() method otherwise ask the user to input another number. 3. Write a Java program to find the largest and smallest element of an array. 4. Write a Java program to reverse the elements of an integer 1-D array with and without using a temporary array. [write two methods reversel() and reverse20): reversel() uses another temporary array while reverse2 does not use another array] 5. Write a user defined method named upperHalf() which takes a two-dimensional array A, with size N rows and N columns as argument and prints the upper half of the array. e.g., 23150 71531 25781 0 150 1 34915 23150 1531 The output will be 178 01 5 6. Next, define another method upperHalfSum() which find the sum of the upper half of the array. 7. Write a user-defined method sumArrays() that takes 2 two-dimensional arrays of same sizes. The method returns another array that contains the sum of the corresponding elements of these two arrays.
Expert Answer:
Answer rating: 100% (QA)
Java programs for the problems you mentioned Vowel Checker import javautilScanner public class VowelChecker public static void mainString args Scanner ... View the full answer
Related Book For
Operating Systems Internals And Design Principles
ISBN: 9781292214290
9th Global Edition
Authors: Stallings William
Posted Date:
Students also viewed these programming questions
-
(10) Let A be a linear transformation of Rn with the standard inner product xiyi. Prove that Ker (AA) Ker(A). (Hint: recall first what does it mean that = x Ker(B) for a linear operator B and then...
-
Here is a question from the web that shows the type of problem you might encounter inreal life: I am trying to solve the following partitioned linear system, where each letter represents a block -H...
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
In what circumstances have courts opted to use the substantial-factor test rather than the but-for test?
-
Bars AB and BC each of length l and of negligible weight are attached to two spring each of constant k. The springs are undeformed and the system is in equilibrium when θ1 =...
-
A college chemistry instructor thinks the use of embedded tutors will improve the success rate in introductory chemistry courses. The passing rate for introductory chemistry is 62%. During one...
-
Define business roles and give three examples for a bank.
-
Four years ago Omega Technology, Inc., acquired a machine to use in its computer chip manufacturing operations at a cost of $35,000,000. The firm expected the machine to have a seven-year useful life...
-
You just won a lottery that will pay you $2,500 a year for twenty years. You will receive your first payment today. If you can earn 8 percent on your money, what are your winnings worth to you today?
-
Simulation can be used to illustrate a number of results from statistics that are difficult to understand with non-simulation arguments. One is the famous central limit theorem, which says that if...
-
What is a dissenting opinion and what effect does it have? What is a precedent? 4.
-
Approximate the value of the given integral by completing parts (a) and (b) below. (a) Use Simpson's rule, using n = 2. (b) Check by direct integration. 2 (6+x) dx 0
-
How do molecular dynamics simulations elucidate the complex interplay between thermodynamic forces and surface interactions in the development of novel nanoparticle catalysts for selective...
-
Joseph is a friend of yours. He has plenty of money but little financial sense. He received a gift of $12,000 for his recent graduation and is looking for a bank in which to deposit the funds....
-
Your real estate investment ($1250) tripled between 2014 and 2022. How long in total years (to the nearest 0.01 years) will your investment take to grow to 4x given that the annual rate r is...
-
What is the importance of internal analysis in an organization and how can it help identify key areas to improve its competitiveness?
-
Q.10 Write servlet which displayed following information of client. I. Client Browser II. Client IP address III. Client Port No IV. Server Port No V. Local Port No VI. Method used by client for form...
-
Describe a group you belong or have belonged discuss the stages of group development and suggest how to improve the group effectiveness by using the group development model.
-
Briefly describe container virtualization.
-
Compare direct and indirect addressing with respect to message passing.
-
Suppose the virtual space accessed by memory is 6 GB, the page size is 8 KB, and each page table entry is 6 bytes. Compute the number of virtual pages that is implied. Also, compute the space...
-
Write a one-page summary addressing the topic, How improving safety and health at the Hotel Paris will contribute to us achieving our strategic goals.
-
Based on what you read in this chapter of Dessler, Human Resource Management, whats the first step you would have advised the Hotel Paris to take as part of its new safety and health program, and why?
-
How would you suggest the Carters get all employees to behave more safely at work? Also, how would you advise them to get those who should be wearing goggles to do so?
Study smarter with the SolutionInn App