Review for Final Exam. Scope 9 problems, 90 points. 1 Bonus problem (8 points) 120 minutes Java book – Main focus: Chapter 5, 8, 11, 13 (13.1 and 13.2).

Slides:



Advertisements
Similar presentations
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
Advertisements

What Data Do We Have? Sections 2.2, 2.5 August 29, 2008.
Arrays Chapter 6 Chapter 6.
Wednesday, 10/9/02, Slide #1 CS 106 Intro to CS 1 Wednesday, 10/9/02  QUESTIONS ??  Today:  Discuss HW #02  Discuss test question types  Review 
CS 117 Spring 2002 Review for Exam 2 March 6, 2002 open book, 1 page of notes.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
CS 101 Problem Solving and Structured Programming in C Sami Rollins Spring 2003.
School of Computing Science – CMT1000 Slide 1 Ed Currie Introduction to Programming CMT1000 Lecture 1A.
CS1101: Programming Methodology Aaron Tan.
GETTING INPUT Simple I/O. Simple Input Scanner scan = new Scanner(System.in); System.out.println("Enter your name"); String name = scan.nextLine(); System.out.println("Enter.
(c) University of Washington04-1 CSC 143 Java Inheritance Example (Review)
CPS 2231 Computer Organization and Programming Instructor: Tian (Tina) Tian.
Instructor: Alexander Stoytchev CprE 185: Intro to Problem Solving (using C)
CIS Computer Programming Logic
CSC Programming I Lecture 8 September 9, 2002.
Chapter 6: Iteration Part 1. To be able to program loops with the while, for, and do statements To avoid infinite loops and off-by-one errors To understand.
1 Structures. Structure (struct) Definition A Structure is a container, it can hold a bunch of things. –These things can be of any type. Structures are.
By the end of this session you should be able to...
BUILDING JAVA PROGRAMS CHAPTER 7 Arrays. Exam #2: Chapters 1-6 Thursday Dec. 4th.
1 Exam / Homework Exam 1 in Class 10 –Open book / open notes HW3 due next class HW4 will be on-line soon. Finishing Chapter 2 of K&R. We will go through.
Chapter 7 Selection Dept of Computer Engineering Khon Kaen University.
Lecture 101 CS110 Lecture 10 Thursday, February Announcements –hw4 due tonight –Exam next Tuesday (sample posted) Agenda –questions –what’s on.
CS161 Topic #16 1 Today in CS161 Lecture #16 Prepare for the Final Reviewing all Topics this term Variables If Statements Loops (do while, while, for)
CS Class 08 Today  Exercises  Nested loops  for statement  Built-in functions Announcements  Homework #3, group solution to in-class.
Review TEST 2 Chapters 4,5,7. QUESTION For which type of operands does the == operator always work correctly: (a) int, (b) double, or (c) String?
Access Modifiers Control which classes use a feature Only class-level variables may be controlled by access modifiers Modifiers 1. public 2. protected.
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Random Logic l Forum.NET l State Machine Mechanism Forum.NET 1 st Meeting ● December 27, 2005.
Instructor: Alexander Stoytchev CprE 185: Intro to Problem Solving (using C)
4 - Conditional Control Structures CHAPTER 4. Introduction A Program is usually not limited to a linear sequence of instructions. In real life, a programme.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
CSII Final Review. How many bits are in a byte? 8.
CS 1428 Final Exam Review. Exam Format 200 Total Points – 60 Points Writing Programs – 45 Points Tracing Algorithms and determining results – 20 Points.
COP 3275 – Finishing Loops and Beginning Arrays Instructor: Diego Rivera-Gutierrez.
Chapter 5 Arrays F Introducing Arrays F Declaring Array Variables, Creating Arrays, and Initializing Arrays F Passing Arrays to Methods F Copying Arrays.
Review for Test2. Scope 8 problems, 60 points. 1 Bonus problem (5 points) Coverage: – Test 1 coverage – Exception Handling, Switch Statement – Array of.
1 Binghamton University Exam 1 Review CS Binghamton University Birds eye view -- Topics Information Representation Bit-level manipulations Integer.
Chapter 8 Multidimensional Arrays
[ 4.00 ] [ Today’s Date ] [ Instructor Name ]
CS 1428 Exam I Review.
Introduction to the C Language
Final Review Dr. Xiaolin Hu.
Review for Test1.
Chapter 8 Multidimensional Arrays
Chapter 7 Multidimensional Arrays
Review for Final Exam.
Chapter 8 Multidimensional Arrays
Coding Concepts (Basics)
CS 1428 Final Exam Review.
Arrays, Part 1 of 2 Topics Definition of a Data Structure
Chapter 7 Part 2 Edited by JJ Shepherd
Multidimensional Arrays
Arrays, Part 1 of 2 Topics Definition of a Data Structure
Review for Test2.
Arrays.
CS 1428 Final Exam Review.
Final Review Fan Bai Csc 2310 Spring 2012.
Review for Final Exam.
Review for Test1.
Final Review Bina Ramamurthy 4/5/2019 BR.
Chapter 7 Multidimensional Arrays
Homework Finishing Chapter 2 of K&R. We will go through Chapter 3 very quickly. Not a lot is new. Questions?
Final Review Bina Ramamurthy 4/15/2019 BR.
CS150 Introduction to Computer Science 1
Introduction to Object-Oriented Concepts in Java
Final Review Dr. Xiaolin Hu.
Arrays, Part 1 of 2 Topics Definition of a Data Structure
Lecture 18 Compilers and Language Translation (S&G, ch. 9)
CS 1428 Exam I Review.
Lec 21 More Fun with Arrays: For Loops
Presentation transcript:

Review for Final Exam

Scope 9 problems, 90 points. 1 Bonus problem (8 points) 120 minutes Java book – Main focus: Chapter 5, 8, 11, 13 (13.1 and 13.2). – However, it covers basic java programming concepts from other chapters (e.g., chapters before chapter 5) of the Java book. The Invitation to CS book – Chapter 6

Java programming Chapter 5 – Array declaration, element assignment, and accessing array elements – for loop and while loop – Array of objects Chapter 8 – Exception handling – Switch statement – Continue and break – Nested Loop Chapter 11 – Define a subclass – Super statement – Override method – Polymorphism Chapter 13 – Multidimensional array – Vector

Assembly Language Chapter 6 – Understand the assembly language instructions (no need to memorize them) – Read an assembly language program and understand what it does – Write code for simple problems – Symbol Table for an assembly language program – Translating an assembly language program into machine language instructions (see, e.g., figure 6.13 on page 302 of the textbook).

Problem Type Short answers (about 25%) Problem solving (about 25%) Practical coding writing (about 50%)

Grade Calculation Test 1 – 16% Test 2 – 20% Final exam – 24% HW Assignments – 40% (the lowest assignment grade fromHW1 to HW7 will not be counted). – 7 HW assignments (each one is 6 points), 1 Bonus HW assignment (also 6 points) – Since the lowest grades will not be counted, the base grade for HW is 36 (6 HW assignments)

Grade Calculation (cont.) Example: assume a student has the following grades: – Test1: 45 (out of 60); – test2: 50 (out of 60); – final exam: 74 (out of 90); – Homework assignments: HW1: 4; HW2: 6; HW3: 5; HW4: 6; HW5: 6; HW6: 1; HW7: 5; Bonus HW: 5 For the homework grades, the student gets (bonus)=37 (out of 36, which is the base grade for HW). The student’s total grade is: 45/60 * /60 * /90 * /36*40 = = 89.5.

Exercise Problem 1 Consider the following assembly language program:.BEGIN Loop:INX INY LOADX COMPAREY JUMPGTDONE OUTX JUMPLOOP DONE:OUTY HALT X:.DATA0 Y:.DATA0.END Q1: What is the function of this program? It reads input x and y. If y >x, output y and the programs finishes; otherwise, output x and reads another set of x and y… Q2: What value is entered in the symbol table for the symbols LOOP, DONE, X, and Y? See Figure 6.10 on page 298 of the textbook. Q3: What is the machine language representation of this program (Assume the op code field is 4bits wide, the address filed is 12bits wide)? See Figure 6.13 on page 302 of the textbook.

Exercise Problem 2 Assuming Account is an existing class defined below. public class Account{ private double balance; public Account(double initialBalance){ balance = initialBalance; } public boolean deposit(double amount){ balance+=amount; return true; } public double getBalance(){ return balance; }

Exercise Problem 2 (cont.) Q1: Suppose accountArray is a variable of type Account[ ] to store an array of Account objects. Declare the accountArray variable to store 15 Account objects. Create 15 Accounts objects with random initial balance between 0 and 100 and store the objects in the accountArray array. Account[] accountArray = new Account[15]; for( int i= 0;i<15; i++){ Account acct = new Account(100*Math.random()); accountArray[i] = acct; } Q2: Write a code segment to find the account with the largest balance in the accountArray, and print out the balance for that account. double maxB = accountArray[0].getBalance(); int maxIndex = 0; for( int i= 1;i<15; i++){ double tempB = accountArray[i].getBalance(); if (temp > maxB){ maxB = tempB; maxIndex = i; } } System.out.println(accountArray[maxIndex ].getBalance());

Exercise Problem 2 (cont.) Q3: Suppose we want to use a Vector (named as accountVector) to store Account objects. Implement the same function as described in Q1: Vector accountVector = new Vector(); for( int i= 0;i<15; i++){ Account acct = new Account(100*Math.random()); accountVector.addElement(acct); } Q4: Write a code segment to find the account with the largest balance in the accountVector, and print out the balance for that account. Account acct = (Account) accountVector.elementAt(0); double maxB = acct.getBalance(); int maxIndex = 0; for( int i= 1;i<15; i++){ Account tempAcct = (Account) accountVector.elementAt(i); double tempB = tempAcct.getBalance(); if (temp > maxB){ maxB = tempB; maxIndex = i; } } System.out.println((Account) accountVector.elementAt(maxIndex).getBalance());

Exercise Problem 3 All problems in test1 and test2.

Java programming Demo based on my research projects