Find out the factorial of a number by using recursion


Question 1: Write a program to find out the Factorial of a number by using Recursion. Factorial can be defined as Factorial

(n) = 1 * 2 * 3 ….* (n-1) * n.

Question 2: Write a class vehicle. Define appropriate attributes and methods. Write subclasses of Vehicle like Car, Bicycle and Scooter. Suppose appropriate required attributes. Write constructor for each and define a method maxSpeed() in each class which prints the maximum speed of the vehicle. (Use of super keyword is expected in the constructor of inherited classes)

Question 3: Define an exception called “NoMatchException” that is thrown when a string is not equivalent to “Symbiosis”. Write a Java program which uses this exception.

Question 4: Write a program which explains the use of multithreading with the use of three counters with three threads defined for each. Three threads must represent the counters as shown:

a) One counter begins from 5 and increments with the step of 5.
b) Second counter begins from 10 and increments with the step of 10.
c) Third counter begins with 100 and increments with the step of 100.

Assign proper priority to the threads and then run the threads.

Question 5: Write a program to make an applet with red back ground and display the Message WELCOME TO THE WORLD OF APPLETS. Write its HTML document too. Specify width and height to the Applet.

Question 6: Write a program which detects successive repeated occurrence of a letter in a word. For illustration, in the word “explanation” letter ‘a’ and ‘n’ occurs twice.

Question 7: Write a Java program to make a JApplet with three Jbuttons Morning, Afternoon and Evening. When we click Morning button, the message “Good Morning to you” must appear. Similar for the other two buttons “Good Afternoon to you” and “Good evening to you” should appear. Each message should appear in a different Background, text, Color and Font.

Question 8: Write a program to explain use of Grid Layout. On a frame with grid layout place buttons labeled correspondingly with the letters from ‘A to Z’. For illustration if you click the button labeled Z the message “You have clicked the Z “button must appear. (Set appropriate number of rows and columns).

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Find out the factorial of a number by using recursion
Reference No:- TGS03128

Expected delivery within 24 Hours