Category Archives: oopm

Schedule of file correction for SE IT/ Sem III/ OOPM B batch

Instructions:

  1. All students of B batch will report for file correction of OOPM on 2nd November 2016 9.00 to 10.00 only.
  2. Cover page of each experiment will be as per previous format only.
  3. Students have to be prepared to solve, answer questions related with practical in order to get marks for knowledge of practical.
  4. Index of OOPM is same as for other subject, refer it to download, print and attach it with filled condition.
  5. Arrange file as per index only.
  6. If any experiments are not corrected, then same will be done at the time of submission itself.
  7. Defaulters of OOPM subject or overall will also be reporting for file correction, but the submission of same will be in reserved with decision of subject in-charge.

OOPM: java program for fibonacci series

//fibonacci w/o recursion
import java.io.*;

class Fibbo{
public static void main(String args[])
{
int n,x,y,temp;
n = Integer.parseInt(args[0]);
x=0;
y=1;
do{
System.out.print(x + ” “);
temp = x;
x = y;
y = temp + y;
n–;
}while(n>0);
}
}

*********************************************************************

//fibonacci with recursion
import java.io.*;

class Fibbo
{
void fib(int x, int y, int n)
{
int temp;
if(n<=0)
System.out.print(x + ” “);
else
{
System.out.print(x + ” “);
temp = x;
x = y;
y+=temp;
fib(x,y,–n);
}
}
}

class FibboRec{
public static void main(String args[])
{
int n;
n = Integer.parseInt(args[0]);
Fibbo f = new Fibbo();
System.out.print(“Fibonacci series:”);
f.fib(0,1,n);
}
}

OOPM: java program for reverse of number

//reverse of number w/o recursion
import java.io.*;

class Rev{
public static void main(String args[])
{
int n;
n = Integer.parseInt(args[0]);
while(n!=0)
{
System.out.print(n%10);
n/=10;
}
}
}

***********************************************************

//reverse of number with recursion
import java.io.*;

class revNum
{
void rev(int n)
{
if(n<10)
System.out.println(n);
else
{
System.out.print(n%10);
rev(n/10);
}
}
}

class RevRec{
public static void main(String args[])
{
int n;
n = Integer.parseInt(args[0]);
revNum r = new revNum();
System.out.print(“Reverse of number:”);
r.rev(n);
}
}