adplus-dvertising
NPTEL Programming In Java Assignment 9 Answers 2022

NPTEL Programming In Java Assignment 9 Answers 2022

NPTEL Programming In Java Assignment 9 Answers 2022 :- Here All The Questions and Answers Provided to Help All The Students and NPTEL Candidate as a Reference Purpose, It is Mandetory to Submit Your Weekly Assignment By Your Own Understand Level

 

Are you looking for the Assignment Answers to NPTEL Programming In Java Assignment 9 Answers 2022? If Yes You are in Our Great Place to Getting Your Solution, This Post Should be help you with the Assignment answer to the National Programme on Technology Enhanced Learning (NPTEL) Course “NPTEL Programming In Java Week 9 Assignment Solution 2022

NPTEL Programming In Java Assignment 9 Answers 2022 (Week8)

NPTEL Programming In Java

From My Side : With the expansion of knowledge and Communication Technology, there’s a desire to develop massive and complicated package. Further, those package ought to be platform freelance, web enabled, straightforward to switch, secure, and robust. to satisfy this demand object-oriented paradigm has been developed and supported this paradigm the Java artificial language emerges because the best programming atmosphere. Now, Java artificial language is being employed for mobile programming, web programming, and plenty of alternative applications compatible to distributed systems. This course aims to hide the essential topics of Java programming in order that the participants will improve their skills to address the present demand of IT industries and solve several issues in their own filed of studies.

With the growth of Information and Communication Technology, there is a need to develop large and complex software. Further, those software should be platform independent, Internet enabled, easy to modify, secure, and robust. To meet this requirement object-oriented paradigm has been developed and based on this paradigm the Java programming language emerges as the best programming environment. Now, Java programming language is being used for mobile programming, Internet programming, and many other applications compatible to distributed systems. This course aims to cover the essential topics of Java programming so that the participants can improve their skills to cope with the current demand of IT industries and solve many problems in their own filed of studies.

INTENDED AUDIENCE :  The undergraduate students from the engineering disciplines namely CSE, IT, EE, ECE, etc. might be interested for this course.
PREREQUISITES :  This course requires that the students are familiar with programming language such as C/C++ and data structures, algorithms.
INDUSTRY SUPPORT :   All IT companies.

CRITERIA TO GET A CERTIFICATE

This course can have Associate in Nursing unproctored programming communication conjointly excluding the Proctored communication, please check announcement section for date and time. The programming communication can have a weightage of twenty fifth towards the ultimate score.

Final score = Assignment score + Unproctored programming exam score + Proctored Exam score
  • Assignment score = 25% of average of best 8 assignments out of the total 12 assignments given in the course.
  • ( All assignments in a particular week will be counted towards final scoring – quizzes and programming assignments). 
  • Unproctored programming exam score = 25% of the average scores obtained as part of Unproctored programming exam – out of 100
  • Proctored Exam score =50% of the proctored certification exam score out of 100
YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF ASSIGNMENT SCORE >=10/25 AND
UNPROCTORED PROGRAMMING EXAM SCORE >=10/25 AND PROCTORED EXAM SCORE >= 20/50. 
If any one of the 3 criteria is not met, you will not be eligible for the certificate even if the Final score >= 40/100. 

CHECK HERE OTHERS NPTEL ASSIGNMENTS ANSWERS 

BELOW YOU CAN GET YOUR NPTEL Programming In Java Assignment 9 Answers 2022? :

NPTEL Programming In Java Assignment 9 Answers 2022 (Week8)

 
 
 
 
1 point
 
 
 
 
1 point
 
 
 
 
1 point
 
 
 
 
1 point
 
 
 
 
1 point
 
 
 
 
1 point
 
 
 
 
1 point
 
 
 
 
1 point
 
 
 
 
1 point
 
 
 
 

NPTEL Programming In Java Assignment 9 Answers 2022

Q1. Problem statement:

Complete the code to develop a BASIC CALCULATOR that can perform operations like Addition, Subtraction, Multiplication and Division.

Code:-

int i=0;
int j=0;
double ans=0;

char pattern[] = input.toCharArray();

for(int a=0; a<pattern.length; a++)
{
if(pattern[a]==’+’)
{
i= Integer.parseInt(input.substring(0,a));
j= Integer.parseInt(input.substring(a+1,pattern.length));
ans = (double)i+j;
}else if(pattern[a]==’-‘)
{
i= Integer.parseInt(input.substring(0,a));
j= Integer.parseInt(input.substring(a+1,pattern.length));
ans = (double)i-j;
}else if(pattern[a]==’/’)
{
i= Integer.parseInt(input.substring(0,a));
j= Integer.parseInt(input.substring(a+1,pattern.length));
ans = (double)i/j;
}else if(pattern[a]==’*’)
{
i= Integer.parseInt(input.substring(0,a));
j= Integer.parseInt(input.substring(a+1,pattern.length));
ans = (double)i*j;
}
}

System.out.print(input+” = ” + Math.round(ans));

Answers will be Uploaded Shortly and it will be Notified on Telegram, So JOIN NOW

Q2. Problem statement:

Complete the code to develop an ADVANCED CALCULATOR that emulates all the functions of the GUI Calculator as shown in the image.

Code:-

char pattern [] = input.toCharArray();
int f=0;

for(int i=0; i<pattern .length; i++){
pattern [i]=gui_map(pattern [i]);
}

