
Object Oriented Programming Lesson 1
Presentation
•
Computers
•
University
•
Practice Problem
•
Medium
Jerry Jackson Bent
Used 2+ times
FREE Resource
24 Slides • 9 Questions
1
Object Oriented Programming
Lecture 1: Introduction to OOP
[Holborn – Group 1]
2
Lesson outcomes
Workshop learning objectives to be discussed today are:
•What is programming? Flowcharts and pseudo-code
•IDE, installation and use.
•Recap of Java programming (ITP).
•Introduction to OOP
•UML (Class and sequence diagrams)
3
Icebreaker
Introduction and assignment
4
Multiple Choice
OOP is a programming model based on the concept of what?
Hardware
Objects
Compiler
Laptops
5
Multiple Choice
Java is owned by what company?
Oracle
Microsoft
Apple
6
Multiple Choice
Java is open source and free to use
True
False
7
Multiple Choice
Everything in Java programming begins what?
Class name
Attribute
Method
8
Open Ended
Every Java program has a class name which must match the ________ and that every program must contain a _______ method.
(Type 2 answers separating them with a space or comma)
9
Multiple Select
What are the two main data types in Java programming?
Primitive
Loops
Automated
Non-Primitive
10
Multiple Choice
Primitive data types include the following except...
Short
Boolean
Strings
Integer
11
Multiple Choice
What will be the output of the following code:
int x = 52;
int y = 43;
if (x > y) {
System.out.println ("X-men"); }
else {
System.out.println ("Avengers"); }
X-men
Avengers
52
43
12
Multiple Choice
int time = 1300;
if (time > 1100) { System.out.println("Good afternoon."); }
else { System.out.println("Good morning."); }
1100
1300
Good morning
Good afternoon
13
Java program design
Topic 1
14
Activity
15
Practice problem 1
Draw the flowchart and write the pseudo-code for the problem given below.
1.A logistics company charges £2 for a parcel weighing 2Kg or less. If the weight of the parcel is more than 2Kg, each kg of the excess weight is charged at £3.
You can use Smartdraw.com, Lucid.app or microsoft visio to complete this task
Time for activity 15 minutes
16
Tea and
Coffee Break
10 minutes
17
Java programming recap
Topic 2
18
Activity
19
Practice problem(s) 2
1. Write the syntax of prefix and postfix increment operator and write the difference between them.
2. Determine the value of each of the following logical expressions if a = 5, b = 10 and c = – 6
a) a>b && a<c
b) a <b && a>c
c) a==c|| b>a
d) b>15 && c<0 || a>0
Time for activity 15 minutes
20
Tea and
Coffee Break
10 minutes
21
Arrays and Strings
Topic 3
22
Activity
23
Practice problem(s), Task 1
A palindrome is a word or phrase that reads the same forward or backwards. Write a recursive method that returns a boolean value indicating if its only String argument is a palindrome or not. The method must be recursive and have the following signature: public static boolean isPalindrome( String arg ) In testing for palindrome you should ignore upper/lower case as well as whitespace.
Time for activity 20 minutes
24
Practice problem(s) 3 cont.,
That is, the following phrases should be legal palindromes.
No Sir prefer prison
Racecar
Straw Warts
never odd or even
Oozy rat in a sanitary zoo
Place the isPalindrome method in a class named Palindrome. Write a main method in
Palindrome which prompts for a string from the keyboard, test if it is a palindrome, and print out
the result. Below is a sample output. The string: ’No Sir prefer prison’ is a palindrome The string:
’Try this’ is NOT a palindrome
25
Practice problem(s) 3 Task 2
2.a. Declare on one line a two-dimensional array of int values called intArr. On the second line, allocate memory for 5 rows. On subsequent lines, allocate memory for each row to have 8 columns.
b. Fill in each cell of the intArr array from the previous question with the result of multiplying that cell's column index by its row index. Do not hardcode the length of the array in any way.
c. Print each row of the intArr array from the previous question in order on separate lines.
Entries should be separated by a single space. The last entry in each row should be followed by a colon (:) and then the sum of the entries in that row. Do not hardcode the length of the array in any way.
26
Practice problem(s) 3, Task 3
3. Write a method that takes an array of numbers and a number and returns
true if the array contains the number, false otherwise. You will need a loop, and
your loop must not execute more iterations than necessary, and you cannot use
break or continue.
27
Tea and
Coffee
Break
10 minutes
28
Introduction to UML
Topic 4
29
Activity
30
Practice problem(s) 4
1. Draw a Class diagram for a library system.
2. Draw a sequence diagram for the registration of a new library member.
Time for activity 10 minutes
31
Workshop Summary
• Introduction to programming
• Java programming basics
• Arrays and Strings
• UML
32
Student support
• Note taking
• Presentation
• Paraphrasing
• Referencing
33
[Jerry Bent]
Object Oriented Programming
Lecture 1: Introduction to OOP
[Holborn – Group 1]
Show answer
Auto Play
Slide 1 / 33
SLIDE
Similar Resources on Wayground
27 questions
M2U2 - Using Apps (SY25-26/C103-101i)
Presentation
•
University
24 questions
Photosynthesis
Presentation
•
University
25 questions
1. Pengantar Infrastruktur TI
Presentation
•
University
26 questions
BAHASA PEMROGRAMAN PASCAL
Presentation
•
University
26 questions
Introducción a la Ciencia de Datos
Presentation
•
University
26 questions
IIS Topic 6
Presentation
•
University
28 questions
IT1 Topic 2 Hardware and Software (Computer Basics) Lesson
Presentation
•
University
25 questions
Electron Configuration, Orbital Notation, & Dot diagrams
Presentation
•
9th - 12th Grade
Popular Resources on Wayground
20 questions
STAAR Review Quiz #3
Quiz
•
8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
6 questions
Marshmallow Farm Quiz
Quiz
•
2nd - 5th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
12 questions
What makes Nebraska's government unique?
Quiz
•
4th - 5th Grade