3-Rewrite the following program code using a Switch statement: 2

Size: px
Start display at page:

Download "3-Rewrite the following program code using a Switch statement: 2"

Transcription

1 PRACTICE PAPER-IP CONVERSION 1-Rewrite the code using switch.case. 2 int a=3; if(a= =3) System.out.println( Number is odd ); if(a= =7) System.out.println( Number is odd ); if(a= =5) System.out.println( Number is odd ); if(a= =4) System.out.println( Number is even ); System.out.println( Number is not ); 2-Rewrite the following program code using a Switch statement: 2 if( code == 1 ) Month = January ; if ( code == 2 ) Month = February ; if ( code == 3 ) Month = March if ( code == 4 ) Month = April ; Month = No Match ; 3-Rewrite the following program code using a Switch statement: 2 int a=1,b=1; if(a==0&& b==0) System.out.print("even numbers"); if (a==1&& b==1) System.out.print("odd numbers"); 4-Rewrite the following program code using a Switch statement: 2 char ch=tf1.gettext().charat(0); if(ch== a ch== A ) System.out.println("word starts with A or a" ); if(ch== b ch== B ) System.out.println("word starts with B or b" ); System.out.println("word starts with"+ch); 5-Rewrite the following program code using a Switch statement: 2 String Fruit=tf1.getText().toLowerCase(); char First=Fruit.charAt(0); char Last=Fruit.charAt(Fruit.length()-1); if(first=='c'&& Last== 't') System.out.println("Dry Fruit="+Fruit); if(first=='b'&& Last== 'y')

2 System.out.println("Berry="+Fruit); 6-Rewrite the following code using if statement without affecting the output of the code: 2 int a=1; switch (a) case 1: System.out.print( Sunday ); case 2 : case 3 : case 4 : case 5 : case 6 : System.out.print( WeekDay ); case 7: System.out.print( Nearing Weekend ); default : System.out.print( Wrong Number ); 7-Rewrite the following program code using switch statement: 2 String S=tf1.getText().toLowerCase(); if(s== a s== e s== i s== o s== u ) System.out.print( First alphabet is vowel ); System.out.print( First alphabet is not vowel ); 8-Rewrite the following code using if statement without affecting the output of the code:2 char branch = 'E'; // C - CSE, E - ECE, I - ITC int year = 2; switch( year ) case 1: System.out.println("English, Maths, Drawing"); case 2: switch( branch ) case 'C': System.out.println("Data structures, Java, Computer Organization"); case 'E': System.out.println("Micro processors, Logic switching theory"); case 'I': System.out.println("Drawing, Manufacturing Machines"); 9- Rewrite the following code using if statement without affecting the output of the code:2 int i = 0;

3 int j = 1; switch(i) case 0: switch(j) case 0: System.out.println("i is 0, j is 0"); case 1: System.out.println("i is 0, j is 1"); default: System.out.println("nested default case!!"); break default: System.out.println("No matching case found!!"); CONVERSION 1-Rewrite the following code using while loop and also specify the final value of A & B 2 int A = 50, B; for(b = 5; B<=18; B++) A+=B; JOptionPane.showMessageDialog(null, Value of A and B is +A+ +B); 2-Change the following code using for loop without affecting the out put: 2 int j=1,s=0; while ( j < 10 ) System.out.print(j); s = s + j; j + =3; System.out.print(s); 3. Rewrite the following program code using for loop: 2 int num=6; int temp=num; while(num>=1) temp=temp-1; if (temp%2==0) System.out.println( Is even ); System.out.println( Is odd ); num=num-2;

4 4- Rewrite the following program code using do while: 2 for(int i=0 ; i < 5 ; i++) System.out.println( i is : + i); 5- Rewrite the following program code using do while: 2 double Number = ;int R; for(int Firsr = 0, Second = 0; Number > 0; Number = Number / 10;) R = Number % 10; if ( R % 2 == 0 ) First += R; Second += R; System.out.print(First Second ); ERROR 1- Find the errors for the following program: 2 int i=0, int x=0; while(i<20) if(i%2=0) x=x + i System.out.print (x + "" ); i++; 2- The following code has some error(s). Rewrite the correct code underlining all the corrections made: 2 Int n1,n2=10; n1=n2-5; if(n1=n2) jtextfield1.settext("n1 and n2 are equal"); jtextfield2.settext("n1 and n2 values are" +n1+ " "+n2); jtextfield1.settext("n1 and n2 are not equal"); jtextfield2.settext("n1 and n2 values are" +n1+ " "+n2); 3-Identify the syntax errors and rewrite the java code by removing the syntax error(s) 2 int x=0; for(i=1; i<10; i++) for(int j=5; j>i ; j--) System.put.print( The j is + j) System.out.display( The i is + i);

5 X=i+j; System.out.print( The x is + x) 4-The following code has some error(s).rewrite the correct code underlining all the corrections made: 2 int SUM=0,Step=5; int I; For(i=0;i=<5;++i) Step+=5; Sum+=Step; jtextfield1.showtext(double.tostring(sum)); 5-Find out the errors, if any and underline the correction made 2 int i=0;x=0; while ( i < 10 ) if (i % 2 = 0) x == x + i ; system.out.print(x + 1); i ++; OUTPUT 1-Given a string object named salary having value stored in it obtain the 1 output of the following: JOptionPane.showMessageDialog(null, +salary.length( )+Integer.parseInt(salary)); 2-What will be displayed in jtextfield1 after executing the following code? 1 int m = 15; m = m + 1; if ( m < 15 ) jtextfield1.settext(integer.tostring(m)); jtextfield1.settext(integer.tostring(m+15)); 3-What will be the contents of jtextfield1 after executing the following statement : 1 int n=20; n=n-6; if(n<10) jtextfield1.settext(integer.tostring(n)); jtextfield1.settext(integer.tostring(n-2)); 4-What will be the contents of jtextfield after executing the following statement?1 jtextfield.settext ( B + a );

