Nptel Week12 Assignment Solutions
Nptel Week12 Assignment Solutions
Nptel Week12 Assignment Solutions
outerloop:
if(seq[i]=='C'){
operand1=0.0;
operand2=0.0;
output=0.0;
outflag=0;
break outerloop;
}else if(seq[i]=='R'){
o1+=Character.toString(seq[j]);
operand1=Double.parseDouble(o1);
output=Math.sqrt(operand1);
outflag=1;
break outerloop;
else if(seq[i]=='S'){
o1+=Character.toString(seq[j]);
operand1=Double.parseDouble(o1);
output=Math.pow(operand1,2);
outflag=1;
break outerloop;
}else if(seq[i]=='F'){
for(int j=0; j<i; j++){
o1+=Character.toString(seq[j]);
operand1=Double.parseDouble(o1);
output=Math.pow(operand1,-1);
outflag=1;
break outerloop;
}else{
int r=0;
if(seq[i]=='+'||seq[i]=='-'||seq[i]=='/'||seq[i]=='*'||seq[i]=='='){
o1+=Character.toString(seq[j]);
operand1=Double.parseDouble(o1);
if(seq[k]=='='){
outflag=1;
operand2=Double.parseDouble(o2);
if(seq[i]=='+'){
output=operand1+operand2;
}else if(seq[i]=='-'){
output=operand1-operand2;
}else if(seq[i]=='/'){
output=operand1/operand2;
}else if(seq[i]=='*'){
output=operand1*operand2;
}
break outerloop;
}else{
o2+=Character.toString(seq[k]);
try{
System.out.println("Protocol: "+url.getProtocol());
catch(Exception e){System.out.println(e);}
String f = s1.next();
String l = s1.next();
int n = s1.nextInt();
double db = s1.nextDouble();
double db1 = s1.nextDouble();
double avg=(db+db1)/2;
c.testInstanceMethod();
Parent.testClassMethod();