I am posting a Java assignment. I am doing MBA(IT) from Symbiosis and I have to submit an assignment on Thursday. Im trying few questions, If anyone has solution to any of the programs, Please forward the same.
Here is the list of questions
Assignment for Java
Note: 1. Solve any 10 programmes
2. Each Programme carries 10 marks
3. The weight of these programmes is 40% (other 60% is for Online assignment submission)
Q. 1. Write a program that converts a decimal number to Roman number. Decimal Number is accepted as command line input at the time of execution
Q. 2. Write a program that prints prime numbers between 1 to n. Number n should be accepted as command line input.
Q. 3. Write a program that prints first n Fibonacci numbers. Number n should be accepted as command line input. Any Fibonacci number is calculated as, sum of its previous 2 numbers,
e.g. 0 , 1 , 1 , 2, 3 , 5 , 8 , 13 , ����..
First 2 Fibonacci numbers are 0 and 1.
Q. 4. Write a program to print out multiplication tables from 9 to 17 using (I) for loops (II) while loops (III) do loops.
Q. 5. Write a program to print the following triangle of numbers.
1 2 3
1 2 3 4
1 2 3 4 5
Q. 6. Write a program to convert Fahrenheit temperature to the Centigrade equivalent. Fahrenheit temperature should be accepted from the user.
Centigrade = (Fahrenheit � 32) * 5.0/9.0
Q . 7. Define a class called Circle with the attributes radius, circumference, and area of the circle. Write a program to display all attributes of the circle for 5 Circles. Radius for all 5 circles should be accepted as command line input at the beginning. e.g. java Circlejava 5 10 12 25 36
Q . 8. Write a program to find the Factorial of a number using Recursion. Factorial can be defined as Factorial(n) = 1 * 2 * 3 �.* (n-1) * n.
Q . 9. Write a program to get the input values Principal, rate of interest and number of Years from the keyboard and find the simple interest.
Q. 10. Write a program to create an applet with yellow back ground and display the Message WELCOME TO THE JAVA WORLD. Write its HTML document also.
Q. 11. Write a java program to create a Frame with three buttons Morning, Afternoon and Evening. When we click Morning button, the message �Good Morning to you� must be displayed. Similar messages must be displayed for the other buttons also.
Q. 12. Write a Java program to create a List box with some colors in the items. When the color is selected, the background color must change accordingly. Write a program which creates and displays the details in the List box on the window.
Q13. Write a program to show demonstration of CardLayout and Flowlayout. Create 2 panel, Top & Main. Top panel contains 3 buttons Button 1 , Button 2 & Button 3 in Flowlayout. Main panel contains 3 panels First Panel, Second Panel and Third Panel. On selection of any panel display appropriate message. Here Applet is to be used by implementing ActionListener.
Q . 14. Write a Java program to create a Frame which responds to the mouse click. For each event with mouse ( such as mouse up, mouse down etc.) the corresponding message must be displayed.
Q . 15 . Write a program to explain the multithreading with the use of multiplication tables. Three threads must be defined. Each one must create one multiplication table, they are 5 table, 7 table and 13 table. And assign priority 1 to 5 Table, priority 5 to 7 Table and priority 8 to 13 Table. And then run the threads.
Q . 16 . Write a Java program to create simple Calculator for 4 basic Math operations, Addition, Subtraction, Multiplication and Division. In the window there are four radio buttons called Add, Sub, Mul and Div at the Top. This group is called Operation. There are two textfield objects to input first and second number.We must type the numbers and select one of the operations. When we click the perform button, the result is displayed. For example if the first number is 10 and second number is 72 And operation selected is Mul then the result is displayed as,
The result is 720.
Thnks & Regards