6 5-What will be the content of textfield(s) tf1& tf2 2 tf1.settext(integer.parseint("21"+100)+100+""); tf2.settext("cbse\nfinal"); 6-What will be result of execution of following statement. 2 System.out.println( \\\\ ); System.out.print("hello\n world"); 7-What will be the content of jtextfield1 and jtextfield2 after executing the following code: 2 String st= New to Information Technology ; jtextfield1.settext(st.replace( Technology, Practices ); jtextfield2.settext(st.substring(7)); Ans- New to Information Practices Information Technology 8-What will be the content of jtextfield1 1 int x = 10; int y = 15; jtextfield1.settext( +(x>y)? 3.14: 3); 9-What will be the result of the execution of each statement. Which number is printed twice? 2 int sum1=3; sum1++; jtextfield1.settext( +sum1); ++sum1; jtextfield2.settext( +sum1); jtextfield3.settext( +(++sum1)); jtextfield4.settext( +(sum1++)); jtextfield5.settext( +sum1); 10- Analyze the program segment and determine how many times the body of loop will be executed and what will be content of jtextarea int x=5 ; y=50; while (x<=y) y=y/x; injtextarea1.settext ( +y) ; 11-What will be values of a and b after execution of the following code: 2 int a=1, b=0; for(a=2;a<=4;++a)

7 b=a++; --b; 12-What will be output of following code? 2 int x=5,y=20,cnt=x; while( x < = y) x++;y-- ;cnt+=x+y; System.out.print( x+ +y+ + cnt); 13-What will be the values of x and y after execution of the following code: 2 int x,y=0; for(x=1;x<=5;++x) y=x x;--y; 14-What will be output if following code executes 2 final int x=10; int y=0,m=0,z=8; while(y++ < z--) switch (y) case x-8: m+=x; case x-7: m+=z; case x-6: m+=m;; System.out.println(m); 15-What values will be assigned to the variable ua, ub, uc and fail after execution of the following program segment: 2 int i=0,ua=0,ub=0,uc=0,fail=0; while(i<=5) switch ( i++ ) case 1 :++ua; case 2 : ++ub; uc++; case 3 : case 4 : ++uc; ua++;ub++; default : ++fail;

8 16-Write the output of the following java code 2 int varl=10, var2=20; for (int i=1; i<=2; i++) System.out.print(varl++ +"\t" + --var2 +"\n"); System.out.print(var2-- +"\t" + ++varl +"\n"); 17-What will be the value of sum after executing the following code? 2 double i,sum=2 for(i=3;i<8;++i) if(i%4= =0) sum=math.pow(sum,i); sum+=i/2; 18- What will be the output produced by following code fragment? 2 float x=9f; float y=5f; int z=(int)(x/y); switch(z) case 1:x=x+2; case 2: x=x+3; default:x =x+1; System.out.println( value of x: +x);

INDIAN LEARNERS OWN ACADEMY,kuwait

INDIAN LEARNERS OWN ACADEMY,kuwait Submission Date: 22-03-2018 INDIAN LEARNERS OWN ACADEMY,kuwait INFORMATICS PRACTICES - XII ASSIGNMENT 2 PROGRAMMING FUNDAMENTALS 1. Find the output int number1=7,number2=8; int second=73; if(number1>0

More information

ASSIGNMENT FOR AUTUMN BREAK CLASS XI INFORMATICS PRACTICES ( )

ASSIGNMENT FOR AUTUMN BREAK CLASS XI INFORMATICS PRACTICES ( ) HARDWARE CONCEPTS ASSIGNMENT FOR AUTUMN BREAK CLASS XI INFORMATICS PRACTICES (2017-18) Q1. Write at least two points of difference between the following terms: (i) Analog Computer and Digital Computer

More information

CHAPTER 5 FLOW OF CONTROL

CHAPTER 5 FLOW OF CONTROL CHAPTER 5 FLOW OF CONTROL PROGRAMMING CONSTRUCTS - In a program, statements may be executed sequentially, selectively or iteratively. - Every programming language provides constructs to support sequence,

More information

HE AIR FORCE SCHOOL: SUBROTO PARK: DELHI CANTT WT-II SUB: INFORMATICS PRACTICES ANSWER KEY. 1. (a) What will be the output of the code 2

HE AIR FORCE SCHOOL: SUBROTO PARK: DELHI CANTT WT-II SUB: INFORMATICS PRACTICES ANSWER KEY. 1. (a) What will be the output of the code 2 HE AIR FORCE SCHOOL: SUBROTO PARK: DELHI CANTT. 110010 WT-II CLASS : XI SET I SUB: INFORMATICS PRACTICES ANSWER KEY MAX MARK: 30 TIME ALLOWED : 1Hr 10 Mins 1. (a) What will be the output of the code 2

More information

MONTHLY TEST (JUNE 2018) CLASS XII INFORMATICS PRACTICES

MONTHLY TEST (JUNE 2018) CLASS XII INFORMATICS PRACTICES M.M: 40 MONTHLY TEST (JUNE 2018) CLASS XII INFORMATICS PRACTICES TIME: 80 Mins. Q1. Which of the following is not a feature of Networking? (i) Resource Sharing (ii) Reliability (iii) Uninterrupted power

More information

Informatics Practices, Class XII ( ) (Summer Vacation-2015) (Holiday H.W) Java Concepts & Programming, MySQL

Informatics Practices, Class XII ( ) (Summer Vacation-2015) (Holiday H.W) Java Concepts & Programming, MySQL (Summer Vacation-2015) (Holiday H.W) Java Concepts & Programming, MySQL 1. How is ordinary compilation process different from Java compilation? 2. Differentiate between a component and a container. 3.

More information

I SEMESTER EXAM : : XI :COMPUTER SCIENCE : MAX MARK a) What is the difference between Hardware and Software? Give one example for each.

I SEMESTER EXAM : : XI :COMPUTER SCIENCE : MAX MARK a) What is the difference between Hardware and Software? Give one example for each. I SEMESTER EXAM : : XI :COMPUTER SCIENCE : MAX MARK 70. a) What is the difference between Hardware and Software? Give one example for each. b) Give two differences between primary and secondary memory.

More information

