Department of Networks College of Bardarash Technical Institute DUHOK Polytechnic University Subject: Programming Fundamental by JAVA Course Book

Similar documents
.Net Technologies. Components of.net Framework

Introduction to Programming Using Java (98-388)

Discover how to get up and running with the Java Development Environment and with the Eclipse IDE to create Java programs.

3D Graphics Programming Mira Costa High School - Class Syllabus,

Duhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain

CO Java SE 8: Fundamentals

B. Subject-specific skills B1. Problem solving skills: Supply the student with the ability to solve different problems related to the topics

C# - Reflection. It allows examining various types in an assembly and instantiate these types.

Duhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain

Course materials Reges, Stuart, and Stepp, Martin. Building Java Programs: A Back to Basics Approach. 2d ed. (Boston: Addison-Wesley, 2011).

Week. Lecture Topic day (including assignment/test) 1 st 1 st Introduction to Module 1 st. Practical

Subclass Gist Example: Chess Super Keyword Shadowing Overriding Why? L10 - Polymorphism and Abstract Classes The Four Principles of Object Oriented

1. Which of the following is the correct expression of character 4? a. 4 b. "4" c. '\0004' d. '4'

This tutorial has been prepared for the beginners to help them understand basics of c# Programming.

204111: Computer and Programming

CS 113 MIDTERM EXAM 2 SPRING 2013

Mathematics/Science Department Kirkwood Community College. Course Syllabus. Computer Science CSC142 1/10

CH. 2 OBJECT-ORIENTED PROGRAMMING

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++

Java Object Oriented Design. CSC207 Fall 2014

Classes and Objects 3/28/2017. How can multiple methods within a Java class read and write the same variable?

Chapter 2: Java OOP I

This page intentionally left blank

IST311. Advanced Issues in OOP: Inheritance and Polymorphism

Lecture 14 CSE11 Fall 2013 For loops, Do While, Break, Continue

Ministry of Higher Education and Scientific research

Informatik II (D-ITET) Tutorial 6

Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach.

2. [20] Suppose we start declaring a Rectangle class as follows:

Getter and Setter Methods

Islamic University of Gaza Faculty of Engineering Computer Engineering Department

Software and Programming 1

This exam is open book. Each question is worth 3 points.

Computer Science II (20082) Week 1: Review and Inheritance

About this exam review

MyProgram m i ng Lab. get with the programming. Through the power of practice and immediate personalized

Comp Assignment 2: Object-Oriented Scanning for Numbers, Words, and Quoted Strings

CS111: PROGRAMMING LANGUAGE II

AP Computer Science A Mira Costa High School - Class Syllabus,

Create a Java project named week10

Curriculum Map Grade(s): Subject: AP Computer Science

College Board. AP CS A Labs Magpie, Elevens, and Picture Lab. New York: College Entrance Examination Board, 2013.

Introduction to Computer Science with Python Course Syllabus

Lecture 36: Cloning. Last time: Today: 1. Object 2. Polymorphism and abstract methods 3. Upcasting / downcasting

Exam Duration: 2hrs and 30min Software Design

Object Oriented Programming. Week 1 Part 1 An introduction to Java, Objects and JUnit

CSE 131 Introduction to Computer Science Fall Exam II

JAVA PROGRAMMING LAB. ABSTRACT In this Lab you will learn how to describe objects and classes and how to define classes and create objects

CS 302 Week 9. Jim Williams

Informatik II. Tutorial 6. Mihai Bâce Mihai Bâce. April 5,

CS 1063 Introduction to Computer Programming Midterm Exam 2 Section 1 Sample Exam

Week 5-1: ADT Design

IMACS: AP Computer Science A

Ministry of Higher Education and Scientific research

DHANALAKSHMI SRINIVASAN COLLEGE OF ENGINEERING AND TECHNOLOGY ACADEMIC YEAR (ODD SEM)

Questions Answer Key Questions Answer Key Questions Answer Key

EXAMINATION FOR THE BSC (HONS) INFORMATION TECHNOLOGY; BSC (HONS) INFORMATION SYSTEMS & BSC (HONS) COMPUTER SCIENCE; YEAR 1

Java Assignment 3: Loop Practice Ver 3.0 Last Updated: 12/1/2015 8:57 AM

Building non-windows applications (programs that only output to the command line and contain no GUI components).

University of Cape Town ~ Department of Computer Science. Computer Science 1015F ~ 2007

FUNDAMENTALS OF MICROPROCESSOR AND MICROCONTROLLER (FMM) SHREE RAMCHANDRA EDUCATION SOCIETY S DEPARTMENY OF ELECTRICAL ENGINEERING LAB MANUAL

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours

Software and Programming 1

Course Hours

You must pass the final exam to pass the course.

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University

Chapter 4 Defining Classes I

CS 201, Fall 2016 Sep 28th Exam 1

VALLIAMMAI ENGINEERING COLLEGE

CSCI 102L - Data Structures Midterm Exam #1 Fall 2011

Informatik II Tutorial 6. Subho Shankar Basu

CS-202 Introduction to Object Oriented Programming

Check 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.

Govt. of Karnataka, Department of Technical Education Diploma in Information Science & Engineering. Fifth Semester

DC69 C# &.NET DEC 2015

Notes on Chapter Three

Object-oriented Programming and Software Engineering CITS1001. Multiple-choice Mid-semester Test

5/23/2015. Core Java Syllabus. VikRam ShaRma

Example: Fibonacci Numbers

Object Oriented Concepts and Programming (CSC244) By Dr. Tabbasum Naz

Language Features. 1. The primitive types int, double, and boolean are part of the AP

Software and Programming 1

Lab 9: Creating a Reusable Class

COMP-202: Foundations of Programming. Lecture 26: Review; Wrap-Up Jackie Cheung, Winter 2016

Prelim One Solution. CS211 Fall Name. NetID

COMP 250 Winter 2011 Reading: Java background January 5, 2011

Model 4.2 Faculty member + student Course syllabus for Advanced programming language - CS313D

Classes. Classes as Code Libraries. Classes as Data Structures

AP Computer Science in Java Course Syllabus

Ministry of Higher Education and Scientific Research

Course Supervisor: Dr. Humera Tariq Hands on Lab Sessions: Ms. Sanya Yousuf

Lesson11-Inheritance-Abstract-Classes. The GeometricObject case

Lecture 5: Methods CS2301

COMP-202. Recursion. COMP Recursion, 2011 Jörg Kienzle and others

B.C.A 2017 OBJECT ORIENTED PROGRAMMING USING C++ BCA303T MODULE SPECIFICATION SHEET

CSC207H: Software Design. Java + OOP. CSC207 Winter 2018

Al al-bayt University Prince Hussein Bin Abdullah College for Information Technology Computer Science Department

Beginning Programming (Two Semesters) Semester One. Module One: Intro to Beginning Programming. Module Two: Computer Careers

Loops! Loops! Loops! Lecture 5 COP 3014 Fall September 25, 2017

Course Outline. Introduction to java

Transcription:

1 Department of Networks College of Bardarash Technical Institute DUHOK Polytechnic University Subject: Programming Fundamental by JAVA Course Book Year 1 Lecturer's name: MSc. Sami Hussein Ismael Academic Year: 2017/2018

2 Course Book Course title Programming Fundamental by JAVA lecturer in charge Mr. Sami Hussein Ismael Dept/ College Networks Bardarash Technical Institute Contact details Tel: 750 424 81 88 Email:sami_alsalhi@yahoo.com Course link in the University 5. Time (in hours) per week Theory: 2 Practical: 3 Contact details Tel: Email: Course overview: Introducing the students to the concepts and terms of the JAVA programming and also introducing them to the special commands and instructions to solve and write programs using this language, and understanding the use of different data types to create files and write drawing programs. Course Objectives: Provide students with the skills to formulate an engineering problem and to develop a logical and efficient algorithm for solving the problem. Provide students with a basic understanding of variables, operators, control flow, functions, program structure, and arrays. Provide the skills necessary to structure, implement, and debug computer programs that are easily maintained. Teach programming skills using the Java language. Assessment scheme Semester evaluation Final evaluation Semester evaluation Marks evaluation Marks First Semester Activity 5 % Final Practical Midyear Theory Exam 15 % Exam 30% Midyear Practical Exam 15 % Final Theory Second Semester Activity 5 % Exam 30% Total 40 % Total 60 % Total 100 %

3 Syllabus Theoretical Week Detail What is a computer Programming? Introduction to Java Programming Language 1 What Java Is and How It Works How to Get the Most Out of This Course Write your first program (A Hello World Program) Write a simple program 2 Using Variables (Data Types) Constants (final) 3,4,5 6,7,8 Reading numbers from keyboard Reading numbers from console Formatting Console Output Operations Increment and Decrement Operators Strings: Working With Text Conditions Relational Expressions & Logical Expressions If and Else statements Nested if and else statements 9,10,11, 12 While Loops For Loops Do...While Break and Continue Nested Loop Switch Statements