double operand1=0.0;
String o1=””;
double operand2=0.0;
String o2=””;
double ans=0.0;

outerloop:
for(int i=0; i<pattern .length; i++){
int r=0;
if(pattern [i]==’+’||pattern [i]==’-‘||pattern [i]==’/’||pattern [i]==’X’||pattern [i]==’=’){
for(int j=0; j<i; j++){
o1+=Character.toString(pattern [j]);
}
operand1=Double.parseDouble(o1);
for(int k=i+1; k<pattern .length; k++){
if(pattern [k]==’=’){
f=1;
operand2=Double.parseDouble(o2);
if(pattern [i]==’+’){
ans=operand1+operand2;
}else if(pattern [i]==’-‘){
ans=operand1-operand2;
}else if(pattern [i]==’/’){
ans=operand1/operand2;
}else if(pattern [i]==’X’){
ans=operand1*operand2;
}
break outerloop;
}else{
o2+=Character.toString(pattern [k]);
}
}
}
}

if(f==1)
System.out.print(ans);

Q3. problem statement

Complete the code to perform a 45 degree anti clock wise rotation with respect to the center of a 5 × 5 2D Array as shown below:

Code:-

char mat[][]= new char[5][5];

for(int L=0;L<5; L++)
{
String input = sc.nextLine();
char seq[] = input.toCharArray();
if(seq.length==5){
for(int i=0;i<5;i++)
{
mat[L][i]=seq[i];
}
}else
{
System.out.print(“Wrong Input!”);
System.exit(0);
}
}

char tran[][] = new char[5][5];
String outer[]={“00″,”10″,”20″,”30”,
“40”,”41″,”42″,”43″,
“44”,”34″,”24″,”14″,
“04”,”03″,”02″,”01″};

String inner[]={“11″,”21″,”31″,”32”,
“33”,”23″,”13″,”12″};

for(int i=0;i<5;i++)
{
for(int j=0;j<5;j++)
{

for(int k=0; k<outer.length; k++)
{
char indices[]=outer[k].toCharArray();
int a = Integer.parseInt(String.valueOf(indices[0]));
int b = Integer.parseInt(String.valueOf(indices[1]));
if(a==i && b==j)
{
if(k==15){k=1;}
else if(k==14){k=0;}
else {k+=2;}
indices=outer[k].toCharArray();
a = Integer.parseInt(String.valueOf(indices[0]));
b = Integer.parseInt(String.valueOf(indices[1]));
tran[a][b] = mat[i][j];
break;
}
}

for(int k=0; k<inner.length; k++)
{
char indices[]=inner[k].toCharArray();
int a = Integer.parseInt(String.valueOf(indices[0]));
int b = Integer.parseInt(String.valueOf(indices[1]));
if(a==i && b==j){
if(k==7){k=0;}
else {k+=1;}
indices=inner[k].toCharArray();
a = Integer.parseInt(String.valueOf(indices[0]));
b = Integer.parseInt(String.valueOf(indices[1]));
tran[a][b] = mat[i][j];
break;
}
}

tran[2][2] = mat[2][2];
}
}

for(int i=0;i<5;i++){
for(int j=0;j<5;j++){
System.out.print(tran[i][j]);
}
System.out.println();
}

Q4. A program needs to be developed which can mirror reflect any 5 × 5 2D character array into its side-by-side reflection. Write suitable code to achieve this transformation as shown below:

Code:-

char act[][]= new char[5][5];

char ref[][]= new char[5][5];

for(int L=0;L<5; L++)
{
String input = sc.nextLine();
char seq[] = input.toCharArray();
if(seq.length==5)
{
for(int i=0;i<5;i++)
{
act[L][i]=seq[i];
}
}
}

for(int i=0; i<5;i++)
{
for(int j=0; j<5;j++)
{
ref[i][j]=act[i][4-j];
}
}

for(int i=0; i<5;i++)
{
for(int j=0; j<5;j++)
{
System.out.print(ref[i][j]);
}
System.out.println();
}

Q5. Write suitable code to develop a 2D Flip-Flop Array with dimension 5 × 5, which replaces all input elements with values 0 by 1 and 1 by 0. An example is shown below:

Code:-

char act[][]= new char[5][5];

for(int L=0;L<5; L++)
{
String input = sc.nextLine();
char pat[] = input.toCharArray();
if(pat.length==5){
for(int i=0;i<5;i++)
{
if(pat[i]==’0′ || pat[i]==’1′)
{
act[L][i]=pat[i];
if(L==4 && i==4)
flipflop(act);
}
else
{
System.out.print(“Only 0 and 1 supported.”);
break;
}
}
}else
{
System.out.print(“Invalid length”);
break;
}

}
}
static void flipflop(char[][] flip)
{

for(int i=0; i<5;i++)
{
for(int j=0; j<5;j++)
{
if(flip[i][j]==’1′)
flip[i][j]=’0′;
else
flip[i][j]=’1′;
}
}

for(int i=0; i<5;i++)
{
for(int j=0; j<5;j++)
{
System.out.print(flip[i][j]);
}
System.out.println();
}

Yhaa You have done it but next? if YOU Want to your Others Programming In JAVA Assignments Answers Then Follow US HERE and Join Telegram.

Related Posts

Leave a Reply

Your email address will not be published.