http:/// Sample Paper 2011 Class XII Subject Informatics Practices 1. Answer the following questions: (a) Define: i. IP address ii. Modem 2 (b) What is Denial-of-service? 2 (c) Write the purpose of the

More information

Chapter 3 Question Bank 1. Write the value of t after the execution of the following code : int t; int s; s=6; t = (8 * s++) % 7; 2.

Chapter 3 Question Bank 1. Write the value of t after the execution of the following code : int t; int s; s=6; t = (8 * s++) % 7; 2. Chapter 3 Question Bank 1. Write the value of t after the execution of the following code : int t; int s; s=6; t = (8 * s++) % 7; 2. Write the value of variable c after execution of the following code

More information

C212 Early Evaluation Exam Mon Feb Name: Please provide brief (common sense) justifications with your answers below.

C212 Early Evaluation Exam Mon Feb Name: Please provide brief (common sense) justifications with your answers below. C212 Early Evaluation Exam Mon Feb 10 2014 Name: Please provide brief (common sense) justifications with your answers below. 1. What is the type (and value) of this expression: 5 * (7 + 4 / 2) 2. What

More information

COE 212 Engineering Programming. Welcome to Exam II Monday May 13, 2013

COE 212 Engineering Programming. Welcome to Exam II Monday May 13, 2013 1 COE 212 Engineering Programming Welcome to Exam II Monday May 13, 2013 Instructors: Dr. Randa Zakhour Dr. Maurice Khabbaz Dr. George Sakr Dr. Wissam F. Fawaz Name: Solution Key Student ID: Instructions:

More information

Half Yearly Examination SESSION: CLASS: Scholars 2 Subject :- Informatics Practices (ANSWER KEY) SECTION-A

Half Yearly Examination SESSION: CLASS: Scholars 2 Subject :- Informatics Practices (ANSWER KEY) SECTION-A Code : 065 Subodh Public School Half Yearly Examination SESSION: 2018-19 CLASS: Scholars 2 Subject :- Informatics Practices (ANSWER KEY) SECTION-A Q 1. Answer the following questions:- (20 Marks) i. It

More information

Conditionals. For exercises 1 to 27, indicate the output that will be produced. Assume the following declarations:

Conditionals. For exercises 1 to 27, indicate the output that will be produced. Assume the following declarations: Conditionals For exercises 1 to 27, indicate the output that will be produced. Assume the following declarations: final int MAX = 25, LIMIT = 100; int num1 = 12, num2 = 25, num3 = 87; 1. if (num1 < MAX)

More information

COE 212 Engineering Programming. Welcome to Exam II Thursday April 21, Instructors: Dr. Salim Haddad Dr. Joe Tekli Dr. Wissam F.

COE 212 Engineering Programming. Welcome to Exam II Thursday April 21, Instructors: Dr. Salim Haddad Dr. Joe Tekli Dr. Wissam F. 1 COE 212 Engineering Programming Welcome to Exam II Thursday April 21, 2016 Instructors: Dr. Salim Haddad Dr. Joe Tekli Dr. Wissam F. Fawaz Name: Student ID: Instructions: 1. This exam is Closed Book.

More information

Sample Paper 2011 Class XII Subject Informatics Practices Time 03 hrs Max Marks 70 General Instructions:- 1. All questions are compulsory. 2. Question paper carries A, B & C Three parts. 3. Section A is

More information

The Hyderabad Public School Begumpet, Hyderabad, A.P.

The Hyderabad Public School Begumpet, Hyderabad, A.P. The Hyderabad Public School Begumpet, Hyderabad, A.P. Department of Computer Science Mid Term Examination 2013 Worksheet-1 Sub: Computer Applications Class:10 1. Define the term Byte code. 2. What do you

More information

Question Bank. 4. Write a menu driven program to accept two numbers and find a. HCF / GCD b. LCM

Question Bank. 4. Write a menu driven program to accept two numbers and find a. HCF / GCD b. LCM Question Bank 1. Write a program using over loading function with name as area to calculate a. Area of a square (side * side) b. Area of a rectangle (length * breadth) c. Area of a circle. ( * radius *

More information

6 COMPUTER PROGRAMMING

6 COMPUTER PROGRAMMING 6 COMPUTER PROGRAMMING ITERATION STATEMENT CONTENTS WHILE DO~WHILE FOR statement 2 Iteration Statement provides While / do-while / For statements for supporting an iteration logic function that the logic

More information

CSC 1214: Object-Oriented Programming

CSC 1214: Object-Oriented Programming CSC 1214: Object-Oriented Programming J. Kizito Makerere University e-mail: jkizito@cis.mak.ac.ug www: http://serval.ug/~jona materials: http://serval.ug/~jona/materials/csc1214 e-learning environment:

More information

Downloaded from

Downloaded from FIRST TERMINAL EXAMINATION, INFORMATICS PRACTICES Time : 3 hrs. Class - XI M.M. : 70 Instructions: This question paper contains seven questions. All the questions are compulsory. Answer the questions carefully.

More information

KENDRIYA VIDYALAYA SANGATHAN BLUE PRINT INFORMATICS PRACTICES CLASS XII

KENDRIYA VIDYALAYA SANGATHAN BLUE PRINT INFORMATICS PRACTICES CLASS XII KENDRIYA VIDYALAYA SANGATHAN BLUE PRINT INFORMATICS PRACTICES CLASS XII TOPICS SA() SA() LA(6) TOTAL Networking & Open 4(4) 3(6) - 7(0) Source software Programming in Java 7(7) 6() (6) 4(5) RDBMS 6(6)

More information

D.A.V PUBLIC SCHOOLS, RANCHI ZONE FIRST SUMMATIVE ASSESSMENT CLASS - XI COMPUTER SCIENCE

D.A.V PUBLIC SCHOOLS, RANCHI ZONE FIRST SUMMATIVE ASSESSMENT CLASS - XI COMPUTER SCIENCE D.A.V PUBLIC SCHOOLS, RANCHI ZONE FIRST SUMMATIVE ASSESSMENT 2011-2012 CLASS - XI COMPUTER SCIENCE Q1. Input a number and then print the sum of the digits. [4] Q2. Input a number and then print its reverse.

More information

CLASS XII SAMPLE PAPER-065 INFORMATICS PRACTICES

CLASS XII SAMPLE PAPER-065 INFORMATICS PRACTICES CLASS XII SAMPLE PAPER-065 INFORMATICS PRACTICES Time- 3hrs Max m Marks-70 General Instructions : (i) All questions are compulsory. (ii) Answer the questions after carefully reading the text. Q1 (i) (a)

More information

Control Structures in Java if-else and switch

Control Structures in Java if-else and switch Control Structures in Java if-else and switch Lecture 4 CGS 3416 Spring 2017 January 23, 2017 Lecture 4CGS 3416 Spring 2017 Selection January 23, 2017 1 / 26 Control Flow Control flow refers to the specification

More information

TIME : 3 Hrs MAX. MARKS : 70 SET 1

TIME : 3 Hrs MAX. MARKS : 70 SET 1 Sample Paper 0 Class XI Subject Informatics Practices TIME : 3 Hrs MAX. MARKS : 70 SET Q (a) Which of the following is not hardware : (i) Hard disk (ii) Printer (iii) Keyboard (iv) CPU (v) Assembler (vi)

More information

1. Answer the following : a) What do you mean by Open Source Software. Give an example. (2)

