Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Date of Performance :
Date of Submission :
PROBLEM DEFINITION 1:
SOURCE CODE:
class EXPT1A
a=Integer.parseInt(args[0]);
b=Integer.parseInt(args[1]);
c=Integer.parseInt(args[2]);
d=(b*b)-(4*a*c);
if(d==0) select=0;
else select=2;
switch (select)
break;
case 1: r1=(-b+Math.sqrt(d))/(2*a);
r2=(-b-Math.sqrt(d))/(2*a);
break;
}}}
OUTPUT:
D:\>cd asl
D:\ASL>javac EXPT1A.java
D:\ASL>java EXPT1A 1 2 1
D:\ASL>java EXPT1A 1 5 6
D:\ASL>java EXPT1A 1 5 7
Real part:-2.5
PROBLEM DEFINITION 2:
SOURCE CODE:
class EXPT1B
int n, a, rev=0;
n=Integer.parseInt(args[0]);
while(n!=0)
rev=(rev*10)+(n%10);
n=n/10;
}
while(rev!=0)
a=rev%10;
rev=rev/10;
switch(a)
}}}}
OUTPUT:
D:\>cd asl
D:\ASL>javac EXPT1B.java
One
Five
Three
Four
One
One
Two
D:\ASL>