Class XII IP GROUP 1 Question Bank From previous …...1 Class XII IP GROUP_1 Question Bank From...
Transcript of Class XII IP GROUP 1 Question Bank From previous …...1 Class XII IP GROUP_1 Question Bank From...
1
Class XII IP
GROUP_1
Question Bank From previous Year CBSE Board Question Papers
Advanced GUI Programming-More on Swing Controls
2011
Q. Mr. Radhey Shyam Bansal the owner of the Kiddi Land Enterprise has asked his
programmer Ekta to devlop the following GUI in Netbeans.
Mr. Bansal accepts payment through three types of credit cards. The discount is
given according to the following scheme:
If the bill amount is more than Rs. 25,000/- then the customer gets an additional offer
of 5%. Write java code for the following:
i. To assign Additional Discount as 0 (jTextField4) and Net amount as 0
(jTextField5). Also set them as un-editable. 1
ii. when “Calculate Discount” (jButton1) is clicked] To calculate discount as per the given criteria and display the same in
jTextField3 To assign Additional Discount (jTextField4) as 5% of amount (jTextField2) as per the above condition. To enable “Calculate Net Amount” (jButton2) button 2
iii. [when “Calculate Net Amount” (jButton2) button is clicked] To calculate net amount as [TotalCost(jTextField2)- Discount (jTextField3) -Additional Discount (jTextField4)] To display the net amount in jTextField5. 2
Answer:
2
(i) jTextField4.setText("0"); jTextField5.setText("0");
jTextField4.setEditable(false); jTextField5. setEditable(false);
(ii) double discount = 0.0 ; double billAmount=Double.parseDouble(jTextField2.getText()); if(jRadioButton1.isSelected()) discount = 0.20; if(jRadioButton2.isSelected()) discount = 0.15; if (jRadioButton3.isSelected()) discount = 0 .10; jTextField3.setText(billAmount * discount + “”) ; if (billAmount > 25000) jTextField4.setText (billAmount*0.05+“ ”); jButton2.setEnabled(true) ;
(iii) doube netAmount = Double.parseDouble(jTextField2.getText()) Double.parseDouble(jTextField3.getText())
Double.parseDouble(jTextField4.getText()); jTextField5.setText(netAmount + " ");
2012
Q. Janav Raj is a programmer at Path Educo Enterprises. He created the following
GUI in NetBeans. Help him to write code for the following:
i. To display series of odd or even number (depending on Starting Number-jTextField1 is even or odd) in the jTextArea on the click of command button [Display The Series]. 2
ii. To clear both the text fields and text area, on clicking [Reset] button. 2 iii. To terminate the application on the click of [stop] button. (Assume suitable
names for the various controls on the Form) 1 Answer: i. int num1=Integer.parseInt(startTextField.getText()); int num2=Integer.parseInt(stopTextField.getText()); seriesTextArea.setText(null); if((num1 % 2)==0) { for(int i=num1;i<=num2;i=i+2) {
3
seriesTextArea.append(i+" "); } } else { for(int i=num1;i<=num2;i=i+2) { seriesTextArea.append(i+" "); } } ii. seriesTextArea.setText(null); startTextField.setText(null); stopTextField.setText(null); iii. System.exit(0);
2013
Q. Aditya is a programmer at Edudel enterprises. He created the following GUI in NetBeans.
Help him to write code in java for the following: (i) To calculate Total marks obtained and display in jTextField4 on the click of command button “Get Total”. 2 (ii) To calculate Grade obtained and display in jTextField5 on the click of command button “Get Grade”. Criteria for Grade calculation is given below: 2
(iii) To stop execution and exit from the application on the click of command button “Exit”. 1
4
Answer: (i) private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { int a=Integer.parseInt(jTextField1.getText()); int b=Integer.parseInt(jTextField2.getText()); int c=Integer.parseInt(jTextField3.getText()); int total=a+b+c; jTextField4.setText(Integer.toString(total)); } (ii) int t=Integer.parseInt(jTextField4.getText()); int a=t/3; if(a>=80) { jTextField5.setText("A"); } else if(a>65 && a<=55) { jTextField5.setText("B"); } else if(a>50 && a<=65) { jTextField5.setText("C"); } else if(a<=50) { jTextField5.setText("D"); } (iii) System.exit(0);
2014
Q. Mr. Rangaswami works at a Recreation Park as a system analyst. He has created the following GUI. When a group arrives at the Recreation Park, the number of people in the group and whether the group wants to enjoy the Water Park or not is entered. Entry fee is Rs. 500 per person. The person can choose to play at Water park by selecting the checkbox. Rides of Water Park will cost Rs. 250 extra per person.
Help him to write code for the following: (i) On the click of ‘Calculate’ button, textfield for ‘Entry Fees’ should display Entry Fees per person x number of people. If ‘Water Park’ check box is selected, textfield for ‘Water Park charges’ should display Water Park Charges per Person x Number of People. textField for ‘total Amount’ should display sum of Entry Fees and Water Park charges for all the people in the group. 3
5
(ii)Write java code to clear all Textboxes on the click of ‘Clear’ Button. 1 (iii) Write java Code to close the application on the click of ‘Exit’ Button. 1 Answer: i. Int wfee=0; Int tfee=0; Int nop=Integer.parseInt(JTextField1.getText()); Int efee=nop*500; If(JCheckBox1.isSelected()) Wfee=nop*500; tfee=efee+wfee; jTextField2.setText(“” +efee); jTextField3.setText(“” +wfee); jTextField4.setText(“” +tfee); ii. JTextField1.setText(“” ); JTextField2.setText(“” ); JTextField3.setText(“” ); JTextField4.setText(“” ); iii. System.exit(0);
2015 Q. The students of “Shiksha Vidyalaya” work for different extracurricular activities like ‘community Outreach Program’, ‘Swachh Bharat Abhiyan’ and ‘Traffic Safety Club’. The Programmer at the school has developed a GUI application as shown below:
A student can participate in more than activities.
Each student gets 10 points for each activity- namely Community Outreach Programme, Swachh Bharat ABhiyan and Traffic Safety Club.
6
Help the programmer to write code for the following: (i) When ‘Calculate Total Score’ button is clicked, the points for each activity (that is selected) should be displayed in the text field in from of that activity’s checkbox and the Total score should be displayed in the appropriate Text field. 3 (ii) When Clear button is clicked, all the Textfields and Checkboxes should be cleared. 1 (iii) When Stop button is clicked, the application should close. 1 (i) int score=0; if(jCheckBox1.isSelected()) { jTextField3.setText("" + 10); score=score+10; } if(jCheckBox2.isSelected()) { jTextField4.setText("" + 10); score=score+10; } if(jCheckBox3.isSelected()) { jTextField5.setText("" + 10); score=score+10; } jTextField6.setText(""+score); } (ii) jTextField1.setText(""); jTextField2.setText(""); jTextField3.setText(""); jTextField4.setText(""); jTextField5.setText(""); jTextField6.setText(""); jCheckBox1.setSelected(false); jCheckBox2.setSelected(false); jCheckBox3.setSelected(false); } (iii) System.exit(0);
Class XII IP
Question Bank From previous Year CBSE Board Question Papers
Database Management System-Concepts
Q.1 What is SQL?
Ans . SQL is Non-procedural universal data access language used to access and
manipulate data stored in nearly all the data bases available currently. SQL standards
are defined by ANSI (American National Standards Institute). SQL statements are
used to retrieve and update data in a database. SQL works with database programs
like MySQL, MS Access, DB2, Informix, MS SQL Server, Oracle, Sybase, etc.
Q.2 Differentiate between DDL and DML? (2011-12)
Ans Data Definition Language (DDL): This is a category of SQL commands. All the
commands which are used to create, destroy, or restructure databases and tables
come under this category. Examples of DDL commands are - CREATE, DROP,
ALTER.
Data Manipulation Language (DML): This is a category of SQL commands. All the
commands which are used to manipulate data within tables come under this category.
Examples of DML commands are - INSERT, UPDATE, DELETE.
Q.3 What is a constraint?
Ans : A constraints is a condition or check application on a field or set of fields.
Example: NOT NULL (ensure that column con not have null value), CHECK (make
7
sure that all value satisfy certain criteria), UNIQUE (ensure that all values in a column
are different) etc.
Q.4 What are single row functions? (2010-11)
Ans: Single Row Function work with a single row at a time. A single row function
returns a result for every row of acquired table Examples of Single row functions are
Sqrt(), Concat(), Lcase(), Upper(), Day(), etc.
Q.5 Compare CHAR and VARCHAR data types. (2012-13)
Ans. The CHAR data-type stores fixed length strings such that strings having length
smaller than the field size are padded on the right with spaces before being stored.
The VARCHAR on the other hand supports variable length strings and therefore stores
strings smaller than the field size without modification.
Q.6 What are the differences between DELETE and DROP commands of SQL?
(2013-14)
Ans: DELETE is DML command while DROP is a DDL command. Delete is used to
delete rows from a table while DROP is used to remove the entire table from the
database.
Q.7 What do you understand by MySQL Client? (2010-11)
Ans: MySQL Clients are programs that connect to MySQL Server and issue queries
in predefined format.
Q.8Differentiate between Alternate key and Candidate key.
2011
Answer:
Q.9 What is the purpose of ALTR TABLE command in MySql? How is it different from
UPDATE command?
2011
Answer: ALTER TABLE command is used to modify the structure of a table.
GROUP_2
CONTROL STRUCTURE
S.NO
YEAR QUESTION /ANSWER MARKA
8
1 2016 Identify the odd one out of the following Java statements. State reason for your choice. (i) for (ii) do while (iii) switch (iv) while
1
2 2014 What will be the values of variables agg and agg1 after the execution of the following loops?
2
3 2014 What will be displayed in jTextArea1 after the execution of the following loop? for(int I=5; I>=2;I--)
jTextArea1.setText(jTextArea1.getText()+” “+Integer.toString(I*I));
2
4 2014 What will be displayed in jTextArea1 after the execution of the following code: int G=1; do { jTextArea1.setText(Integer.toString(G++)); G=G+1; }while(G<=5);
2
5 2012 What is the purpose of break keyword while using Switch Case Statement? Illustrate with the help of an example
1
6 2013 How many times will the following loops execute? Which one of them is Entry Control and which one is Exit?
2
7 2013 What will be displayed in jTextField1 and jTextField2 after the execution of the following loop? int Sum=0,Last=10; for (int C=1;C<=Last;C+=2) Sum++; jTextField1.setText(Integer.toString(Sum)); jTextField2.setText(Integer.toString(C));
2
8 2013 Rewrite the following program code using a if statement. String Remarks; int Code=Integer.parseInt(jTextField1.getText()); switch(Code) { case 0 : Remarks=”100% Tax Exemption”;
2
9
break; case 1 : Remarks=”50% Tax Exemption”; break; case 2 : Remarks=”3% Tax Exemption”; break; default: Remarks=”! Invalid Entry”; }
9 2013 Observe the following code carefully and find which statement will never get executed in the code? int t=1; //Statement 1 do //Statement 2 { //Statement 3 if (t>13) //Statement 4 jTextField1.setText("Something"); //Statement 5 else //Statement 6 jTextField1.setText("Pass"); //Statement 7 t+=3; //Statement 8 } //Statement 9 while (t<=15); //Statement 10
1
10 2012 What message will be displayed after the execution of the following code? int Age=64,Relaxation=4; int ModiAge=Age – Relaxation; if (ModiAge<60) jOptionPane.showMessageDialog(Null,”NOT eligible”); else jOptionPane.showMessageDialog(Null,”eligible”);
2
FUNCTION IN MYSQL
S.NO YEAR QUESTION MARKA
1 2016 (i)Name 2 Group (Aggregate) function of SQL? (ii) Consider the table Table : Company
CompanyCode Donations
C101 13000
C102 NULL
C104 7000
C105 4000
What output will be displayed by the following SQL Statement? SELECT AVG(Donations) FROM Company;
2
2 2014 Distinguish between Single Row and Aggregate functions of MySQL. Write one example of each.
2
3 2014 A numeric column MONEY contains 34567.7896. write a command to truncate MONEY
(i) Up to 2 decimal places. (i.e. expected result 34567.78) (ii) (ii) Up to -3 places. (i.e. expected result 34000)
2
4 2014 Shanya Khanna is using a table Employee. It has the following columns. Admno, Name, Agg, Stream [coloumn Agg contains Aggregate marks]
2
10
She wants to display highest Agg obtained in each Stream. She wrote the following statement: SELECT Stream, MAX(Agg) FROM Employee; But she did not get the desired result. Rewrite the above query with necessary changes to help her get the desired output.
5 2013 What is the difference between CURDATE () and DATE () functions? 1
6 2013 There is a column Salary in a Table EMPLOYEE. The following two statements are giving different outputs. What may be the possible reason? SELECT COUNT(*) FROM EMPLOYEE; SELECT COUNT(SALARY) FROM EMPLOYEE;
2
PROGRAMMING FINDAMENTALS
S.NO YEAR QUESTION MARKA
1 2016 Write the purpose of parseInt() method. 1
2 2016 Identify invalid variable names out of the following. State reason if invalid. (i) for (ii) .salary (iii) salary12 (iv) product
1
3 2016 What is the difference between statement (i) and (ii) (i) t = 2 (ii) if(t= =2) d=3
1
4 2014 Is a string containing a single character same as a char? 1
5 2014 Write a statement in Java to declare a String type variable with a name City.
1
6 2014 Distinguish between ‘/’ and ‘%’ operator. 1
7 2014 What will be the value X1 after execution of the following code: String x1=”Spread”, x2=”PEACE”; x1=x2.concat(x1);
1
8 2014 Write Java statement to make a jTextfield1.disabled. 1
9 2013 Mr. Kapoor is a programmer at Ekansh Enterprises. He created 5 digit password and stored in a string variable called strPassword. He wants to store the same password in an Integer type variable called intPassword. Write an appropriate Java statement to transfer the content from strPassword to intPassword.
1
10 2013 Write a java statement to make the jTextField1 non-editable. 1
11 2013 What will be the contents of Str1 and Str2 after the following code is executed? String Str2,Str1; Str1="Dear Friend"; Str2="Hello"; Str1=Str2.concat(Str1);
2
GROUP_3
Question Bank of Previous year
Web Application Development
S.NO
.
QUESTIONS MARKS YEAR
1 Which HTML tags are used for making a table and adding rows in a HTML document? 1 2011
2 How is <OL> tag different from <UL> tag of HTML? 1 2011
3 Differentiate between XML and HTML 1 2011
4 Write the name of HTML tag used to include numbered list in a HTML Web Page. 1 2012
5 Write HTML code for the following: 1 2012
11
To provide hyperlink to a website :http://www.cbse.nic.in"
6 Differentiate between the <TR> and <TD> tags of HTML with the help of an appropriate example.
1 2013
7 Name two attributes of FONT tag of HTML. 2 2013
8 (i) Insert a picture in the web page. (ii) Insert an empty line in the web page.
1 2014
9 Give two attributes of Table element of HTML. 2 2014
10 After typing the HTML code using a text editor, how do you see how it would look as a web page ?
1 2015
11 ‘‘With XML there are no predefined tags’’ – Explain in brief with the help of an example
2 2015
12
2 2016
13
2 2016
14
1 2016
outside
Delhi
15
1 2016
outside
Delhi
12
Mysql Advanced & Data Base Transitions
Q.1 What is a Transaction? Which command is used to make changes done by a transaction permanent on a database?
2015
Q.2
2012
Q.3
2012
Q.4
2012
Q.5 Mr. Krishnaswami is working on a database and has doubt about the concept of SAVEPOINT in a transaction. Write down the meaning of SAVEPOINT and provide a simple example considering yourself as an online web support executive.
2013
Q.6 What is the use of COMMIT statement in SQL? How is it different from ROLLBACK statement? 2013
13
Q.7
2013
Q.8
2013
Q.9
2013
14
Q.10 What happens when ROLLBACK command is issued in a transaction process?
2013
Q.11 Shanya Khanna is using a table Employee. It has the following columns. Admno, Name, Agg, Stream [ column Agg contains aggregate marks] Shewants to display highest Agg in each stream. She wrote the following statement: SELECT Stream, MAX(Agg) FROM Employee; But she did not get the desired result. Rewrite the above query with necessary changes to help her get the desired output.
2013
Q.12
(i) To display all information of the students of humanities in descending order of percentage.
(ii) To display Adno, Name, Percentage and Stream of those students whose name is less than 6
characters long.
(iii) To add another column Bus)Fees with datatype and size as decimal (8,2).
(iv) To increase percentage by 2% of all the humanities students.
(v) SELECT COUNT(*) FROM EXAM;
(vi) SELECT Sname, Percentage FROM EXAM WHERE Name LIKE “N%”;
(vii) SELECT ROUND(Percentage,0) FROM EXAM WHERE Adno=”R005”;
2013
Q.13
2013
15
Q.14
2016
Q.15
2016
Q.16
2016
16
Q.17
2016
Q.18
2016
17
Q.19
2016
GROUP_4
Networking and Open Source Softwares
1 Expand the following abbreviations and explain in brief : (i) FLOSS (ii) GNU
2007
2 Write one point of difference between a freeware and free software. 2007
3 Write one example to show how Data mining is helpful in decision making.
2007
4 How is Post implementation review important during System development Life Cycle ?
2007
5 Identify the type of relationship represented in the following statement and draw an Entity Relationship Diagram to show it : 2 “A customer can buy many items.”2007
2007
6 Ms. Taufiq Ahmed wants to prevent unauthorized access to/from his company's local area network. Write the name of a system (software/ hardware), which he should install to do the same
2011
7 Beauty Lines Fashion Inc. is a fashion company with design unit and market unit 135 metres away from each other. The company recently connected their LANs using Ethernet cable to share the stock related information. But after joining their LANs, they are not able to share the information due to loss of signal in between. Which device out of the following. Should you suggest to be installed for a smooth communication? 1
2011
18
(i) UPS (ii) Modem (iii) Repeater
8 Which of the following is not a feature of Networking? 1 (i) Resource sharing (ii) Uninterrupted power supply (iii) Reduced cost (iv) Reliability
2011
9 Name any two Indian scripts included in Unicode. 2011
10 Mr. Jayanto Das is confused between Shareware and Open source software Mention at least two points of differences to help her understand the same.
2011
11 Identify the type of Topology from the following: 2 (i) If each node is connected with the help of independent cable with the help of a central switching (communication controller) (ii) If each node is connected with the help of a single co-axial cable.
2011
12 Define the following with reference to Threats to Network Security. 2 (i) Trojan Horse (ii) Worm
2011
13 Skte t'wo advantages of networking computers instead of having standalone computers.
2014
14 What was the objective behind developing UNICODE ? 2014
15 Expand the following terms : (i) WAN (ii)OSS
2014
16 What is the purpose of switch in a network ? 2014
17 Identify the following devices : (i) An intelligent device that connects several nodes to form a network and redirects the received information only to intended node(s). (ii) A device that regenerates (amplifies) the received signal and re-transmits it to its destination.
2014
18 What is the name of the network topology in which each hode is connected independently using a switch ?
2014
19 What is meant by "Denial of Service" with reference to Internet service ?
2014
20 Why is a switch called an intelligent hub ? 2014 outside delhi
21 What was the objective behind developing UNICODE ? 2014 outside delhi
22 Expand the following terms : (i) OSS (ii) ODF
2014 outside delhi
23 What is the use of Repeater in a Network ? 2014 outside delhi
24 Identify the following device : (i) A device that is used to connect different types of networks. It performs the necessary translation so that the connected networks can communicate properly. (ii) A device that converts data from digital bit stream into an
2014 outside delhi
19
analog signal and vice versa.
25 Write one advantage and one disadvantage of using Optical fibre cable.
2014 outside delhi
26 Distinguish between Open Source Software and Proprietary Software. 2014 outside delhi
27 Given below are two addresses : (i) http://www.abc.com/index.htm (ii) 182.68.9.165 Identify which one of the above is an IP address and which one is a URL.
2014 compartment
28 Expand (i) ODF (ii) HTTP
2014 compartment
29 How is a Trojan Horse harmful to a network ? 2014 compartment
30 What do the following top level domains signify ? (i) .edu (ii) .org
2014 compartment
31 Write one advantage each of Star and Bus topology used in networking.
2014 compartment
32 List two measures to secure a computer network. 2014 compartment
33 What is common in all of the following software(s) ? Firefox, Perl, PHP, OpenOffice.org Write one feature of the above category of software.
2014 compartment
34 A company has 3 departments namely Administrative, Sales, Production. Out of telephone cable, Optical Fiber, Ethernet Cable, which communication medium is best for high speed communication between departments ?
2015 Delhi
35 Name one open source Indian operating system. 2015 Delhi
36 What is the purpose of a Server in a network ? 2015 Delhi
37 What do the following top level domains signify ? (i) .com (ii) .org
2015 Delhi
38 List 2 measures to secure a network. 2015 Delhi
39 Distinguish between MAC address and IP address with the help of example of each.
2015 Delhi
40 Distinguish between Phonetic text entry and keymap based entry of typing Indian language text.
2015 Delhi
41 A school with 20 stand-alone computers is considering networking them together and adding a server. State 2 advantages of doing this.
2015 Outside Delhi
42 Distinguish between LAN and WAN. 2015 Outside Delhi
43 What is the purpose of Modem in network ? 2015 Outside Delhi
44 Write one example of IP Address. 2015 Outside Delhi
20
45 Define ‘Domain Name Resolution’. 2015 Outside Delhi
46 Name two threats to security in a network. What is the role of Firewall in Network security ?
2015 Outside Delhi
47 Write one advantage and one disadvantage of Open Source software over Proprietary software.
2015 Outside Delhi
48 Vidya College has three departments that are to be connected into a network. Which of the following communication medium (out of the given options), should be used by the college for connecting their departments for very effective High Speed communication? ∙ Coaxial Cable ∙ Optical Fiber ∙ Ethernet Cable Also name the type of network (out of PAN/LAN/WAN) formed.
2016 Outside Delhi
49 State reason why Star topology requires more cable length than Bus topology.
2016 Outside Delhi
50 Seema needs a network device that should regenerate the signal over the same network before the signal becomes too weak or corrupted. Amit needs a network device to connect two different networks together that work upon different networking models so that the two networks can communicate properly. Name the devices that should be used by Seema and Amit.
2016 Outside Delhi
51 How is a domain name related to an IP address? 2016 Outside Delhi
52 How is firewall useful in ensuring network security? 2016 Outside Delhi
53 Two doctors have connected their mobile phones to transfer a picture file of a person suffering from a skin disease. What type of network is formed? Which communication media out of Coaxial cable, Optical fiber, Bluetooth, Satellite link should be used to transfer the file?
2016 Delhi
54 State reason why Star topology requires more cable length than Bus topology.
2016 Delhi
55 “Open Source Software developers work for the good of Community”. Is this statement true? Give reason.
2016 Delhi
56 What happens during ‘Domain Name Resolution’? 2016 Delhi
57 How is ‘Denial of service’ attack, a threat to Network security? 2016 Delhi
58 Identify odd one out of the following: Optical Fiber / Coaxial Cable / Bluetooth / Twisted Pair Cable. Give reason for your answer.
2017 Outside Delhi
59 How is it easier to diagnose fault in Star topology than in Bus topology?
2017 Outside Delhi
60 What is the purpose of logical address of computer? 2017 Outside Delhi
21
61 Does Open source software only mean that the software is free of cost? Give reason for your answer.
2017 Outside Delhi
62 Which of the following are valid IP addresses? Give reason(s) if invalid.
i) 121.23.1.45 ii) 192.168.0.254 iii) 192.168.0.1 iv) 198.-1.1.1
2017 Outside Delhi
Question bank JAVA
1 While working in Netbeans, Ms Kanta Surbhi wants to display 'Cleared' orRe-attempt required' message depending the marks entered in jTextField.Help her to choose more appropriate statement out of 'If statement' and 'Switch statement'. 1(Delhi 2012) 2 Write a statement to make jTextArea1 as un-editable. 1(Delhi 2012) 3 Which HTML tags are used for making a table and adding rows in a HTML document? 1(Delhi 2012) 4 How is <UL> tag different from <OL> tag of HTML? 1(Delhi 2012) 5 What will be the value of A and B after execution of the following code: 2(Delhi 2012) int A = 100, B ; for (B=10; B<=12; B++) { A+=B; } JOptionPane. showMessageDialog (this, “A:”+A+”B:”+B+””) ;
6 Define data encapsulation with reference to Object Oriented Programming. 1(Delhi
2012)
7.Name the method is used to extract value of index while using ListBox in Java.
1(Delhi 2012)
8. What is the difference between the use of isSelected and setSelected methods
used with Jcheckbox in Java. (Delhi 2013)
22
9. Name any two commonly used methods of JComboBox control? (Delhi 2013)
10. What is button group and which control is used with button group? (Delhi 2014)
11. Distinguish between ‘/’ and ‘%’ operator. (Delhi 2014)
12.Which property of Listbox is used to display values in the List. (Delhi 2014)
13What will be displayed in jTextAreal after the execution of the following loop ?
for (int f=5, I<=25; I+=5) jTextArea1. setText.(j TextAreal . getText()+“ ”+Integer.toString(2*I) ) ; (Delhi 2014) 14.Write the value of the of t after execution of following code. (Delhi 2015) Int t; Int s; S=6; t=(8*s++)%7; Q.15 In a switch statement what is the purpose of break statement. (Delhi 2015) Q.16Write a Java code to assign value 70 to the variable Y Then decrease the values of Y by 5 and store its value in Z. (Delhi 2015) Q.17 What is the difference between SetVisible and Set Enabled Method. (Delhi 2016) Q.18 When is If-Else statement preferred over Switch statement. Q.19 Rewrite the following code using While loop.
Int sum-0; (for int i=9;i>=1;i--); { I%3==0; Sum=sum+I; Else sum=sum –I; }
Q20 The following code has some error(s). Rewrite the correct code underlining all the corrections made.2 (Delhi 2015) int written, interview; written = Integer.parseInt(jTextField1.getText()); interview = Integer.parseInt(jTextField2.getText()); if (written <80) OR (interview <15) { System.out.println(Not selected); } Else; { System.out.println(“Selected”); } Q.21 How many times will the following loop execute :2 (Delhi 2015)
int z = 7, sum = 0; do { sum = sum + z; z = z+2; system.out.println(“ ”+z); }
23
while (z <=12); Q.22 Rewrite the following program code using IF ELSE IF instead of SWITCH
statement.2
String rem; int code = Integer.parseInt(jTextField1.getText() ); Switch (code) { case 1 : rem = “Classes start on 8 th April”; break; case 2 : rem = “Classes start on 10 th April”; break; case 3 : rem = “Classes start on 12 th April”; break; default : rem = “Contact Admin Office”;
Q.23 Write the values of sum and t after execution of the following code : (Delhi
2015)
int sum,t; sum = 27; t = 3; sum = sum + 2
∗ (++t); Q.24 What will be the contents of jTextField1 and jTextField2 after executing the
following code : (Delhi 2015)
String s = “Best”; String r = “Luck”; String z; Z = r.concat(s); jTextField1.setText(z); jTextField2.setText(r.toUpperCase()); Q.25 Write the value that will be assigned to variable x after executing the following statement. (Delhi 2016) X=20-5+320/5; Q.26 Consider the statement Choice=’Y’; What is the datatype of variable choice? Write a JAVA statement to declare the variable ‘choice’. (Delhi 2017) Q.27 While working in Netbeans IDE ,Amit wants that the text in a Text in a Text area should move to the next line without breaking the word . Which properties would help him to do that? (Delhi 2017)
24
Q.28 Write a JAVA statement to Append a string “ABC” to the next line without breaking the word. Which properties would help him to do that? (Delhi 2017) Q.29 Rewrite the following code using if else if statement instead of switch (Delhi 2017) Switch (success){ Case -1 : x1=”NO result”; Break; Case 0: x1= “Final result- Not Sucessful”; Break; Default : x1 = “result not known”; Break; }
Q.30 Write the values of r and s after the execution of the following code: (Delhi 2017)
Int p=11;
Int q =21;
Int r ;
Inr s;
r =q++;
s = P++;
r++;