1. Answer the following : a) What do you mean by Open Source Software. Give an example. (2) THE AIR FORCE SCHOOL Class XI First Terminal Examination 2017-18 Computer Science (083) Time: 3 hrs. M. Marks : 70 General Instructions : (i) All the questions are compulsory. (ii) Programming Language

More information

Sample Paper-2011 Class : XII MM : 70 Subject : Informatics Practices Time : 3 hours

Sample Paper-2011 Class : XII MM : 70 Subject : Informatics Practices Time : 3 hours Sample Paper-0 Class : XII MM : 70 Subject : Informatics Practices Time : 3 hours General Instructions :. This question paper is divided into three sections. Section A consists marks. 3. Section B is of

More information

King Saud University College of Computer and Information Sciences Computer Science Department

King Saud University College of Computer and Information Sciences Computer Science Department King Saud University College of Computer and Information Sciences Computer Science Department Course Code: CSC 111 Course Title: Introduction to Programming 1 Semester: Fall 2017-18 Exercises Cover Sheet:

More information

ASSIGNMENT CLASS-11 COMPUTER SCIENCE [C++]

ASSIGNMENT CLASS-11 COMPUTER SCIENCE [C++] ASSIGNMENT-1 2016-17 CLASS-11 COMPUTER SCIENCE [C++] 1 Consider the following C++ snippet: int x = 25000; int y = 2*x; cout

More information

Tasks for fmri-setting (Tasks of first and second pilot study at the end)

Tasks for fmri-setting (Tasks of first and second pilot study at the end) Tasks for fmri-setting (Tasks of first and second pilot study at the end) 1. Faculty int result = 1; int x = 4; while (x > 1) { result = result * x; x--; 7. Find max in list of numbers public static void

More information

Tutorial 06. Conditional statement: if then, if else, switch

Tutorial 06. Conditional statement: if then, if else, switch College of Computer and Infmation Sciences CSC111 Computer Programming I Exercise 1: Tutial 06 Conditional statement: if then, if, switch What is the output of each of the following code fragments? (given

More information

INDIAN SCHOOL SOHAR FIRST TERM EXAM ( ) INFORMATICS PRACTICES

INDIAN SCHOOL SOHAR FIRST TERM EXAM ( ) INFORMATICS PRACTICES INDIAN SCHOOL SOHAR FIRST TERM EXAM (2015-2016) INFORMATICS PRACTICES Page 1 of 5 No. of printed pages: 5 Class: XI Marks: 70 Date: 10-09-15 Time: 3 hours Instructions: a. All the questions are compulsory.

More information

13. What is the meaning of Open Source in the term Open Source Database Management. 14. Difference between Proprietary and Open Source Software.

13. What is the meaning of Open Source in the term Open Source Database Management. 14. Difference between Proprietary and Open Source Software. Dehradun Public School I-Term Assignment (2016-17) Subject-Informatics Practices (065) Class -XII Chapter 1. Computer Networking 1. How is firewall useful in ensuring network security? [CBSE 2016] 2. State

More information

3/12/2018. Structures. Programming in C++ Sequential Branching Repeating. Loops (Repetition)

3/12/2018. Structures. Programming in C++ Sequential Branching Repeating. Loops (Repetition) Structures Programming in C++ Sequential Branching Repeating Loops (Repetition) 2 1 Loops Repetition is referred to the ability of repeating a statement or a set of statements as many times this is necessary.

More information

UNIT II(PROGRAMMING IN JAVA AND WEB APPLICATION DEVELOPMENT) (From this unit: 14 Questions - 25 Marks)

UNIT II(PROGRAMMING IN JAVA AND WEB APPLICATION DEVELOPMENT) (From this unit: 14 Questions - 25 Marks) UNIT II(PROGRAMMING IN JAVA AND WEB APPLICATION DEVELOPMENT) (From this unit: 14 Questions - 25 Marks) One Mark Questions 1. Write HTML code to set background image of a document. 2. Rewrite the following

More information

ITL Public School First Term Exam( )

ITL Public School First Term Exam( ) ITL Public School First Term Exam(05-6) Date:.09.5 Class: XI Computer Science(087) Time:3hrs. M. M: 70 General Instructions:. All Questions are compulsory.. Maintain the order of the answers. 3. Try to

More information

CS 170 Exam 2. Version: A Spring Name (as in OPUS) (print): Instructions:

CS 170 Exam 2. Version: A Spring Name (as in OPUS) (print): Instructions: CS 170 Exam 2 Version: A Spring 2016 Name (as in OPUS) (print): Section: Seat Assignment: Instructions: Keep your eyes on your own paper and do your best to prevent anyone else from seeing your work. Do

More information

I. True/False: (2 points each)

I. True/False: (2 points each) CS 102 - Introduction to Programming Midterm Exam #2 - Prof. Reed Spring 2008 What is your name?: (2 points) There are three sections: I. True/False..............54 points; (27 questions, 2 points each)

More information

(c) ((!(a && b)) == (!a!b)) TRUE / FALSE. (f) ((!(a b)) == (!a &&!b)) TRUE / FALSE. (g) (!(!a) && (c-d > 0) && (b!b))

(c) ((!(a && b)) == (!a!b)) TRUE / FALSE. (f) ((!(a b)) == (!a &&!b)) TRUE / FALSE. (g) (!(!a) && (c-d > 0) && (b!b)) ComS 207: Programming I Midterm 2, Tue. Mar 21, 2006 Student Name: Student ID Number: Recitation Section: 1. True/False Questions (10 x 1p each = 10p) Determine the value of each boolean expression given

More information

Computer Programming, I. Laboratory Manual. Experiment #6. Loops

Computer Programming, I. Laboratory Manual. Experiment #6. Loops Think Twice Code Once The Islamic University of Gaza Engineering Faculty Department of Computer Engineering Fall 2017 ECOM 2005 Khaleel I. Shaheen Computer Programming, I Laboratory Manual Experiment #6

More information

e) Implicit and Explicit Type Conversion Pg 328 j) Types of errors Pg 371

