Computer exam 1) Design a class with function many() to overload
a)void many()
print the Fibonacci triangle
b)void many(int n , int x)
sum =x^1+x^2.....x^n
print sum of this series
c)void many()
to check if a number accepted is a prime number
or
2) Design a class named hotel with following
String name-to enter name of dish
String qut-to enter veg or non veg
int cost-to enter cost
double tax
if dish is veg cost=$1000
if dish is non veg cost=$2000
on each dish 80% tax should be added
create a main method
or
write a Java program to print
1)
1
1 2
1 2 3
1 2 3 4
2)
# @ $ &
@ $ &
$ &
&
attempt any one
program to be written in java
Share
0 Replies