Object Oriented Programming

Slides:



Advertisements
Similar presentations
Chapter 8: Arrays.
Advertisements

CS324e - Elements of Graphics and Visualization A Little Java A Little Python.
Chapter 6: Arrays Java Software Solutions for AP* Computer Science
Sets and Maps ITEC200 – Week Chapter Objectives To understand the Java Map and Set interfaces and how to use them To learn.
Arrays. A group of data with same type stored under one variable. It is assumed that elements in that group are ordered in series. In C# language arrays.
© The McGraw-Hill Companies, 2006 Chapter 5 Arrays.
1.7 Arrays academy.zariba.com 1. Lecture Content 1.Basic Operations with Arrays 2.Console Input & Output of Arrays 3.Iterating Over Arrays 4.List 5.Cloning.
LECTURE 37: ORDERED DICTIONARY CSC 212 – Data Structures.
Big Java Chapter 16.
Object Oriented Programming Lecture 5: Arrays and Strings Mustafa Emre İlal
CSS446 Spring 2014 Nan Wang.  Java Collection Framework ◦ Set ◦ Map 2.
Object Oriented Programming Ders 10: Data Structures Mustafa Emre İlal
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 6: Arrays Presentation slides for Java Software Solutions for AP* Computer Science 3rd Edition.
Characters. Character Data char data type – Represents one character – char literals indicated with ' '
Lecture 8 Using casts, Strings and WordUtil. Agenda Generating random numbers Casts – Casting a double into an int – Casting an int into a char – Casting.
Object Oriented Programming Lecture 4: Flow Control Mustafa Emre İlal
The character data type char. Character type char is used to represent alpha-numerical information (characters) inside the computer uses 2 bytes of memory.
int [] scores = new int [10];
CSC 1051 – Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
Declaring variables The type could be: int double char String name is anything you want like lowerCaseWord.
Introduction to Programming Python Lab 7: if Statement 19 February PythonLab7 lecture slides.ppt Ping Brennan
For Friday Read No quiz Program 6 due. Program 6 Any questions?
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
Chapter 8: Loops, Arrays, Strings Loop statements –do –while –for Arrays –declaration, allocation, initialization, access –multi-dimensional –heterogeneous.
Introduction to programming in java Lecture 22 Arrays – Part 2 and Assignment No. 3.
Introduction to programming in java Lecture 21 Arrays – Part 1.
COP 3275 – Finishing Loops and Beginning Arrays Instructor: Diego Rivera-Gutierrez.
Lecture 7: Arrays Michael Hsu CSULA 3 Opening Problem Read one hundred numbers, compute their average, and find out how many numbers are above the average.
Introduction to programming in java
Java for Beginners University Greenwich Computing At School DASCO
CS 106A, Lecture 27 Final Exam Review 1
Sets and Maps Chapter 9.
Chapter 9: Sorting and Searching Arrays
Lecture 5 array declaration and instantiation array reference
Data Structures and Algorithms for Information Processing
Jordi Cortadella Department of Computer Science
Java for Beginners University Greenwich Computing At School DASCO
CS1010 Discussion Group 11 Week 7 – Two dimensional arrays.
The University of Texas – Pan American
Arrays An Array is an ordered collection of variables
Chapter 7: Strings and Characters
TCSS 143, Autumn 2004 Lecture Notes
Java for Teachers Intermediate
Can store many of the same kind of data together
Introduction to Java Programming
Arrays We often want to organize objects or primitive data in a way that makes them easy to access and change. An array is simple but powerful way to.
int [] scores = new int [10];
ArrayLists.
Introduction To Programming Information Technology , 1’st Semester
CSC 216/001 Lecture 1.
Can store many of the same kind of data together
Arrays .
C-to-LC3 Compiler Over the course of the next two weeks, you will build a program that will compile C code to LC-3 assembly language Don't panic! You.
CS2011 Introduction to Programming I Arrays (I)
int [] scores = new int [10];
Arrays.
Can store many of the same kind of data together
Object Oriented Programming
Sets and Maps Chapter 9.
Java for Beginners University Greenwich Computing At School DASCO
EECE.2160 ECE Application Programming
Exercise 5 1. We learned bubble sort during class. This problem requires you to modify the code for bubble sorting method to implement the selection sorting.
Java: Variables, Input and Arrays
Chapter 2: Java Fundamentals cont’d
CSCI 3328 Object Oriented Programming in C# Chapter 8: LINQ and Generic Collections – Exercises UTPA – Fall 2012 This set of slides is revised from lecture.
AP Java Unit 3 Strings & Arrays.
Arrays.
CS Problem Solving and Object Oriented Programming Spring 2019
CSCI 3328 Object Oriented Programming in C# Chapter 7: Arrays – Exercises UTPA – Fall 2012 This set of slides is revised from lecture slides of Prof.
CMPT 225 Lecture 16 – Heap Sort.
Presentation transcript:

Object Oriented Programming Lecture 6: Review Mustafa Emre İlal emreilal@iyte.edu.tr

Recap Last week: Arrays + Strings Assignment 05

Today Assignment 05 - Solutions Review In-class coding exercises Thinking in Java – Chapter 6, 7

Assignment 06.1 Find the smallest distance between two neighboring numbers in an array: Write a Java application that creates an array of 500 random doubles between 1-100, and then prints out, the smallest difference between two neighboring numbers and where in the array it exists. e.g. In the sequence 4 8 6 1 2 9 4 the minimum difference is 1 (between 1 and 2). This exists between indexes 3 and 4. Hint: Use Math.abs() to calculate the difference between two numbers.

Assignment 06.2 Check for Anagrams An anagram is a word or a phrase that can be created by rearranging the letters of another given word or phrase. We ignore white spaces and letter case. e.g.: "Desperation" can be rearranged to the phrase "A Rope Ends It". Implement a Java application that looks for all anagrams of a given String in an array of Strings. The array is given below. Pick any to use as the String to search for. Hints: First prepare your Strings: Use .toLowerCase() method to convert all to lower case. Use .toCharArray() to convert the String into a char-array. Remember that char is a subset of int. char can be used in place of int. Try using it as index for an array holding counters for each letter of the alphabet.

Assignment 06.2 Check for Anagrams The words array to be used is: deductions discounted discounter introduces reductions harmonicas maraschino percussion supersonic

Assignment 06.3 Remove duplicate elements Write a Java Application that first creates an array of 20 random integers between 1-20. Prints out this array (on a single line) Then removes duplicate values The application should print out the final array along with its final size.

Next Week Interfaces Inner classes Preperation: Thinking in Java Chapter 8 + 9