e) Implicit and Explicit Type Conversion Pg 328 j) Types of errors Pg 371 Class IX HY 2013 Revision Guidelines Page 1 Section A (Power Point) Q1.What is PowerPoint? How are PowerPoint files named? Q2. Describe the 4 different ways of creating a presentation? (2 lines each) Q3.

More information

University of Cape Town Department of Computer Science. Computer Science CSC115F

University of Cape Town Department of Computer Science. Computer Science CSC115F University of Cape Town Department of Computer Science Computer Science CSC115F Class Test 2 Solutions Wednesday 6 April 2005 Marks: 40 Approximate marks per question are shown in brackets Time: 40 minutes

More information

Downloaded from

Downloaded from CHAPTER 8: DATABASE CONNECTIVITY TO MYSQL MYSQL provides connectivity for client applications developed in the Java programming language via JDBC driver, which is called MYSQL Connector/J. There are four

More information

Term 1 Unit 1 Week 1 Worksheet: Output Solution

Term 1 Unit 1 Week 1 Worksheet: Output Solution 4 Term 1 Unit 1 Week 1 Worksheet: Output Solution Consider the following what is output? 1. System.out.println("hot"); System.out.println("dog"); Output hot dog 2. System.out.print("hot\n\t\t"); System.out.println("dog");

More information

Guru Gobind Singh Public School Sector V,B Bokaro Steel City Annual IP Assignment Class 11

Guru Gobind Singh Public School Sector V,B Bokaro Steel City Annual IP Assignment Class 11 Guru Gobind Singh Public School Sector V,B Bokaro Steel City Annual IP Assignment Class 11 1. What will be the output of given expression : int a=7; System.out.println(++a + + a-- + + a+1 + +a++); System.out.println(a);

More information

Lara Technologies Special-Six Test

Lara Technologies Special-Six Test Flow control Part-1 Q: 01 Given: 10. public class Bar 11. static void foo( int... x ) 12. // insert code here 13. 14. Which two code fragments, inserted independently at line 12, will allow the class to

More information

10/30/2010. Introduction to Control Statements. The if and if-else Statements (cont.) Principal forms: JAVA CONTROL STATEMENTS SELECTION STATEMENTS

10/30/2010. Introduction to Control Statements. The if and if-else Statements (cont.) Principal forms: JAVA CONTROL STATEMENTS SELECTION STATEMENTS JAVA CONTROL STATEMENTS Introduction to Control statements are used in programming languages to cause the flow of control to advance and branch based on changes to the state of a program. In Java, control

More information

INDIAN SCHOOL SOHAR FINAL EXAMINATION ( ) INFORMATICS PRACTICES (065)

INDIAN SCHOOL SOHAR FINAL EXAMINATION ( ) INFORMATICS PRACTICES (065) INDIAN SCHOOL SOHAR FINAL EXAMINATION (2015-2016) INFORMATICS PRACTICES (065) No. of printed pages: 5 Please check that this question paper contains 5 printed pages. Please check that this question paper

More information

COMPUTER APPLICATIONS

COMPUTER APPLICATIONS COMPUTER APPLICATIONS (Theory) (Two Hours) Answers to this Paper must be written on the paper provided separately. You will not be allowed to write during the first 15 minutes. This time is to be spent

More information

COMP 250: Java Programming I. Carlos G. Oliver, Jérôme Waldispühl January 17-18, 2018 Slides adapted from M. Blanchette

COMP 250: Java Programming I. Carlos G. Oliver, Jérôme Waldispühl January 17-18, 2018 Slides adapted from M. Blanchette COMP 250: Java Programming I Carlos G. Oliver, Jérôme Waldispühl January 17-18, 2018 Slides adapted from M. Blanchette Variables and types [Downey Ch 2] Variable: temporary storage location in memory.

More information

Chapter 18: Repetitive Structures

Chapter 18: Repetitive Structures Chapter 18: Repetitive Structures Practice Questions A. Answer the following questions: 1. What is a loop? Discuss Elements that Control a Loop. Ans. Loop is a repetitive structure that allows a group

More information

Logic & program control part 3: Compound selection structures

Logic & program control part 3: Compound selection structures Logic & program control part 3: Compound selection structures Multi-way selection Many algorithms involve several possible pathways to a solution A simple if/else structure provides two alternate paths;

More information

COE 212 Engineering Programming. Welcome to Exam II Tuesday November 28, 2018

COE 212 Engineering Programming. Welcome to Exam II Tuesday November 28, 2018 1 COE 212 Engineering Programming Welcome to Exam II Tuesday November 28, 2018 Instructors: Dr. Dima El-khalil Dr. Jawad Fahs Dr. Joe Tekli Dr. Wissam F. Fawaz Name: Student ID: Instructions: 1. This exam

More information

