3
INDIAN SCHOOL AL WADI AL KABIR Worksheet - 2, 2018-19 Class: XI Informatics Practices Submission Date:06.09.18 SECTION- A 1) Sam has a string value strSalary. He wants to convet the value into double and store in a double variable salary. Write a java statement to perform this conversion. 2) Which property is used to move the next character of the current word into the next line when it reaches the boundary of a text area? 3) Identify the errors in the following code fragment. Rewrite the Corrected program after underlining the place where corrections made. Double r, s; r=double.parseInt(t1.getText( ) ); S=r * 15; t2.settext(“ ”+s); 4) Write a java statement to convert the string value stored in a text field named txtMark into integer and store it into an integer variable mark. 5) Write a java statement to convert the double variable dRate into String variable strRate. 6) What is the value of z after the execution of the following code? int m, n = 20, z; z = (m – n) >= 30 ? m * 4 : m * n; (i) if m = 50 (ii) if m = 35 7) What will be the output of the following code fragment? inta,b; a=15; b=20; jTextField1.setText(“ “+a*b+(a+b)); jTextFiedl2.setText(“ “+a+b); 8) What is the value of x & y after executing the following code fragment? i) When k=35 ii) when k=65 int k=65, n=15; x= k * ++n + 20; y=--k+x*2; 9) A Book Store businessman asked you to create a GUI 1| Class XI/26-08-2018/ISWK/Comp. Sc

 · Web viewWhich property is used to move the next character of the current word into the next line when it reaches the boundary of a text area? Identify the errors in the following

Embed Size (px)

Citation preview

Page 1:  · Web viewWhich property is used to move the next character of the current word into the next line when it reaches the boundary of a text area? Identify the errors in the following

INDIAN SCHOOL AL WADI AL KABIR Worksheet - 2, 2018-19

Class: XI Informatics Practices

Submission Date:06.09.18

SECTION- A

1) Sam has a string value strSalary. He wants to convet the value into double and store in a double variable salary. Write a java statement to perform this conversion.

2) Which property is used to move the next character of the current word into the next line when it reaches the boundary of a text area?

3) Identify the errors in the following code fragment. Rewrite the Corrected program after underlining the place where corrections made.Double r, s;r=double.parseInt(t1.getText( ) );S=r * 15; t2.settext(“ ”+s);

4) Write a java statement to convert the string value stored in a text field named txtMark into integer and store it into an integer variable mark.

5) Write a java statement to convert the double variable dRate into String variable strRate.

6) What is the value of z after the execution of the following code?int m, n = 20, z;z = (m – n) >= 30 ? m * 4 : m * n;(i) if m = 50 (ii) if m = 35

7) What will be the output of the following code fragment?inta,b; a=15; b=20;jTextField1.setText(“ “+a*b+(a+b));jTextFiedl2.setText(“ “+a+b);

8) What is the value of x & y after executing the following code fragment?i) When k=35 ii) when k=65int k=65, n=15; x= k * ++n + 20; y=--k+x*2;

9) A Book Store businessman asked you to create a GUI application that will help to find the discount amount of a book sale based on the following criteria:discount = 15% of bookprice.Netamount = bookprice – discount.

The application will have three textfields ( first to enter bookprice, second to Display discount and third to display Netamount ). Design of the

application is as follows:

1| Class XI/ 2 6 - 0 8 - 2 0 1 8 / I S W K / C o m p . S c

Page 2:  · Web viewWhich property is used to move the next character of the current word into the next line when it reaches the boundary of a text area? Identify the errors in the following

10) Write a java program that takes cost of item in text field txtCost, rate of each item in another text field txtRate, find the amount (cost*rate) and store this result in another text field txtAmt. Also, Write the separate coding to clear these text fields and close the application.

11) What is the use of setText( ) and append( ) methods in Java Netbeans IDE?

12) Create a Java GUI to enter Sales amount in a text field and calculate the Incentive amount based on the sales amount. Incentive : 15 % of Sales Amount

13) Design a Java GUI to read the Customer Name, Customer Address, Purchase Amount of a customer in separate text fields, calculate and display Tax (10 % of Amount), Net Amount ( Purchase Amount + Tax) in separate text fields when the user clicks Calculate Button. Also write the coding for Clear All and Exit Button.

2| Class XI/ 2 6 - 0 8 - 2 0 1 8 / I S W K / C o m p . S c

Page 3:  · Web viewWhich property is used to move the next character of the current word into the next line when it reaches the boundary of a text area? Identify the errors in the following

3| Class XI/ 2 6 - 0 8 - 2 0 1 8 / I S W K / C o m p . S c