ICSE Class 10 Computer Applications ( Java ) 2012 Solved Question...
|
|
- Megan Francis
- 6 years ago
- Views:
Transcription
1 1 of : ICSE J Java for Class X Computer Applications ICSE Class 10 Computer Applications ( Java ) 01 Solved Question Paper 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 in reading the question paper. The time given at the head of this Paper is the time allowed for writing.the answers. This Paper is divided into two Sections. Attempt all questions from Section A and any four questions from Section B. The intended marks for questions or parts of questions are given in brackets [ ]. SECTION A (40 Marks) Attempt all questions. Question 1 (a) Give one example each of a primitive data type and a composite data type. [] Primitive Data Types byte, short, int, long, float, double, char, boolean Composite Data Type Class, Array, Interface (b) Give one point of difference between unary and binary operators. [] A unary operator requires a single operand whereas a binary operator requires two operands. Examples of Unary Operators Increment ( ++ ) and Decrement ( ) Operators Examples of Binary Operators +, -, *, /, % (c) Differentiate between call by value or pass by value and call by reference or pass by reference. [] In call by value, a copy of the data item is passed to the method which is called whereas in call by reference, a reference to the original data item is passed. No copy is made. Primitive types are passed by value whereas reference types are passed by reference.
2 of : (d) Write a Java expression for (under root of as+u ) [] Math.sqrt ( * a * s + Math.pow ( u, ) ) ( or ) Math.sqrt ( * a * s + u * u ) (e) Name the types of error (syntax, runtime or logical error) in each case given below: (i) Division by a variable that contains a value of zero. (ii) Multiplication operator used when the operation should be division. (iii) Missing semicolon. [] (i) Runtime Error (ii) Logical Error (iii) Syntax Error Question (a)create a class with one integer instance variable. Initialize the variable using: (i) default constructor (ii) parameterized constructor. [] 1 public class Integer { 3 int x; 4 5 public Integer() { 6 x = 0; 7 } 8 9 public Integer(int num) { 10 x = num; 11 } 1 } (b)complete the code below to create an object of Scanner class. Scanner sc = Scanner( ) [] Scanner sc = new Scanner ( System.in ) (c) What is an array? Write a statement to declare an integer array of 10 elements. [] An array is a reference data used to hold a set of data of the same data type. The following statement declares an integer array of 10 elements - int arr[] = new int[10]; (d) Name the search or sort algorithm that: (i) Makes several passes through the array, selecting the next smallest item in the array each time and placing it where it belongs in the array. (ii) At each stage, compares the sought key value with the key value of the middle element of the array. [] (i) Selection Sort
3 3 of : (ii) Binary Search (e) Differentiate between public and private modifiers for members of a class. [] Variables and Methods whwith the public access modie the class also. Question 3 (a) What are the values of x and y when the following statements are executed? [] x = false y = 63 1 int a = 63, b = 36; boolean x = (a < b )? true : false; int y= (a > b )? a : b ; (b) State the values of n and ch [] 1 char c = 'A': int n = c + 1; The ASCII value for A is 65. Therefore, n will be 66. (c) What will be the result stored in x after evaluating the following expression? [] x = x + (x++) + (++x) + x x = x = 0 1 int x=4; x += (x++) + (++x) + x; (d) Give the output of the following program segment: [] double x =.9, y =.5; System.out.println(Math.min(Math.floor(x), y)); 3 System.out.println(Math.max(Math.ceil(x), y)); Explanation : Math.min(Math.floor(x), y) = Math.min (.0,.5 ) =.0 Math.max(Math.ceil(x), y)) = Math.max ( 3.0,.5 ) = 3.0 (e) State the output of the following program segment. [] 1 String s = "Examination"; int n = s.length(); 3 System.out.println(s.startsWith(s.substring(5, n))); 4 System.out.println(s.charAt() == s.charat(6));
4 4 of : false true Explanation : n = 11 s.startswith(s.substring(5, n)) = s.startswith ( nation ) = false ( s.charat() == s.charat(6) ) = ( a == a ) = true (f) State the method that: (i) Converts a string to a primitive float data type (ii) Determines if the specified character is an uppercase character [] (i) Float.parseFloat(String) (ii) Character.isUpperCase(char) (g) State the data type and values of a and b after the following segment is executed.[] 1 String s1 = "Computer", s = "Applications"; a = (s1.compareto(s)); 3 b = (s1.equals(s)); Data type of a is int and b is boolean. ASCII value of C is 67 and A is 65. So compare gives =. Therefore a = b = false (h) What will the following code output? [] String s = "malayalam"; System.out.println(s.indexOf('m')); 3 System.out.println(s.lastIndexOf('m')); (i) Rewrite the following program segment using while instead of for statement [] 1 int f = 1, i; for (i = 1; i <= 5; i++) { 3 f *= i; 4 System.out.println(f); 5 } 1 int f = 1, i = 1; while (i <= 5) { 3 f *= i; 4 System.out.println(f); 5 i++; 6 } (j) In the program given below, state the name and the value of the
5 5 of : (i) method argument or argument variable (ii) class variable (iii) local variable (iv) instance variable [] 1 class myclass { 3 static int x = 7; 4 int y = ; 5 6 public static void main(string args[]) { 7 myclass obj = new myclass(); 8 System.out.println(x); 9 obj.samplemethod(5); 10 int a = 6; 11 System.out.println(a); 1 } void samplemethod(int n) { 15 System.out.println(n); 16 System.out.println(y); 17 } 18 } (i) name = n value =5 (ii) name = y value = 7 (iii) name = a value = 6 (iv) name = obj value = new MyClass() SECTION B (60 MARKS) Attempt any four questions from this Section. The answers in this Section should consist of the Programs in either Blue J environment or any program environment with Java as the base. Each program should be written using Variable descriptions/mnemonic Codes so that the logic of the program is clearly depicted. Flow-Charts and Algorithms are not required. Question 4 Define a class called Library with the following description: Instance variables/data members: Int acc_num stores the accession number of the book String title stores the title of the book stores the name of the author Member Methods: (i) void input() To input and store the accession number, title and author. (ii)void compute To accept the number of days late, calculate and display and fine charged at the rate of Rs. per day. (iii) void display() To display the details in the following format: Accession Number Title Author Write a main method to create an object of the class and call the above member methods. [ 15]
6 6 of : 1 public class Library { 3 int acc_num; 4 String title; 5 String author; 6 7 public void input() throws IOException { 8 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 9 System.out.print("Enter accession number: "); 10 acc_num = Integer.parseInt(br.readLine()); 11 System.out.print("Enter title: "); 1 title = br.readline(); 13 System.out.print("Enter author: "); 14 author = br.readline(); 15 } public void compute() throws IOException { 18 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 19 System.out.print("Enter number of days late: "); 0 int dayslate = Integer.parseInt(br.readLine());; 1 int fine = * dayslate; System.out.println("Fine is Rs " + fine); 3 } 4 5 public void display() { 6 System.out.println("Accession Number\tTitle\tAuthor"); 7 System.out.println(acc_num + "\t" + title + "\t" + author); 8 } 9 30 public static void main(string[] args) throws IOException { 31 Library library = new Library(); 3 library.input(); 33 library.compute(); 34 library.display(); 35 } 36 } Question 5 Given below is a hypothetical table showing rates of Income Tax for male citizens below the age of 65 years: Taxable Income (TI) in Income Tax in Does not exceed 1,60,000 Nil Is greater than 1,60,000 and less than or equal to 5,00,000 ( TI 1,60,000 ) * 10% Is greater than 5,00,000 and less than or equal to 8,00,000 [ (TI - 5,00,000 ) *0% ] + 34,000 Is greater than 8,00,000 [ (TI - 8,00,000 ) *30% ] + 94,000 Write a program to input the age, gender (male or female) and Taxable Income of a person.if the age is more than 65 years or the gender is female, display wrong category*. If the age is less than or equal to 65 years and the gender is male, compute and display the Income
7 7 of : Tax payable as per the table given above. [15] 1 import java.util.scanner; 3 public class IncomeTax { 4 5 public static void main(string[] args) { 6 Scanner scanner = new Scanner(System.in); 7 System.out.print("Enter age: "); 8 int age = scanner.nextint(); 9 System.out.print("Enter gender: "); 10 String gender = scanner.next(); 11 System.out.print("Enter taxable income: "); 1 int income = scanner.nextint(); 13 if (age > 65 gender.equals("female")) { 14 System.out.println("Wrong category"); 15 } else { 16 double tax; 17 if (income <= ) { tax = 0; } else if (income > && income <= ) { tax = (income ) * 10 / 100; } else if (income >= && income <= ) { 18 tax = (income ) * 0 / ; 19 } else { 0 tax = (income ) * 30 / ; 1 } System.out.println("Income tax is " + tax); 3 } 4 } 5 } Question 6 Write a program to accept a string. Convert the string to uppercase. Count and output the number of double letter sequences that exist in the string. Sample Input: SHE WAS FEEDING THE LITTLE RABBIT WITH AN APPLE Sample Output: 4 [ 15] 1 import java.util.scanner; 3 public class StringOperations { 4 5 public static void main(string[] args) { 6 Scanner scanner = new Scanner(System.in); 7 System.out.print("Enter a String: "); 8 String input = scanner.nextline(); 9 input = input.touppercase(); 10 int count = 0; 11 for (int i = 1; i < input.length(); i++) { 1 if (input.charat(i) == input.charat(i - 1)) { 13 count++; 14 } 15 } 16 System.out.println(count); 17 } 18 } Question 7
8 8 of : Design a class to overload a function polygon() as follows: (i) void polygon(int n, char ch) : with one integer argument and one character type argument that draws a filled square of side n using the character stored in ch. (ii) void polygon(int x, int y) : with two integer arguments that draws a filled rectangle of length x and breadth y, using the (iii)void polygon( ) : with no argument that draws a filled triangle shown below. Example: (i) Input value of n=, ch= O Output: OO OO (ii) Input value of x=, (iii) Output: * ** *** [15] 1 public class Overloading { 3 public void polygon(int n, char ch) { 4 for (int i = 1; i <= n; i++) { 5 for (int j = 1; j <= n; j++) { 6 System.out.print(ch); 7 } 8 System.out.println(); 9 } 10 } 11 1 public void polygon(int x, int y) { 13 for (int i = 1; i <= x; i++) { 14 for (int j = 1; j <= y; j++) { 15 System.out.print("@"); 16 } 17 System.out.println(); 18 } 19 } 0 1 public void polygon() { for (int i = 1; i <= 3; i++) { 3 for (int j = 1; j <= i; j++) { 4 System.out.print("*"); 5 } 6 System.out.println(); 7 } 8 } 9 } Question 8
9 9 of : Using the switch statement, writw a menu driven program to: (i) Generate and display the first 10 terms of the Fibonacci series 0,1,1,,3,5.The first two Fibonacci numbers are 0 and 1, and each subsequent number is the sum of the previous two. (ii)find the sum of the digits of an integer that is input. Sample Input: Sample Output: Sum of the digits=18 For an incorrect choice, an appropriate error message should be displayed [15] 1 import java.util.scanner; 3 public class Menu { 4 5 public static void main(string[] args) { 6 Scanner scanner = new Scanner(System.in); 7 System.out.println("Menu"); 8 System.out.println("1. Fibonacci Sequence"); 9 System.out.println(". Sum of Digits"); 10 System.out.print("Enter choice: "); 11 int choice = scanner.nextint(); 1 switch (choice) { 13 case 1: 14 int a = 0; 15 int b = 1; 16 System.out.print("0 1 "); 17 for (int i = 3; i <= 10; i++) { int c = a + b; System.out.print(c + " "); a = b; b = c; } break; case : System.out.print("Enter a number: "); int num = scanner.nextint(); int sum = 0; while (num > 0) { 18 int rem = num % 10; 19 sum = sum + rem; 0 num = num / 10; 1 } System.out.println("Sum of digits is " + sum); 3 break; 4 default: 5 System.out.println("Invalid Choice"); 6 } 7 } 8 } Question 9 Write a program to accept the names of 10 cities in a single dimension string array and their STD (Subscribers Trunk Dialing) codes in another single dimension integer array. Search for a name of a city input by the user in the list. If found, display Search Successful and print the name of the city along with its STD code, or else display the message Search Unsuccessful, No such city in the list. [15] 1 import java.util.scanner; 3 public class Cities { 4
10 10 of : 5 public static void main(string[] args) { 6 Scanner scanner = new Scanner(System.in); 7 String[] cities = new String[10]; 8 int[] std = new int[10]; 9 for (int i = 0; i < 10; i++) { 10 System.out.print("Enter city: "); 11 cities[i] = scanner.next(); 1 System.out.print("Enter std code: "); 13 std[i] = scanner.nextint(); 14 } 15 System.out.print("Enter city name to search: "); 16 String target = scanner.next(); 17 boolean searchsuccessful = false; 18 for (int i = 0; i < 10; i++) { 19 if (cities[i].equals(target)) { 0 System.out.println("Search successful"); 1 System.out.println("City : " + cities[i]); System.out.println("STD code : " + std[i]); 3 searchsuccessful = true; 4 break; 5 } 6 } 7 if (!searchsuccessful) { 8 System.out.println("Search Unsuccessful, No such city in the list"); 9 } 30 } 31 } 8 thoughts on ICSE Class 10 Computer Applications ( Java ) 01 Solved Question Paper gaurav January 4, 014 at 3:3 pm good annu February 5, 014 at 4:17 pm very well done,thanx a lot for clearing my doubts simran shakya
11 11 of : March 13, 014 at 5:5 am AWESOME.THANKX FOR CLEARING MY DOUBTS Anshul May 1, 014 at 9:35 am 1 class Assignment_Number_8 { 3 void polygon(int n, char ch) { 4 for (int r = 1; r <= n; r++) { 5 for (int c = 1; c <= n; c++) { 6 System.out.print(ch); 7 } 8 System.out.println(); 9 } 10 } 11 1 void polygon(int x, int y) { 13 for (int r = 1; r <= x; r++) { 14 for (int c = 1; c <= y; c++) { 15 System.out.print("@"); 16 } 17 System.out.println(); 18 } 19 } 0 1 void polygon() { for (int r = 1; r <= ; r++) { 3 for (int c = 1; c <= 3; c++) { 4 System.out.print("*"); 5 } 6 System.out.println(); 7 } 8 } 9 } when i run the void polygon(int n, int ch) method of the above code the output is incorrect for all values of ch. Please help ICSE Java Post author May 5, 014 at 11:5 am We will be able to help you if you tell us what is the pattern that you want to print.
12 1 of : Zoha Umar August 4, 014 at 1:08 pm Hey!My name is Zoha,I ll be giving the ICSE Examinations after this year,maybe 015.It was because of my parents wish that I was given Computers as an additional subject but from that day till now,i am unable to understand it,from basic programs to complicated functions,all have been out of my mind by now.i ve never been to a coaching institute for such purpose but now as I ve received much less grades,i m thinking to give a special attention to it.i am a bright student by Gods grace,but I know,computers will decrease my percentage.if any of you can help me with basic programming,i ll be extremely thankful to you people.the problem comes when when I read the question,suppose it is given to write a program to identify an armstrong number,i get the thing but don t know what to write to prove the number is so,the basic part.please ANYONE HELP ME.YOU WILL BE BLESSED BY GOD THROUGHOUT YOUR LIFE. ICSE Java Post author August 4, 014 at 4:8 pm If you have any specific doubts, you can ask them on our forum Jithin Jose February 17, 015 at 1:05 pm Hello,my name is jithin jose.i would like toask u a doubt.what is the may purpose of exception handling. With this can we solve all the erors comming in the program. (C) ICSE Java, All Rights Reserved
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 informationICSE Class 10 Computer Applications ( Java ) 2010 Solved Question...
1 of 12 05-11-2015 16:23 ICSE J Java for Class X Computer Applications ICSE Class 10 Computer Applications ( Java ) 2010 Solved Question Paper COMPUTER APPLICATIONS (Theory) Two Hours Answers to this Paper
More informationGood Earth School Naduveerapattu. Computer Applications Worksheet Class X
Good Earth School Naduveerapattu Computer Applications Worksheet Class X Chapter: 1 Concepts of Objects 1. What is inheritance and how is it useful in Java? 2. Differentiate between base and derived class.
More informationICSE Class 10 Computer Applications ( Java ) 2014 Solved Question Paper
1 of 10 05-11-015 16:1 ICSE J Java for Class X Computer Applications ICSE Class 10 Computer Applications ( Java ) 014 Solved Question Paper ICSE Question Paper 014 (Solved) Computer Applications Class
More informationCOMPUTER 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 informationICSE Solved Paper, 2018
ICSE Solved Paper, 2018 Class-X Computer Applications (Maximum Marks : 100) (Time allowed : Two Hours) Answers to this Paper must be written on the paper provided separately. You will not be allowed to
More informationICSE Class 10 Computer Applications ( Java ) 2013 Solved Question...
1 of 14 05-11-2015 16:22 ICSE J Java for Class X Computer Applications ICSE Class 10 Computer Applications ( Java ) 2013 Solved Question Paper If you have any doubts, ask them in the comments section at
More informationCOMPUTER 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 informationCOMPUTER 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 informationAP CS Unit 3: Control Structures Notes
AP CS Unit 3: Control Structures Notes The if and if-else Statements. These statements are called control statements because they control whether a particular block of code is executed or not. Some texts
More informationIntroduction to Computer Science Unit 2. Notes
Introduction to Computer Science Unit 2. Notes Name: Objectives: By the completion of this packet, students should be able to describe the difference between.java and.class files and the JVM. create and
More informationSequence 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 informationIntroduction to Computer Science Unit 2. Notes
Introduction to Computer Science Unit 2. Notes Name: Objectives: By the completion of this packet, students should be able to describe the difference between.java and.class files and the JVM. create and
More informationProgramming with Java
Programming with Java Data Types & Input Statement Lecture 04 First stage Software Engineering Dep. Saman M. Omer 2017-2018 Objectives q By the end of this lecture you should be able to : ü Know rules
More informationDM503 Programming B. Peter Schneider-Kamp.
DM503 Programming B Peter Schneider-Kamp petersk@imada.sdu.dk! http://imada.sdu.dk/~petersk/dm503/! VARIABLES, EXPRESSIONS & STATEMENTS 2 Values and Types Values = basic data objects 42 23.0 "Hello!" Types
More informationDate: Dr. Essam Halim
Assignment (1) Date: 11-2-2013 Dr. Essam Halim Part 1: Chapter 2 Elementary Programming 1 Suppose a Scanner object is created as follows: Scanner input = new Scanner(System.in); What method do you use
More informationSection 004 Spring CS 170 Exam 1. Name (print): Instructions:
CS 170 Exam 1 Section 004 Spring 2014 Name (print): Instructions: Keep your eyes on your own paper and do your best to prevent anyone else from seeing your work. Do NOT communicate with anyone other than
More informationCOMPUTER 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 informationif (x == 0); System.out.println( x=0 ); if (x = 0) System.out.println( x=0 );
Sample Final Exam 1. Evaluate each of the following expressions and show the result and data type of each: Expression Value Data Type 14 % 5 1 / 2 + 1 / 3 + 1 / 4 4.0 / 2.0 Math.pow(2.0, 3.0) (double)(2
More informationQuestion: Total Points: Score:
CS 170 Exam 1 Section 001 Fall 2014 Name (print): Instructions: Keep your eyes on your own paper and do your best to prevent anyone else from seeing your work. Do NOT communicate with anyone other than
More informationExam 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 informationCOMPUTER 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 informationJava Programming Language. 0 A history
Java Programming Language 0 A history How java works What you ll do in Java JVM API Java Features 0Platform Independence. 0Object Oriented. 0Compiler/Interpreter 0 Good Performance 0Robust. 0Security 0
More informationChapter 3. Selections
Chapter 3 Selections 1 Outline 1. Flow of Control 2. Conditional Statements 3. The if Statement 4. The if-else Statement 5. The Conditional operator 6. The Switch Statement 7. Useful Hints 2 1. Flow of
More informationCondensed Java. 12-Oct-15
Condensed Java 12-Oct-15 Python and Java Python and Java are both object-oriented languages Conceptually, the languages are very similar The syntax, however, is quite different, and Java syntax is much
More informationMotivating Examples (1.1) Selections. Motivating Examples (1.2) Learning Outcomes. EECS1022: Programming for Mobile Computing Winter 2018
Motivating Examples (1.1) Selections EECS1022: Programming for Mobile Computing Winter 2018 CHEN-WEI WANG 1 import java.util.scanner; 2 public class ComputeArea { 3 public static void main(string[] args)
More informationInterpreted vs Compiled. Java Compile. Classes, Objects, and Methods. Hello World 10/6/2016. Python Interpreted. Java Compiled
Interpreted vs Compiled Python 1 Java Interpreted Easy to run and test Quicker prototyping Program runs slower Compiled Execution time faster Virtual Machine compiled code portable Java Compile > javac
More informationI pledge by honor that I will not discuss this exam with anyone until my instructor reviews the exam in the class.
Name: Covers Chapters 1-3 50 mins CSCI 1301 Introduction to Programming Armstrong Atlantic State University Instructor: Dr. Y. Daniel Liang I pledge by honor that I will not discuss this exam with anyone
More informationMore Things We Can Do With It! Overview. Circle Calculations. πr 2. π = More operators and expression types More statements
More Things We Can Do With It! More operators and expression types More s 11 October 2007 Ariel Shamir 1 Overview Variables and declaration More operators and expressions String type and getting input
More information1. [3 pts] What is your section number, the period your discussion meets, and the name of your discussion leader?
CIS 3022 Prog for CIS Majors I February 10, 2009 Exam I Print Your Name Your Section # Total Score Your work is to be done individually. The exam is worth 105 points (five points of extra credit are available
More informationQuestion: Total Points: Score:
CS 170 Exam 1 Section 000 Fall 2014 Name (print): Instructions: Keep your eyes on your own paper and do your best to prevent anyone else from seeing your work. Do NOT communicate with anyone other than
More informationDM550 Introduction to Programming part 2. Jan Baumbach.
DM550 Introduction to Programming part 2 Jan Baumbach jan.baumbach@imada.sdu.dk http://www.baumbachlab.net VARIABLES, EXPRESSIONS & STATEMENTS 2 Values and Types Values = basic data objects 42 23.0 "Hello!"
More informationDM550 Introduction to Programming part 2. Jan Baumbach.
DM550 Introduction to Programming part 2 Jan Baumbach jan.baumbach@imada.sdu.dk http://www.baumbachlab.net COURSE ORGANIZATION 2 Course Elements Lectures: 10 lectures Find schedule and class rooms in online
More informationAssignment2013 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 informationOct Decision Structures cont d
Oct. 29 - Decision Structures cont d Programming Style and the if Statement Even though an if statement usually spans more than one line, it is really one statement. For instance, the following if statements
More informationCourse Outline. Introduction to java
Course Outline 1. Introduction to OO programming 2. Language Basics Syntax and Semantics 3. Algorithms, stepwise refinements. 4. Quiz/Assignment ( 5. Repetitions (for loops) 6. Writing simple classes 7.
More informationSample Paper of Computer for Class 10
General Instructions: Sample Paper of Computer for Class 10 1. Answers to this Paper must be written on the paper provided separately. 2. You will not be allowed to write during the first 15 minutes. 3.
More informationOutline. Parts 1 to 3 introduce and sketch out the ideas of OOP. Part 5 deals with these ideas in closer detail.
OOP in Java 1 Outline 1. Getting started, primitive data types and control structures 2. Classes and objects 3. Extending classes 4. Using some standard packages 5. OOP revisited Parts 1 to 3 introduce
More informationFull download all chapters instantly please go to Solutions Manual, Test Bank site: testbanklive.com
Introduction to Java Programming Comprehensive Version 10th Edition Liang Test Bank Full Download: http://testbanklive.com/download/introduction-to-java-programming-comprehensive-version-10th-edition-liang-tes
More informationZheng-Liang Lu Java Programming 45 / 79
1 class Lecture2 { 2 3 "Elementray Programming" 4 5 } 6 7 / References 8 [1] Ch. 2 in YDL 9 [2] Ch. 2 and 3 in Sharan 10 [3] Ch. 2 in HS 11 / Zheng-Liang Lu Java Programming 45 / 79 Example Given a radius
More informationPlace your name tag here
CS 170 Exam 1 Section 001 Spring 2015 Name: Place your name tag here Instructions: Keep your eyes on your own paper and do your best to prevent anyone else from seeing your work. Do NOT communicate with
More informationTutorial # 4. Q1. Evaluate the logical (Boolean) expression in the following exercise
Tutorial # 4 Q1. Evaluate the logical (Boolean) expression in the following exercise 1 int num1 = 3, num2 = 2; (num1 > num2) 2 double hours = 12.8; (hours > 40.2) 3 int funny = 7; (funny!= 1) 4 double
More informationJava Coding 3. Over & over again!
Java Coding 3 Over & over again! Repetition Java repetition statements while (condition) statement; do statement; while (condition); where for ( init; condition; update) statement; statement is any Java
More informationSTUDENT LESSON A12 Iterations
STUDENT LESSON A12 Iterations Java Curriculum for AP Computer Science, Student Lesson A12 1 STUDENT LESSON A12 Iterations INTRODUCTION: Solving problems on a computer very often requires a repetition of
More informationData Types and the while Statement
Session 2 Student Name Other Identification Data Types and the while Statement In this laboratory you will: 1. Learn about three of the primitive data types in Java, int, double, char. 2. Learn about the
More informationDM550 / DM857 Introduction to Programming. Peter Schneider-Kamp
DM550 / DM857 Introduction to Programming Peter Schneider-Kamp petersk@imada.sdu.dk http://imada.sdu.dk/~petersk/dm550/ http://imada.sdu.dk/~petersk/dm857/ OBJECT-ORIENTED PROGRAMMING IN JAVA 2 Programming
More informationJAVA OPERATORS GENERAL
JAVA OPERATORS GENERAL Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups: Arithmetic Operators Relational Operators Bitwise Operators
More informationSoftware Practice 1 - Basic Grammar Basic Syntax Data Type Loop Control Making Decision
Software Practice 1 - Basic Grammar Basic Syntax Data Type Loop Control Making Decision Prof. Hwansoo Han T.A. Minseop Jeong T.A. Wonseok Choi 1 Java Program //package details public class ClassName {
More informationChapter 3: Operators, Expressions and Type Conversion
101 Chapter 3 Operators, Expressions and Type Conversion Chapter 3: Operators, Expressions and Type Conversion Objectives To use basic arithmetic operators. To use increment and decrement operators. To
More informationPractice Midterm 1 Answer Key
CS 120 Software Design I Fall 2018 Practice Midterm 1 Answer Key University of Wisconsin - La Crosse Due Date: October 5 NAME: Do not turn the page until instructed to do so. This booklet contains 10 pages
More informationExam 1. Programming I (CPCS 202) Instructor: M. G. Abbas Malik. Total Marks: 45 Obtained Marks:
كلية الحاسبات وتقنية المعلوما Exam 1 Programming I (CPCS 202) Instructor: M. G. Abbas Malik Date: October 18, 2015 Student Name: Student ID: Total Marks: 45 Obtained Marks: Instructions: Do not open this
More informationCS 231 Data Structures and Algorithms, Fall 2016
CS 231 Data Structures and Algorithms, Fall 2016 Dr. Bruce A. Maxwell Department of Computer Science Colby College Course Description Focuses on the common structures used to store data and the standard
More informationExpressions and Data Types CSC 121 Spring 2015 Howard Rosenthal
Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal Lesson Goals Understand the basic constructs of a Java Program Understand how to use basic identifiers Understand simple Java data types
More informationData and Variables. Data Types Expressions. String Concatenation Variables Declaration Assignment Shorthand operators. Operators Precedence
Data and Variables Data Types Expressions Operators Precedence String Concatenation Variables Declaration Assignment Shorthand operators Review class All code in a java file is written in a class public
More informationComputational Expression
Computational Expression Variables, Primitive Data Types, Expressions Janyl Jumadinova 28-30 January, 2019 Janyl Jumadinova Computational Expression 28-30 January, 2019 1 / 17 Variables Variable is a name
More informationDM537 Object-Oriented Programming. Peter Schneider-Kamp.
DM537 Object-Oriented Programming Peter Schneider-Kamp petersk@imada.sdu.dk! http://imada.sdu.dk/~petersk/dm537/! VARIABLES, EXPRESSIONS & STATEMENTS 2 Values and Types Values = basic data objects 42 23.0
More informationCOMPUTER 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 informationCONTENTS: Compilation Data and Expressions COMP 202. More on Chapter 2
CONTENTS: Compilation Data and Expressions COMP 202 More on Chapter 2 Programming Language Levels There are many programming language levels: machine language assembly language high-level language Java,
More informationICSE 2015 COMPUTER APPLICATIONS. Md. Zeeshan Akhtar
ICSE 2015 COMPUTER APPLICATIONS Md. Zeeshan Akhtar COMPUTER APPLICATIONS Question 1 (a) (b) What are the default values of primitive data type int and float? Name any two OOP s principles. [2] [2] (c)
More informationITERATION WEEK 4: EXMAPLES IN CLASS
Monday Section 2 import java.util.scanner; public class W4MSection2 { ITERATION WEEK 4: EXMAPLES IN CLASS public static void main(string[] args) { Scanner input1 = new Scanner (System.in); int CircleCenterX
More informationProf. Navrati Saxena TA: Rochak Sachan
JAVA Prof. Navrati Saxena TA: Rochak Sachan Operators Operator Arithmetic Relational Logical Bitwise 1. Arithmetic Operators are used in mathematical expressions. S.N. 0 Operator Result 1. + Addition 6.
More informationJava Tutorial. Saarland University. Ashkan Taslimi. Tutorial 3 September 6, 2011
Java Tutorial Ashkan Taslimi Saarland University Tutorial 3 September 6, 2011 1 Outline Tutorial 2 Review Access Level Modifiers Methods Selection Statements 2 Review Programming Style and Documentation
More informationQuestion: Total Points: Score:
CS 170 Exam 1 Section 001 Spring 2014 Name (print): Instructions: Keep your eyes on your own paper and do your best to prevent anyone else from seeing your work. Do NOT communicate with anyone other than
More informationWelcome to the Primitives and Expressions Lab!
Welcome to the Primitives and Expressions Lab! Learning Outcomes By the end of this lab: 1. Be able to define chapter 2 terms. 2. Describe declarations, variables, literals and constants for primitive
More information( &% class MyClass { }
Recall! $! "" # ' ' )' %&! ( &% class MyClass { $ Individual things that differentiate one object from another Determine the appearance, state or qualities of objects Represents any variables needed for
More information1 Epic Test Review 2 Epic Test Review 3 Epic Test Review 4. Epic Test Review 5 Epic Test Review 6 Epic Test Review 7 Epic Test Review 8
Epic Test Review 1 Epic Test Review 2 Epic Test Review 3 Epic Test Review 4 Write a line of code that outputs the phase Hello World to the console without creating a new line character. System.out.print(
More informationSelections. EECS1021: Object Oriented Programming: from Sensors to Actuators Winter 2019 CHEN-WEI WANG
Selections EECS1021: Object Oriented Programming: from Sensors to Actuators Winter 2019 CHEN-WEI WANG Learning Outcomes The Boolean Data Type if Statement Compound vs. Primitive Statement Common Errors
More informationDecisions (If Statements) And Boolean Expressions
Decisions (If Statements) And Boolean Expressions CSE 1310 Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington Last updated: 2/15/16 1 Syntax if (boolean_expr)
More informationJava Foundations: Introduction to Program Design & Data Structures, 4e John Lewis, Peter DePasquale, Joseph Chase Test Bank: Chapter 2
Java Foundations Introduction to Program Design and Data Structures 4th Edition Lewis TEST BANK Full download at : https://testbankreal.com/download/java-foundations-introduction-toprogram-design-and-data-structures-4th-edition-lewis-test-bank/
More informationCOMP Primitive and Class Types. Yi Hong May 14, 2015
COMP 110-001 Primitive and Class Types Yi Hong May 14, 2015 Review What are the two major parts of an object? What is the relationship between class and object? Design a simple class for Student How to
More informationLoops. CSE 114, Computer Science 1 Stony Brook University
Loops CSE 114, Computer Science 1 Stony Brook University http://www.cs.stonybrook.edu/~cse114 1 Motivation Suppose that you need to print a string (e.g., "Welcome to Java!") a user-defined times N: N?
More informationJava Identifiers, Data Types & Variables
Java Identifiers, Data Types & Variables 1. Java Identifiers: Identifiers are name given to a class, variable or a method. public class TestingShastra { //TestingShastra is an identifier for class char
More informationQuestion: Total Points: Score:
CS 170 Exam 1 Section 003 Fall 2013 Name (print): Instructions: Keep your eyes on your own paper and do your best to prevent anyone else from seeing your work. Do NOT communicate with anyone other than
More informationPractice Midterm 1. Problem Points Score TOTAL 50
CS 120 Software Design I Spring 2019 Practice Midterm 1 University of Wisconsin - La Crosse February 25 NAME: Do not turn the page until instructed to do so. This booklet contains 10 pages including the
More informationUniversity of Palestine. Mid Exam Total Grade: 100
First Question No. of Branches (5) A) Choose the correct answer: 1. If we type: system.out.println( a ); in the main() method, what will be the result? int a=12; //in the global space... void f() { int
More informationDarrell Bethea May 25, 2011
Darrell Bethea May 25, 2011 Yesterdays slides updated Midterm on tomorrow in SN014 Closed books, no notes, no computer Program 3 due Tuesday 2 3 A whirlwind tour of almost everything we have covered so
More informationTools : The Java Compiler. The Java Interpreter. The Java Debugger
Tools : The Java Compiler javac [ options ] filename.java... -depend: Causes recompilation of class files on which the source files given as command line arguments recursively depend. -O: Optimizes code,
More informationIntroduction to Computer Science, Shimon Schocken, IDC Herzliya. Lectures Control Structures
Introduction to Computer Science, Shimon Schocken, IDC Herzliya Lectures 3.1 3.2 Control Structures Control Structures, Shimon Schocken IDC Herzliya, www.intro2cs.com slide 1 Control structures A program
More informationChapter 2: Basic Elements of Java
Chapter 2: Basic Elements of Java TRUE/FALSE 1. The pair of characters // is used for single line comments. ANS: T PTS: 1 REF: 29 2. The == characters are a special symbol in Java. ANS: T PTS: 1 REF: 30
More informationReview Chapters 1 to 4. Instructor: Scott Kristjanson CMPT 125/125 SFU Burnaby, Fall 2013
Review Chapters 1 to 4 Instructor: Scott Kristjanson CMPT 125/125 SFU Burnaby, Fall 2013 Introduction to Java Chapters 1 and 2 The Java Language Section 1.1 Data & Expressions Sections 2.1 2.5 Instructor:
More informationLesson 3: Accepting User Input and Using Different Methods for Output
Lesson 3: Accepting User Input and Using Different Methods for Output Introduction So far, you have had an overview of the basics in Java. This document will discuss how to put some power in your program
More informationIntroduction to Java Applications
2 Introduction to Java Applications OBJECTIVES In this chapter you will learn: To write simple Java applications. To use input and output statements. Java s primitive types. Basic memory concepts. To use
More informationCMPS 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 informationArithmetic and IO. 25 August 2017
Arithmetic and IO 25 August 2017 Submissions you can submit multiple times to the homework dropbox file name: uppercase first letter, Yourlastname0829.java the system will use the last submission before
More informationAYBUKE BUYUKCAYLI KORAY OZUYAR MUSTAFA SOYLU. Week 21/02/ /02/2007 Lecture Notes: ASCII
AYBUKE BUYUKCAYLI KORAY OZUYAR MUSTAFA SOYLU Week 21/02/2007-23/02/2007 Lecture Notes: ASCII 7 bits = 128 characters 8 bits = 256characters Unicode = 16 bits Char Boolean boolean frag; flag = true; flag
More informationCheck out how to use the random number generator (introduced in section 4.11 of the text) to get a number between 1 and 6 to create the simulation.
Chapter 4 Lab Loops and Files Lab Objectives Be able to convert an algorithm using control structures into Java Be able to write a while loop Be able to write an do-while loop Be able to write a for loop
More informationObject-Oriented Programming
Object-Oriented Programming Java Syntax Program Structure Variables and basic data types. Industry standard naming conventions. Java syntax and coding conventions If Then Else Case statements Looping (for,
More informationIntroduction to Java & Fundamental Data Types
Introduction to Java & Fundamental Data Types LECTURER: ATHENA TOUMBOURI How to Create a New Java Project in Eclipse Eclipse is one of the most popular development environments for Java, as it contains
More informationChapter 5 Methods. Modifier returnvaluetype methodname(list of parameters) { // method body; }
Chapter 5 Methods 5.1 Introduction A method is a collection of statements that are grouped together to perform an operation. You will learn how to: o create your own mthods with or without return values,
More informationCOSC 123 Computer Creativity. Java Decisions and Loops. Dr. Ramon Lawrence University of British Columbia Okanagan
COSC 123 Computer Creativity Java Decisions and Loops Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Key Points 1) A decision is made by evaluating a condition in an if/else
More informationChapter 3 Selections. Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved.
Chapter 3 Selections Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807 1 Motivations If you assigned a negative value for radius
More informationComputer Programming, I. Laboratory Manual. Experiment #3. Selections
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 #3
More informationCS111: PROGRAMMING LANGUAGE II
1 CS111: PROGRAMMING LANGUAGE II Computer Science Department Lecture 1: Introduction Lecture Contents 2 Course info Why programming?? Why Java?? Write once, run anywhere!! Java basics Input/output Variables
More informationImportant 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 informationboolean, char, class, const, double, else, final, float, for, if, import, int, long, new, public, return, static, throws, void, while
CSCI 150 Fall 2007 Java Syntax The following notes are meant to be a quick cheat sheet for Java. It is not meant to be a means on its own to learn Java or this course. For that you should look at your
More informationObject-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018
Object-oriented programming 1 and data-structures CS/ENGRD 2110 SUMMER 2018 Lecture 1: Types and Control Flow http://courses.cs.cornell.edu/cs2110/2018su Lecture 1 Outline 2 Languages Overview Imperative
More informationLecture 8 " INPUT " Instructor: Craig Duckett
Lecture 8 " INPUT " Instructor: Craig Duckett Assignments Assignment 2 Due TONIGHT Lecture 8 Assignment 1 Revision due Lecture 10 Assignment 2 Revision Due Lecture 12 We'll Have a closer look at Assignment
More informationUniversity of Cape Town ~ Department of Computer Science Computer Science 1015F ~ Test 2. Question Max Mark Internal External
Name: Please fill in your Student Number and Name. Student Number : Student Number: University of Cape Town ~ Department of Computer Science Computer Science 1015F ~ 2009 Test 2 Question Max Mark Internal
More informationChapter 1: Introduction to Computers, Programs, and Java
Chapter 1: Introduction to Computers, Programs, and Java 1. Q: When you compile your program, you receive an error as follows: 2. 3. %javac Welcome.java 4. javac not found 5. 6. What is wrong? 7. A: Two
More informationComputer Programming, I. Laboratory Manual. Experiment #2. Elementary Programming
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 #2
More information