INDIAN LEARNERS OWN ACADEMY, KUWAIT Informatics Practices XII Holiday Homework. b. What is the importance of abstract classes in programming?

INDIAN LEARNERS OWN ACADEMY, KUWAIT Informatics Practices XII Holiday Homework. b. What is the importance of abstract classes in programming? INDIAN LEARNERS OWN ACADEMY, KUWAIT Informatics Practices XII Holiday Homework 1. a. Define the term Polymorphism. What are the two ways polymorphism is demonstrated in Java? b. What is the importance

More information

Programming Questions and Solutions in Java (15CS561)

Programming Questions and Solutions in Java (15CS561) This document can be downloaded from www.chetanahegde.in with most recent updates. 1 Programming Questions and Solutions in Java (15CS561) 1. Write a program to find area of circle. class Circle int r=3;

More information

UNIT 2 Introduction to Programming

UNIT 2 Introduction to Programming UNIT 2 Introduction to Programming PROGRAMMING FUNDAMENTALS Java programming language was originally developed by Sun Microsystems which was initiated by James Gosling and released in 1995 as core component

More information

Higher National Diploma in Information Technology First Year, Second Semester Examination 2015

Higher National Diploma in Information Technology First Year, Second Semester Examination 2015 [All Rights Reserved] SLIATE SRI LANKA INSTITUTE OF ADVANCED TECHNOLOGICAL EDUCATION (Established in the Ministry of Higher Education, vide in Act No. 29 of 1995) Higher National Diploma in Information

More information

CHAPTER 6 MOST COMMONLY USED LIBRARIES

CHAPTER 6 MOST COMMONLY USED LIBRARIES LIBRARY CHAPTER 6 - A set of ready-made software routines (class definitions) that can be reused in new programs, is called a Library. - Some commonly used java libraries are : Math Library String Library

More information

Principles of Computer Science

Principles of Computer Science Principles of Computer Science Lecture 2 Dr. Horia V. Corcalciuc Horia Hulubei National Institute for R&D in Physics and Nuclear Engineering (IFIN-HH) January 27, 2016 Loops: do-while do-while loops do

More information

CHAPTER 3 JAVA GUI PROGRAMMING REVISION TOUR - I. The smallest individual unit a program is known as a Token. Java has following types of tokens:

CHAPTER 3 JAVA GUI PROGRAMMING REVISION TOUR - I. The smallest individual unit a program is known as a Token. Java has following types of tokens: CHAPTER 3 JAVA GUI PROGRAMMING REVISION TOUR - I TOKENS The smallest individual unit a program is known as a Token. Java has following types of tokens: Keywords Identifiers Literals Punctuators/Separators

More information

CSci 1113 Midterm 1. Name: Student ID:

CSci 1113 Midterm 1. Name: Student ID: CSci 1113 Midterm 1 Name: Student ID: Instructions: Please pick and answer any 7 of the 9 problems for a total of 70 points. If you answer more than 7 problems, only the first 7 will be graded. The time

More information

The following expression causes a divide by zero error:

The following expression causes a divide by zero error: Chapter 2 - Test Questions These test questions are true-false, fill in the blank, multiple choice, and free form questions that may require code. The multiple choice questions may have more than one correct

More information

CSCE 145 Exam 1 Review Answers. This exam totals to 100 points. Follow the instructions. Good luck!

CSCE 145 Exam 1 Review Answers. This exam totals to 100 points. Follow the instructions. Good luck! CSCE 145 Exam 1 Review Answers This exam totals to 100 points. Follow the instructions. Good luck! Chapter 1 This chapter was mostly terms so expect a fill in the blank style questions on definition. Remember

More information

VOLUME II CHAPTER 9 INTRODUCTION TO C++ HANDS ON PRACTICE PROGRAMS

VOLUME II CHAPTER 9 INTRODUCTION TO C++ HANDS ON PRACTICE PROGRAMS VOLUME II CHAPTER 9 INTRODUCTION TO C++ HANDS ON PRACTICE PROGRAMS 1. Write C++ programs to interchange the values of two variables. a. Using with third variable int n1, n2, temp; cout

More information

16. What is the significance of the break statement in a switch block?

16. What is the significance of the break statement in a switch block? Section A : Question carrying 1 Mark 01. How is data different from information? 02. Arrange the following in descending order :- Nibble, KB, Bit, GB,TB,Byte,MB 03. What is the significance of task bar

More information

UNIT-2 PROGRAMMING QUESTIONS (OLD CBSE PAPER BASED JAVA AND HTML QUESTIONS)

UNIT-2 PROGRAMMING QUESTIONS (OLD CBSE PAPER BASED JAVA AND HTML QUESTIONS) UNIT-2 PROGRAMMING QUESTIONS (OLD CBSE PAPER BASED JAVA AND HTML QUESTIONS) 1. Write the value of t after the execution of the following code : int t; int s; s=6; t = (8 * s++) % 7; 2. Write the value

More information

Introduction to the Java Basics: Control Flow Statements

Introduction to the Java Basics: Control Flow Statements Lesson 3: Introduction to the Java Basics: Control Flow Statements Repetition Structures THEORY Variable Assignment You can only assign a value to a variable that is consistent with the variable s declared

More information

CS111: PROGRAMMING LANGUAGE II

CS111: PROGRAMMING LANGUAGE II CS111: PROGRAMMING LANGUAGE II Computer Science Department Lecture 1(c): Java Basics (II) Lecture Contents Java basics (part II) Conditions Loops Methods Conditions & Branching Conditional Statements A

More information

CS 170 Exam 2. Version: A Spring Name (as in OPUS) (print): Instructions:

CS 170 Exam 2. Version: A Spring Name (as in OPUS) (print): Instructions: CS 170 Exam 2 Version: A Spring 2016 Name (as in OPUS) (print): Section: Seat Assignment: Instructions: Keep your eyes on your own paper and do your best to prevent anyone else from seeing your work. Do

More information

CMPS 12A Winter 2006 Prof. Scott A. Brandt Final Exam, March 21, Name:

