Java Object Oriented Practice Questions with source code
Question 1: A ggregation and Inheritance What relationship is appropriate between the following classes: aggregation, inheritance, or neither? State your reasons for each answer. a) Wheel-Bicycle b) Banana-Fruit c) Lamp-Bulb d) Flute-Guitar e) Rainbow-Colour Question 2: Alphabets to numeric values a) Using recursion, compute the sum of all numeric values of each character in a string that are in the range a-z, where a=1, b=2, … z=26. Any other character has no value. The method is case-sensitive, so uppercase letters have no value. Call the recursive method from main(). b) Now add a class called StringConverter in its own .java file, which has a recursive static method like the one just created but has an extra parameter called caseSensitive which if set to false will treat uppercase letters as lowercase letters. Call this new recursive method statically from main(). For example if this is called on the string abCde with caseSensitive set to false, it will return 15. With caseSensitive...