0% found this document useful (0 votes)
2 views4 pages

Model Answer 2021java

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views4 pages

Model Answer 2021java

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Model Answer 2021 Paper 3

Language: Java
Question 1 Code
private void btnDisplayActionPerformed([Link] evt)
{
String MyName= [Link]();
[Link](null,"Hello " + MyName);
}
Question 1 Output

Question 2
User Interface

1|Page ;
Real Programmers use semi colon ( ) No to Pseudocodes
Question 2. Codes
private void btnAddActionPerformed([Link] evt) {
double num1,num2,result;
num1= [Link]([Link]());
num2= [Link]([Link]());
result = num1 + num2;
[Link]([Link](result));
}

private void btnDivideActionPerformed([Link] evt) {


double num1,num2,result;
num1= [Link]([Link]());
num2= [Link]([Link]());
result = num1 / num2;
[Link]([Link](result));
}

private void btnSubtractActionPerformed([Link] evt) {


double num1,num2,result;
num1= [Link]([Link]());
num2= [Link]([Link]());
result = num1 - num2;
[Link]([Link](result));
}

private void btnMultiplyActionPerformed([Link] evt) {


double num1,num2,result;
num1= [Link]([Link]());
num2= [Link]([Link]());
result = num1 * num2;
[Link]([Link](result));
}

private void btnClearActionPerformed([Link] evt) {


[Link]("");
[Link]("");
[Link]("");
}

private void btnExitActionPerformed([Link] evt) {


[Link]();
}

2|Page ;
Real Programmers use semi colon ( ) No to Pseudocodes
Question 3
GUI

Question 3 Codes

private void btnLengthActionPerformed([Link] evt) {


int l = [Link]().length();
[Link]([Link](l));
}

private void btnReverseActionPerformed([Link] evt) {


char[] chars = [Link]().toCharArray();
int i;
String rev="";
for(i=[Link]-1;i>=0;i--)
{
rev+= chars[i];
}
[Link](rev);
}

Output

3|Page ;
Real Programmers use semi colon ( ) No to Pseudocodes
4|Page ;
Real Programmers use semi colon ( ) No to Pseudocodes

You might also like