CMPS 12A Winter 2006 Prof. Scott A. Brandt Final Exam, March 21, Name: CMPS 12A Winter 2006 Prof. Scott A. Brandt Final Exam, March 21, 2006 Name: Email: This is a closed note, closed book exam. There are II sections worth a total of 200 points. Plan your time accordingly.

More information

n Group of statements that are executed repeatedly while some condition remains true

n Group of statements that are executed repeatedly while some condition remains true Looping 1 Loops n Group of statements that are executed repeatedly while some condition remains true n Each execution of the group of statements is called an iteration of the loop 2 Example counter 1,

More information

Sequence structure. The computer executes java statements one after the other in the order in which they are written. Total = total +grade;

Sequence structure. The computer executes java statements one after the other in the order in which they are written. Total = total +grade; Control Statements Control Statements All programs could be written in terms of only one of three control structures: Sequence Structure Selection Structure Repetition Structure Sequence structure The

More information

Sample Paper Class XI Subject Computer Sience UNIT TEST II

Sample Paper Class XI Subject Computer Sience UNIT TEST II Sample Paper Class XI Subject Computer Sience UNIT TEST II (General OOP concept, Getting Started With C++, Data Handling and Programming Paradigm) TIME: 1.30 Hrs Max Marks: 40 ALL QUESTIONS ARE COMPULSURY.

More information