4 Arrays 13,14,15 Copying Arrays Sorting Arrays Multi-Dimensional Arrays 16,17,18,19,20 21,22 23,24 25 26 Classes and Objects Methods Defining a Method Calling a Method Getters and Return Values Method Parameters Void method Setters and "this" Constructors Static (and Final) String Builder and String Formatting The tostring Method Casting Numerical Values Upcasting and Downcasting Reading Files Using Scanner Handling Exceptions 27,28 Multiple Exceptions Runtime vs. Checked Exceptions Reading Files With File Reader 29,30 Try-With-Resources Creating and Writing Text Files

5 Syllabus of Practical Part Weeks 1 2 Subjects Introduction to Java Programming Language Installing Eclipse and JDK Write your first program (A Hello World Program) Write a simple program Using Variables (Data Types) Constants (final) Reading numbers from keyboard Reading numbers from console 3,4,5 Formatting Console Output Operations Increment and Decrement Operators Strings: Working With Text 6,7,8 Conditions Relational Expressions & Logical Expressions If and Else statements Nested if and else statements 9,10,11, While Loops For Loops Do...While Break and Continue Nested Loop 12 Switch Statements 13,14,15 Arrays Copying Arrays

6 Sorting Arrays Multi-Dimensional Arrays Classes and Objects Methods Defining a Method 16,17,18,19,20 Calling a Method Getters and Return Values Method Parameters Void method Setters and "this" 21,22 23,24 25 Constructors Static (and Final) String Builder and String Formatting The tostring Method Casting Numerical Values Upcasting and Downcasting 26 Reading Files Using Scanner Handling Exceptions 27,28 Multiple Exceptions Runtime vs. Checked Exceptions Reading Files With File Reader 29,30 Try-With-Resources Creating and Writing Text Files

7 Sample Questions: Q1) Answer of the following: 1- What are different between Public and private of access Specifiers in JAVA? 2- What is method overloading? Q1) Answer: 1-1)Public can be accessed by other class member that is initialized outside the class. A public member can be accessed from anywhere even outside the namespace. 2) Private: can be accessed only inside the classes. The private members cannot be accessed outside the class 2-Method overloading: is the same method name with different type of parameters or different set of parameters is known as Method Overloading.. Q2) Select the correct answer from the following: 1- Which of the following will be the correct output for the JAVA program? namespace ConsoleApplication class Sample int i; Single j; public void SetData(int i, Single j) this.i = i; this.j = j; public void Display() Console.WriteLine(i + " " + j); class MyProgram

8 static void Main(string[ ] args) Sample s1 = new Sample(); s1.setdata(36, 5.4f); s1.display(); A. 0 0.0 B. 36 5.4 C. 36 5.400000 D. 36 5 2Which of the following statements is correct about the JAVA code?. class Student s1, s2; s1 = new Student(); s2 = new Student(); A. Contents of s1 and s2 will be exactly same. B. The two objects will get created on the stack. C. Contents of the two objects created will be exactly same. D. The two objects will always be created in adjacent memory locations. Q2)1- Answer: B 2- Answer: c Q3) Write complate a program to Create a class Rectangle has attributes such as length and width. Depending upon the design, it may need ways for accepting the values of these attributes, calculating the area, and displaying details. Q3) Answer

9 using System ; namespace RectangleApplication class Rectangle double length; double width; public void Acceptdetails() length = 4.5; width = 3.5; public double GetArea() return length * width; public void Display() Console.WriteLine("Length: 0", length); Console.WriteLine("Width: 0", width); Console.WriteLine("Area: 0", GetArea()); class ExecuteRectangle static void Main(string[] args) Rectangle r = new Rectangle(); r.acceptdetails(); r.display(); Console.ReadLine(); Q4) Complete the following blanks with suitable word 1- ----------------- variable directly contains data in the memory. 2- ----------------- are sequences of characters 3- Class definition consists of: 4-1-------------------2------------------3--------------4----------------- Q4) Answer

10 1- Value Type 2- Strings 3-1- Class declaration. 2- Inherited class. 3 Fields.4- Constructors Q5) Write method to calculate the sum of the elements in an array. "Main" should be like this: public static void Main() int[] example = 20, 10, 5, 2 ; Console.WriteLine( "The sum of the example array is 0", Sum(example)); Q5)Answer: using System; public class SumArray public static int Sum(int[] example) int total=0; for (int i = 0;i < example.length; i++) total += example[i]; return total; public static void Main() int[] example = 20, 10, 5, 2 ; Console.WriteLine("The sum of the example array is 0", Sum(example));