Condi(onals and Loops

Condi(onals and Loops Condi(onals and Loops 1 Review Primi(ve Data Types & Variables int, long float, double boolean char String Mathema(cal operators: + - * / % Comparison: < > = == 2 A Founda(on for Programming any program

More information

BRAIN INTERNATIONAL SCHOOL. Term-I Class XI Sub: Computer Science Revision Worksheet

BRAIN INTERNATIONAL SCHOOL. Term-I Class XI Sub: Computer Science Revision Worksheet BRAIN INTERNATIONAL SCHOOL Term-I Class XI 2018-19 Sub: Computer Science Revision Worksheet Chapter-1. Computer Overview 1. Which electronic device invention brought revolution in earlier computers? 2.

More information

SBOA SCHOOL & JUNIOR COLLEGE, CHENNAI 101 COMPUTER SCIENCE CLASS: XI HALF YEARLY EXAMINATION MAX MARKS:70 CODE - A DURATION : 3 Hours

SBOA SCHOOL & JUNIOR COLLEGE, CHENNAI 101 COMPUTER SCIENCE CLASS: XI HALF YEARLY EXAMINATION MAX MARKS:70 CODE - A DURATION : 3 Hours SBOA SCHOOL & JUNIOR COLLEGE, CHENNAI 101 COMPUTER SCIENCE CLASS: XI HALF YEARLY EXAMINATION 2016 MAX MARKS:70 CODE - A DURATION : 3 Hours All questions are compulsory. Do not change the order of the questions

More information

CSC141, Computer Science I, Instructor: Dr. Zhen Jiang, Test 2

CSC141, Computer Science I, Instructor: Dr. Zhen Jiang, Test 2 CSC141, Computer Science I, Instructor: Dr. Zhen Jiang, Test 2 Name(print) Student Number Page Points Score 2 8 3 8 4 8 5 6 6 8 7 8 8 10 9 6 10 6 11 11 12 21 Total 100 1 Part 1 (56 pts): Select the correct

More information

Q1 Q2 Q3 Q4 Q5 Total 1 * 7 1 * 5 20 * * Final marks Marks First Question

Q1 Q2 Q3 Q4 Q5 Total 1 * 7 1 * 5 20 * * Final marks Marks First Question Page 1 of 6 Template no.: A Course Name: Computer Programming1 Course ID: Exam Duration: 2 Hours Exam Time: Exam Date: Final Exam 1'st Semester Student no. in the list: Exam pages: Student's Name: Student

More information

Downloaded from

Downloaded from SURE SHOT QUESTIONS Long Questions:- Subject:- Informatics Practices Class- XII 1. Deb Bastralaya has developed a GUI application for their company as shown below The company accepts payments in 3 modes-

More information

CMPE110, Sample questions

CMPE110, Sample questions CMPE110, Sample questions Number : Name :... Q1)Give the correct answer for following: 1. What is the value of x after the following statement? double x; x = 3.0 / 4.0 + 3 + 2 / 4 a. 5.75 b. 4.25 c. 1.75

More information

Exam 2. Programming I (CPCS 202) Instructor: M. G. Abbas Malik. Total Marks: 40 Obtained Marks:

Exam 2. Programming I (CPCS 202) Instructor: M. G. Abbas Malik. Total Marks: 40 Obtained Marks: كلية الحاسبات وتقنية المعلوما Exam 2 Programming I (CPCS 202) Instructor: M. G. Abbas Malik Date: November 22, 2015 Student Name: Student ID: Total Marks: 40 Obtained Marks: Instructions: Do not open this

More information

KENDRIYA VIDYALAYA ONGC PANVELSESSION ENDING EXAM

KENDRIYA VIDYALAYA ONGC PANVELSESSION ENDING EXAM KENDRIYA VIDYALAYA ONGC PANVELSESSION ENDING EXAM - 2013 KENDRIYA VIDYALAYA ONGC, PANVEL SESSION ENDING EXAMINATION 2012 SEE Set-2-2013 CLASS XI SUBJECT : INFORMATICS PRACTICES (065) Time Allowed : 3 Hrs.

More information

Java Control Statements

Java Control Statements Java Control Statements An introduction to the Java Programming Language Produced by: Eamonn de Leastar (edeleastar@wit.ie) Dr. Siobhan Drohan (sdrohan@wit.ie) Department of Computing and Mathematics http://www.wit.ie/

More information

PROGRAMMING IN C LAB MANUAL FOR DIPLOMA IN ECE/EEE

PROGRAMMING IN C LAB MANUAL FOR DIPLOMA IN ECE/EEE PROGRAMMING IN C LAB MANUAL FOR DIPLOMA IN ECE/EEE 1. Write a C program to perform addition, subtraction, multiplication and division of two numbers. # include # include int a, b,sum,

More information

SESSION ENDING EXAMINATION CLASS XI SUBJECT : INFORMATICS PRACTICES (065) Time Allowed : 3 Hrs. Max Marks : 70

SESSION ENDING EXAMINATION CLASS XI SUBJECT : INFORMATICS PRACTICES (065) Time Allowed : 3 Hrs. Max Marks : 70 SESSION ENDING EXAMINATION CLASS XI SUBJECT : INFORMATICS PRACTICES (065) Time Allowed : 3 Hrs. Max Marks : 70 Note : 1-This question paper is divided into three sections. 2- Section-A and Section-B are

More information

#include <iostream> #include <algorithm> #include <cmath> using namespace std; int f1(int x, int y) { return (double)(x/y); }

#include <iostream> #include <algorithm> #include <cmath> using namespace std; int f1(int x, int y) { return (double)(x/y); } 1. (9 pts) Show what will be output by the cout s in this program. As in normal program execution, any update to a variable should affect the next statement. (Note: boolalpha simply causes Booleans to

More information

KENDRIYA VIDYALAYA ALIGANJ SHIFT-II HOLIDAY HOMEWORK CLASS-XII INFORMATICS PRACTICES

KENDRIYA VIDYALAYA ALIGANJ SHIFT-II HOLIDAY HOMEWORK CLASS-XII INFORMATICS PRACTICES KENDRIYA VIDYALAYA ALIGANJ SHIFT-II HOLIDAY HOMEWORK 18-19 CLASS-XII INFORMATICS PRACTICES 1. Arrange the following data types in increasing order of their size : byte, int, float, double, char, boolean.

More information

MODULE 2: Branching and Looping

MODULE 2: Branching and Looping MODULE 2: Branching and Looping I. Statements in C are of following types: 1. Simple statements: Statements that ends with semicolon 2. Compound statements: are also called as block. Statements written

More information

CMPS 12A - Winter 2002 Final Exam A March 16, Name: ID:

CMPS 12A - Winter 2002 Final Exam A March 16, Name: ID: CMPS 12A - Winter 2002 Final Exam A March 16, 2002 Name: ID: This is a closed note, closed book exam. Any place where you are asked to write code, you must declare all variables that you use. However,

More information

Loops (while and for)

Loops (while and for) Loops (while and for) CSE 1310 Introduction to Computers and Programming Alexandra Stefan 1 Motivation Was there any program we did (class or hw) where you wanted to repeat an action? 2 Motivation Name

More information

Important Java terminology

Important Java terminology 1 Important Java terminology The information we manage in a Java program is either represented as primitive data or as objects. Primitive data פרימיטיביים) (נתונים include common, fundamental values as

More information

Programming Language A

Programming Language A Programming Language A Takako Nemoto (JAIST) 30 October Takako Nemoto (JAIST) 30 October 1 / 29 From Homework 3 Homework 3 1 Write a program to convert the input Celsius degree temperature into Fahrenheight

More information

Assignment2013 Please use this document only for verifying if your programs are right. Do not blindly copy paste and waste your time.

Assignment2013 Please use this document only for verifying if your programs are right. Do not blindly copy paste and waste your time. Please use this document only for verifying if your programs are right. Do not blindly copy paste and waste your time. 11/3/2013 TechSparx Computer Training Center Saravanan.G Please use this document

More information

INDIAN SCHOOL MUSCAT THIRD PRELIMINARY EXAMINATION INFORMATICS PRACTICES

INDIAN SCHOOL MUSCAT THIRD PRELIMINARY EXAMINATION INFORMATICS PRACTICES INDIAN SCHOOL MUSCAT THIRD PRELIMINARY EXAMINATION INFMATICS PRACTICES wer -Key CLASS: XII Sub. Code: 065 0.0.08 Max. Marks: 70 (a) Identify odd one out of the following: Optical Fiber/Coaxial Cable/ Bluetooth/Twisted

More information

Introduction to Computer Programming, Spring Term 2018 Practice Assignment 2 Discussion

Introduction to Computer Programming, Spring Term 2018 Practice Assignment 2 Discussion German University in Cairo Media Engineering and Technology Prof. Dr. Slim Abdennadher Dr. Mohammed Abdel Megeed Introduction to Computer Programming, Spring Term 2018 Practice Assignment 2 Discussion

More information

COMPUTER APPLICATIONS

COMPUTER APPLICATIONS Percentage of Candidates COMPUTER APPLICATIONS STATISTICS AT A GLANCE Total Number of students who took the examination 99,856 Highest Marks Obtained 100 Lowest Marks Obtained 27 Mean Marks Obtained 83.28

More information

DECISION CONTROL AND LOOPING STATEMENTS

DECISION CONTROL AND LOOPING STATEMENTS DECISION CONTROL AND LOOPING STATEMENTS DECISION CONTROL STATEMENTS Decision control statements are used to alter the flow of a sequence of instructions. These statements help to jump from one part of

More information

Week 1 Questions Question Options Answer & Explanation A. 10 B. 20 C. 21 D. 11. A. 97 B. 98 C. 99 D. a

Week 1 Questions Question Options Answer & Explanation A. 10 B. 20 C. 21 D. 11. A. 97 B. 98 C. 99 D. a Sr. no. Week 1 Questions Question Options Answer & Explanation 1 Find the output: int x=10; int y; y=x++; printf("%d",x); A. 10 B. 20 C. 21 D. 11 Answer: D x++ increments the value to 11. So printf statement

More information

Q2. What will be displayed in jtextfield1 and jtextfield2 after the following code is executed:

Q2. What will be displayed in jtextfield1 and jtextfield2 after the following code is executed: Q1. Holiday Homework, 2018-19 Class: XI Subject : Informatics Practices Q2. What will be displayed in jtextfield1 and jtextfield2 after the following code is executed: int num = 35, num1 = 46 ; jtextfield1.settext(

More information

Subject: PIC Chapter 2.

Subject: PIC Chapter 2. 02 Decision making 2.1 Decision making and branching if statement (if, if-, -if ladder, nested if-) Switch case statement, break statement. (14M) 2.2 Decision making and looping while, do, do-while statements

More information