AP Computer Science Homework Set 3 Class Methods

Size: px
Start display at page:

Download "AP Computer Science Homework Set 3 Class Methods"

Transcription

1 AP Computer Science Homework Set 3 Class Methods P3A. Let s upgrade the Song class. Let s make the following upgrades: a. Add a private instance variable yearreleased that stores the year the Song was released. b. Upgrade the Song s constructors to properly initialize the new instance variable yearreleased. c. Add getter and setter methods for the private instance variable yearreleased. These methods will be called getyearreleased() and setyearreleased(). d. Write a method getsonglength() that converts the length of the song in seconds to minutes and second(s). The output of the method should be a String. If the length of the song in seconds is 343, then the method should return the following String: The length of the song is: 5 minutes and 43 seconds. e. Write a new SongDriver class to test the Song s new constructors and setyearreleased() and getyearreleased() and methods. f. Integrate your password program into the setyearrelased() method so that that yearreleased instance variable can only be set if the correct username and password are input. Page 1

2 P3B. Time to upgrade the Clock class. The Clock class should include the following upgrades: a. a public setter method called settime() should be written that takes three integer parameters to set the Clock s hours, minutes, and seconds, respectively, b. a public method setdaylightsaving( int hours ) that increments or decrements the hours of the Clock by the number specified by the parameter hours. The parameter hours will essentially be 1 or -1 depending on whether we are Springing forward or Falling back. Don t worry about noon and midnight conditions; this will be in a future upgrade. c. a public method totalseconds() that returns the total number of integer seconds represented the numbers of hours, minutes and seconds on the Clock (for a future Stopwatch upgrade.) For example, the method should return 3661 if the Clocks reads 1 hour, 1 minute, and 1 second. Note that no separate totalseconds private instance variable should be included in this class. The method totalseconds() can return a value that can be calculated at any time from the existing hours, minutes, and seconds private instance variables. d. upgrade the tostring() method so that it also returns the total seconds in a user-friendly format. Write a driver class to test the settime(), setdaylightsavings( int hours), and totalseconds() methods. The driver should perform the following actions: a. Create an instance of a Clock object, b. Print the Clock using its tostring() method, c. Use the settime() method to set the Clock s time to a non-zero time d. Print the Clock again using its tostring() method, e. Use the setdaylightsaving( int hours ) method to adjust the time of the Clock by the hours parameter, f. Print the Clock again using its tostring() method. Page 2

3 P3C. Let s upgrade the Student class from HW 2 to add the capability to store and process grades. Below are the following specifications: a. Add an instance variable of type array called grades that can hold five double variables for the student s grade point averages for each of his/her five classes (English, Math, Science, Fine Arts, Social Sciences). The following scale will be used: A = 4.00 A- = 3.70 B+ = 3.30 B = 3.00 B- = 2.70, etc. b. Upgrade the zero-argument constructor to initialize all elements of the grades array to 0.0. c. Upgrade the multi-argument constructor so that it also initializes the array of grades with 5 double values in the following order: English Math Science Fine Arts Social Science d. Add a public method setgpa()that will take 5 double parameters to set the GPAs for each of the courses stated above in the order stated above. e. add a public method, calcgpa(), that will calculate and return the average GPA for the student as a double value. f. Upgrade the tostring() method that will return a String that includes the student s name and average GPA. Page 3

4 Write a driver class to: a. Create a Student senior using the multi-argument constructor with following information: First Name = Joe Last Name = Senior English = 4.0 Math = 4.0 Science = 3.5 Fine Arts = 4.0 Social Science = 4.0 b. printout the student s name and average GPA using the tostring() method, c. set the five GPA s using the setgpa() method to all 4.0, and d. printout the student s name and average GPA using the tostring() method a second time after the grade change. Page 4

5 P3D. More upgrades to the Student class! Add method getgrade() to the Student class that will return a String letter grade based on the student s GPA. The method should return (not print) A if the GPA is greater than 4.00, B if the GPA is greater than 3.00, C if the GPA is greater than 2.00, D if the GPA is greater than 1.00, and F otherwise. Write a driver class to create two student objects, sets the GPA of the students using the setgpa() method and prints the letter grade of each student. Sample output is shown below: Page 5

6 P3E. Write a program that creates three String objects. Each String should be the name of a university to which you are applying. Now we are going to compare the universities with the String method compareto(). Print out the result of comparing each school to another. For example, if s1 and s2 are defined as follows: String school1 = new String ( Stanford ); String school2 = new String ( Oregon ); String school3 = new String ( UCLA ); We can compare the schools as follows: System.out.println( school1.compareto( school2 ); Answer the questions below in a comment after all of your source code: a. What is the output of the compareto() method telling us? b. Compare to schools that have the same first letter and a different second letter. What does compareto() do in this case? P3F. AP Packet 2010 #2 APLine (Class Design). Mr. Lew will brief you on this question. P3G. Write a program that searches for a given integer in an array of integers. Specifically, write a program that performs the following tasks: a. create an array of 10 integers in ascending, non-sequential order. And fill the array with the following numbers: b. use a for loop to traverse the array and return the index number of the location of the integer you wish to find. For example, in the array above, if the number to find is 9, the program should return the index number 5 in a userfriendly phrase. c. If the number is NOT found in the array, return -1. Page 6

7 P3H. Write a program that creates an array that can hold 5 String objects. Populate the array with the names of your current teachers. Use a for-each loop to traverse the array and print the names of each of your teachers. P3I. Write a Create new password program that requires passwords to have a length of at least 6 characters and at least one non-alphanumeric character (+, -, *, / Passwords that do not meet these requirements should be rejected. Use the String method substring() which returns String that is part of or substring of a given String. Consider the following example: String password = new String( "abc*d_" ); System.out.println( password.substring( 3,4 ) ); // prints * Since the substring method returns a String, you can compare it to another String using.equals(). Below, we extract one letter from the password and determine if it is equal to *. String oneletter = new String( password.substring( 3,4 ) ); oneletter.equals( * ); // result is true By the end of the lesson students should be able to: a. Write the Java code to correctly initialize each primitive type with appropriate data values. b. Write the Java code that uses the new operator to instantiate objects. c. Write the Java code that uses the dot operator to change the value of an object s data values. d. Write the Java code to create an array of primitive types or objects and assign primitive data values to elements of the array. Page 7

AP Computer Science Homework Set 3 Class Methods

AP Computer Science Homework Set 3 Class Methods AP Computer Science Homework Set 3 Class Methods P3A. (BlueJ) Let s upgrade your Song class from P2A. You can make a copy of project P2AProject and rename it P3AProject in your Chapter 3 folder for this

More information

AP Computer Science Homework Set 2 Class Design

AP Computer Science Homework Set 2 Class Design AP Computer Science Homework Set 2 Class Design P2A. Write a class Song that stores information about a song. Class Song should include: a) At least three instance variables that represent characteristics

More information

AP Computer Science Homework Set 5 2D Arrays

AP Computer Science Homework Set 5 2D Arrays AP Computer Science Homework Set 5 2D Arrays Note: all programs described below should work if the size of the 2D array is changed. P5A. Create a 3x4 2D array of integers. Use a nested for loop to populate

More information

AP Computer Science Homework Set 5 2D Arrays

AP Computer Science Homework Set 5 2D Arrays AP Computer Science Homework Set 5 2D Arrays Note: all programs described below should work if the size of the 2D array is changed. P5A. Create a 3x4 2D array of integers and fill it with random numbers

More information

Homework Set 2- Class Design

Homework Set 2- Class Design 1 Homework Set 2- Class Design By the end of the lesson students should be able to: a. Write the Java code define a class, its data members, and its constructors. b. Write a tostring() method for a class.

More information

AP Computer Science Homework Set 2 Class Design

AP Computer Science Homework Set 2 Class Design AP Computer Science Homework Set 2 Class Design P2A. Write a class Song that stores information about a song. In later programs we will use this Song class in our MyPod and online store. Here are the specs

More information

Homework Set 1- Fundamentals

Homework Set 1- Fundamentals 1 Homework Set 1- Fundamentals Topics if statements with ints if-else statements with Strings if statements with multiple boolean statements for loops and arrays while loops String ".equals()" method "=="

More information

AP Computer Science Homework Set 1 Fundamentals

AP Computer Science Homework Set 1 Fundamentals AP Computer Science Homework Set 1 Fundamentals P1A. Using MyFirstApp.java as a model, write a similar program, MySecondApp.java, that prints your favorites. Your program should print your food, your favorite

More information

AP Computer Science Homework Set 1 Fundamentals

AP Computer Science Homework Set 1 Fundamentals AP Computer Science Homework Set 1 Fundamentals P1A. Using MyFirstApp.java as a model, write a similar program, MySecondApp.java, that prints your favorites. Your program should do the following: a. create

More information

9/17/2018 Programming Data Structures. Encapsulation and Inheritance

9/17/2018 Programming Data Structures. Encapsulation and Inheritance 9/17/2018 Programming Data Structures Encapsulation and Inheritance 1 Encapsulation private instance variables Exercise: 1. Create a new project in your IDE 2. Download: Employee.java, HourlyEmployee.java

More information

More on variables and methods

More on variables and methods More on variables and methods Robots Learning to Program with Java Byron Weber Becker chapter 7 Announcements (Oct 12) Reading for Monday Ch 7.4-7.5 Program#5 out Character Data String is a java class

More information

Project #2: Linear Feedback Shift Register

Project #2: Linear Feedback Shift Register BHSEC Queens Object-Oriented Programming Spring 2015 Project #2: Linear Feedback Shift Register Introduction1 A register is a small amount of storage on a digital processor. In this project, we will think

More information

Practice Questions for Final Exam: Advanced Java Concepts + Additional Questions from Earlier Parts of the Course

Practice Questions for Final Exam: Advanced Java Concepts + Additional Questions from Earlier Parts of the Course : Advanced Java Concepts + Additional Questions from Earlier Parts of the Course 1. Given the following hierarchy: class Alpha {... class Beta extends Alpha {... class Gamma extends Beta {... In what order

More information

Objects and Classes. 1 Creating Classes and Objects. CSCI-UA 101 Objects and Classes

Objects and Classes. 1 Creating Classes and Objects. CSCI-UA 101 Objects and Classes Based on Introduction to Java Programming, Y. Daniel Liang, Brief Version, 10/E 1 Creating Classes and Objects Classes give us a way of defining custom data types and associating data with operations on

More information

Binghamton University. CS-140 Fall Problem Solving. Creating a class from scratch

Binghamton University. CS-140 Fall Problem Solving. Creating a class from scratch Problem Solving Creating a class from scratch 1 Recipe for Writing a Class 1. Write the class boilerplate stuff 2. Declare Fields 3. Write Creator(s) 4. Write accessor methods 5. Write mutator methods

More information

INTRODUCTION TO COMPUTER SCIENCE - JAVA

INTRODUCTION TO COMPUTER SCIENCE - JAVA INTRODUCTION TO COMPUTER SCIENCE - JAVA North Brunswick Township Public Schools Acknowledgements Vivian S. Morris Math/Computer Science Teacher Diane Galella Supervisor of the Math Department Written SPRING

More information

AP Computer Science Chapter 10 Implementing and Using Classes Study Guide

AP Computer Science Chapter 10 Implementing and Using Classes Study Guide AP Computer Science Chapter 10 Implementing and Using Classes Study Guide 1. A class that uses a given class X is called a client of X. 2. Private features of a class can be directly accessed only within

More information

AP Computer Science Summer Work Mrs. Kaelin

AP Computer Science Summer Work Mrs. Kaelin AP Computer Science Summer Work 2018-2019 Mrs. Kaelin jkaelin@pasco.k12.fl.us Welcome future 2018 2019 AP Computer Science Students! I am so excited that you have decided to embark on this journey with

More information

Ch 7 Designing Java Classes & Class structure. Methods: constructors, getters, setters, other e.g. getfirstname(), setfirstname(), equals()

Ch 7 Designing Java Classes & Class structure. Methods: constructors, getters, setters, other e.g. getfirstname(), setfirstname(), equals() Ch 7 Designing Java Classes & Class structure Classes comprise fields and methods Fields: Things that describe the class or describe instances (i.e. objects) e.g. last student number assigned, first name,

More information

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

COMP 250 Winter 2011 Reading: Java background January 5, 2011 Almost all of you have taken COMP 202 or equivalent, so I am assuming that you are familiar with the basic techniques and definitions of Java covered in that course. Those of you who have not taken a COMP

More information

Ch 7 Designing Java Classes & Class structure. Fields have data values define/describe an instance

Ch 7 Designing Java Classes & Class structure. Fields have data values define/describe an instance Ch 7 Designing Java Classes & Class structure Classes comprise fields and methods Fields have data values define/describe an instance Constructors values are assigned to fields when an instance/object

More information

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

Classes and Objects 3/28/2017. How can multiple methods within a Java class read and write the same variable? Peer Instruction 8 Classes and Objects How can multiple methods within a Java class read and write the same variable? A. Allow one method to reference a local variable of the other B. Declare a variable

More information

CS162 Computer Science I Fall 2018 Practice Exam 1 DRAFT (9 Oct.)

CS162 Computer Science I Fall 2018 Practice Exam 1 DRAFT (9 Oct.) Name: CS162 Computer Science I Fall 2018 Practice Exam 1 DRAFT (9 Oct.) The real test will look much like this one, but it will be shorter. I suggest taking this practice test under real conditions (closed

More information

CMPSCI 187 / Spring 2015 Hangman

CMPSCI 187 / Spring 2015 Hangman CMPSCI 187 / Spring 2015 Hangman Due on February 12, 2015, 8:30 a.m. Marc Liberatore and John Ridgway Morrill I N375 Section 01 @ 10:00 Section 02 @ 08:30 1 CMPSCI 187 / Spring 2015 Hangman Contents Overview

More information

Classes. Classes as Code Libraries. Classes as Data Structures

Classes. Classes as Code Libraries. Classes as Data Structures Classes Classes/Objects/Interfaces (Savitch, Various Chapters) TOPICS Classes Public versus Private Static Data Static Methods Interfaces Classes are the basis of object-oriented (OO) programming. They

More information

CmSc 150 Fundamentals of Computing I. Lesson 28: Introduction to Classes and Objects in Java. 1. Classes and Objects

CmSc 150 Fundamentals of Computing I. Lesson 28: Introduction to Classes and Objects in Java. 1. Classes and Objects CmSc 150 Fundamentals of Computing I Lesson 28: Introduction to Classes and Objects in Java 1. Classes and Objects True object-oriented programming is based on defining classes that represent objects with

More information

Encapsulation. Administrative Stuff. September 12, Writing Classes. Quick review of last lecture. Classes. Classes and Objects

Encapsulation. Administrative Stuff. September 12, Writing Classes. Quick review of last lecture. Classes. Classes and Objects Administrative Stuff September 12, 2007 HW3 is due on Friday No new HW will be out this week Next Tuesday we will have Midterm 1: Sep 18 @ 6:30 7:45pm. Location: Curtiss Hall 127 (classroom) On Monday

More information

CompuScholar, Inc. 9th - 12th grades

CompuScholar, Inc. 9th - 12th grades CompuScholar, Inc. Alignment to the College Board AP Computer Science A Standards 9th - 12th grades AP Course Details: Course Title: Grade Level: Standards Link: AP Computer Science A 9th - 12th grades

More information

IMACS: AP Computer Science A

IMACS: AP Computer Science A IMACS: AP Computer Science A OVERVIEW This course is a 34-week, 4 classroom hours per week course for students taking the College Board s Advanced Placement Computer Science A exam. It is an online course

More information

(1) Students will be able to explain basic architecture and components of digital computers and networks, and basic programming language features.

(1) Students will be able to explain basic architecture and components of digital computers and networks, and basic programming language features. Content/Discipline Java Manhattan Center for Science and Math High School Mathematics Department Curriculum Marking Period 1 Topic and Essential Question JSS (1) What are computers? (2) What is hardware

More information

Switched-On Schoolhouse 2014 User Guide Reports & Application Functions

Switched-On Schoolhouse 2014 User Guide Reports & Application Functions Switched-On Schoolhouse 2014 User Guide Reports & Application Functions MMVI Alpha Omega Publications, Inc. Switched-On Schoolhouse 2014, Switched-On Schoolhouse. Switched-On, and their logos are registered

More information

Programming with Java

Programming 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 information

CS1004: Intro to CS in Java, Spring 2005

CS1004: Intro to CS in Java, Spring 2005 CS1004: Intro to CS in Java, Spring 2005 Lecture #13: Java OO cont d. Janak J Parekh janak@cs.columbia.edu Administrivia Homework due next week Problem #2 revisited Constructors, revisited Remember: a

More information

Java Object Oriented Design. CSC207 Fall 2014

Java Object Oriented Design. CSC207 Fall 2014 Java Object Oriented Design CSC207 Fall 2014 Design Problem Design an application where the user can draw different shapes Lines Circles Rectangles Just high level design, don t write any detailed code

More information

EE 422C HW 6 Multithreaded Programming

EE 422C HW 6 Multithreaded Programming EE 422C HW 6 Multithreaded Programming 100 Points Due: Monday 4/16/18 at 11:59pm Problem A certain theater plays one show each night. The theater has multiple box office outlets to sell tickets, and the

More information

LAB 4.1 Relational Operators and the if Statement

LAB 4.1 Relational Operators and the if Statement LAB 4.1 Relational Operators and the if Statement // This program tests whether or not an initialized value of num2 // is equal to a value of num1 input by the user. int main( ) int num1, // num1 is not

More information

Classes. Classes as Code Libraries. Classes as Data Structures. Classes/Objects/Interfaces (Savitch, Various Chapters)

Classes. Classes as Code Libraries. Classes as Data Structures. Classes/Objects/Interfaces (Savitch, Various Chapters) Classes Classes/Objects/Interfaces (Savitch, Various Chapters) TOPICS Classes Public versus Private Static Data Static Methods Interfaces Classes are the basis of object-oriented (OO) programming. They

More information

CSCI 1226 Second Midterm Test

CSCI 1226 Second Midterm Test CSCI 1226 Second Midterm test 2018-11-21 General Instructions Read and follow all directions carefully. CSCI 1226 Second Midterm Test Wednesday, November 21, 2018 Name: Student #: You may use Sop and Sopln

More information

CS 231 Data Structures and Algorithms, Fall 2016

CS 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 information

Ch 7 Designing Java Classes & Class structure

Ch 7 Designing Java Classes & Class structure Ch 7 Designing Java Classes & Class structure Classes comprise fields and methods Fields: Things that describe the class or describe instances (i.e. objects) e.g. student number, first name, last name,

More information

CS 163/164 - Exam 2 Study Guide and Practice Written Exam

CS 163/164 - Exam 2 Study Guide and Practice Written Exam CS 163/164 - Exam 2 Study Guide and Practice Written Exam October 22, 2016 Summary 1 Disclaimer 2 Methods and Data 2.1 Static vs. Non-Static........................................... 2.2 Static...................................................

More information

************ THIS PROGRAM IS NOT ELIGIBLE FOR LATE SUBMISSION. ALL SUBMISSIONS MUST BE RECEIVED BY THE DUE DATE/TIME INDICATED ABOVE HERE

************ THIS PROGRAM IS NOT ELIGIBLE FOR LATE SUBMISSION. ALL SUBMISSIONS MUST BE RECEIVED BY THE DUE DATE/TIME INDICATED ABOVE HERE Program 10: 40 points: Due Tuesday, May 12, 2015 : 11:59 p.m. ************ THIS PROGRAM IS NOT ELIGIBLE FOR LATE SUBMISSION. ALL SUBMISSIONS MUST BE RECEIVED BY THE DUE DATE/TIME INDICATED ABOVE HERE *************

More information

Student Std Imports Create Guide

Student Std Imports Create Guide Overview Instead of registering students manually, you have the option of importing a spreadsheet to create student usernames. You will need administrative access to www.discoveryeducation.com. Click on

More information

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

Course materials Reges, Stuart, and Stepp, Martin. Building Java Programs: A Back to Basics Approach. 2d ed. (Boston: Addison-Wesley, 2011). AP Computer Science A Advanced Placement Computer Science A is a fast-paced course equivalent to a college introductory programming class. Students will learn about the exciting kinds of problems tackled

More information

Write the code to create an enhanced for loop that will go through every member of an ArrayList <String> myarray and print it out to the console.

Write the code to create an enhanced for loop that will go through every member of an ArrayList <String> myarray and print it out to the console. COSC 201 Review Questions Final Fall 2015 Write the code to create an enhanced for loop that will go through every member of an ArrayList myarray and print it out to the console. Give the code

More information

CS 113 MIDTERM EXAM 2 SPRING 2013

CS 113 MIDTERM EXAM 2 SPRING 2013 CS 113 MIDTERM EXAM 2 SPRING 2013 There are 18 questions on this test. The value of each question is: 1-15 multiple choice (3 pts) 17 coding problem (15 pts) 16, 18 coding problems (20 pts) You may get

More information

Chapter 11: Create Your Own Objects

Chapter 11: Create Your Own Objects Chapter 11: Create Your Own Objects Think Java: How to Think Like a Computer Scientist 5.1.2 by Allen B. Downey Our usual text takes a fairly non-standard departure in this chapter. Instead, please refer

More information

APCS Semester #1 Final Exam Practice Problems

APCS Semester #1 Final Exam Practice Problems Name: Date: Per: AP Computer Science, Mr. Ferraro APCS Semester #1 Final Exam Practice Problems The problems here are to get you thinking about topics we ve visited thus far in preparation for the semester

More information

AP Computer Science in Java Course Syllabus

AP Computer Science in Java Course Syllabus CodeHS AP Computer Science in Java Course Syllabus College Board Curriculum Requirements The CodeHS AP Java course is fully College Board aligned and covers all seven curriculum requirements extensively

More information

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University Day 4 COMP1006/1406 Summer 2016 M. Jason Hinek Carleton University today s agenda assignments questions about assignment 2 a quick look back constructors signatures and overloading encapsulation / information

More information

AP CS Fall Semester Final

AP CS Fall Semester Final Name: Class: Date: AP CS Fall Semester Final Multiple Choice Identify the choice that best completes the statement or answers the question. 1. What is printed by the following code? int k = 3; for (int

More information

ACE - Online Application Instructions FOLLOW THESE DIRECTIONS EXACTLY AS INDICATED *

ACE - Online Application Instructions FOLLOW THESE DIRECTIONS EXACTLY AS INDICATED * ACE - Online Application Instructions [If technical problems occur specific to this ACE process, please contact Nancy Nelson at nnelson@csus.edu, 916/278-2829] FOLLOW THESE DIRECTIONS EXACTLY AS INDICATED

More information

CSCI 355 Lab #2 Spring 2007

CSCI 355 Lab #2 Spring 2007 CSCI 355 Lab #2 Spring 2007 More Java Objectives: 1. To explore several Unix commands for displaying information about processes. 2. To explore some differences between Java and C++. 3. To write Java applications

More information

TeenCoder : Java Programming (ISBN )

TeenCoder : Java Programming (ISBN ) TeenCoder : Java Programming (ISBN 978-0-9887070-2-3) and the AP * Computer Science A Exam Requirements (Alignment to Tennessee AP CS A course code 3635) Updated March, 2015 Contains the new 2014-2015+

More information

Unit 10: Sorting/Searching/Recursion

Unit 10: Sorting/Searching/Recursion Unit 10: Sorting/Searching/Recursion Notes AP CS A Searching. Here are two typical algorithms for searching a collection of items (which for us means an array or a list). A Linear Search starts at the

More information

One of Mike s early tests cases involved the following code, which produced the error message about something being really wrong:

One of Mike s early tests cases involved the following code, which produced the error message about something being really wrong: Problem 1 (3 points) While working on his solution to project 2, Mike Clancy encountered an interesting bug. His program includes a LineNumber class that supplies, among other methods, a constructor that

More information

*Data Monthly. Assessment Guide: Prerequisite Skills Inventory p. 1, 269. Favorite Subject. Lesson 10.1 Lesson Story: Whales

*Data Monthly. Assessment Guide: Prerequisite Skills Inventory p. 1, 269. Favorite Subject. Lesson 10.1 Lesson Story: Whales The Alabama Course of Study is the same as the Common Core State Standards Only the numbering has been changed. Domains: Operations and Algebraic Thinking [OA] ACOS# 1-4 Getting Ready for Third Grade-Planning

More information

Midterm 1 Study Guide

Midterm 1 Study Guide Midterm 1 Study Guide Else-if, loops (while, for, and for-each), arrays, interfaces, and ADTs (List, Set, and Map). While loops and else-if Use the LateNightAtRams class below and the Student class at

More information

Chapter 3 Classes. Activity The class as a file drawer of methods. Activity Referencing static methods

Chapter 3 Classes. Activity The class as a file drawer of methods. Activity Referencing static methods Chapter 3 Classes Lesson page 3-1. Classes Activity 3-1-1 The class as a file drawer of methods Question 1. The form of a class definition is: public class {

More information

Object-Oriented Programming Concepts

Object-Oriented Programming Concepts Object-Oriented Programming Concepts Object-oriented programming מונחה עצמים) (תכנות involves programming using objects An object ) represents (עצם an entity in the real world that can be distinctly identified

More information

Programming Assignment Unit 7

Programming Assignment Unit 7 Name: Programming Assignment Unit 7 Where to Save These Assignments: These programs should be saved on your flashdrive under Unit 7 à Assignments Each program should be saved in a separate BlueJ project.

More information

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

2. [20] Suppose we start declaring a Rectangle class as follows: 1. [8] Create declarations for each of the following. You do not need to provide any constructors or method definitions. (a) The instance variables of a class to hold information on a Minesweeper cell:

More information

AP CSA 3rd Period MR. D. Course Map

AP CSA 3rd Period MR. D. Course Map AP CSA 3rd Period MR. D. Course Map AP Computer Science in Java (Mocha) Aug. 10, Aug. 11, Aug. 14, Aug. 15, 1.1.1 Introduction to With Karel 1.1.2 Quiz: Karel Commands 1.1.3 Our First Karel Program 1.1.4

More information

Week 3 Classes and Objects

Week 3 Classes and Objects Week 3 Classes and Objects written by Alexandros Evangelidis, adapted from J. Gardiner et al. 13 October 2015 1 Last Week Last week, we looked at some of the different types available in Java, and the

More information

Using Classes. GEEN163 Introduction to Computer Programming

Using Classes. GEEN163 Introduction to Computer Programming Using Classes GEEN163 Introduction to Computer Programming The history of all previous societies has been the history of class struggles. Karl Marx Programming Assignment The first programming assignment

More information

CS 106 Introduction to Computer Science I

CS 106 Introduction to Computer Science I CS 106 Introduction to Computer Science I 03 / 28 / 2012 Instructor: Michael Eckmann Today s Topics Questions? Comments? Object oriented programming More of creating our own classes Valid ways to call

More information

Islamic University of Gaza Faculty of Engineering Computer Engineering Department

Islamic University of Gaza Faculty of Engineering Computer Engineering Department Student Mark Islamic University of Gaza Faculty of Engineering Computer Engineering Department Question # 1 / 18 Question # / 1 Total ( 0 ) Student Information ID Name Answer keys Sector A B C D E A B

More information

Lesson 10B Class Design. By John B. Owen All rights reserved 2011, revised 2014

Lesson 10B Class Design. By John B. Owen All rights reserved 2011, revised 2014 Lesson 10B Class Design By John B. Owen All rights reserved 2011, revised 2014 Table of Contents Objectives Encapsulation Inheritance and Composition is a vs has a Polymorphism Information Hiding Public

More information

AP COMPUTER SCIENCE A: SYLLABUS

AP COMPUTER SCIENCE A: SYLLABUS Curricular Requirements CR1 The course teaches students to design and implement computer-based solutions to problems. Page(s) 2,3-4,5,6-7,8-9 CR2a The course teaches students to use and implement commonly

More information

Student Std Imports Update Guide

Student Std Imports Update Guide Overview Admins can do a mass update of student accounts using the import tool. You will need administrative access to www.discoveryeducation.com. Click on My Admin to access the administrative page, and

More information

Watkins Mill High School. Algebra 2. Math Challenge

Watkins Mill High School. Algebra 2. Math Challenge Watkins Mill High School Algebra 2 Math Challenge "This packet will help you prepare for Algebra 2 next fall. It will be collected the first week of school. It will count as a grade in the first marking

More information

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

Lecture 14 CSE11 Fall 2013 For loops, Do While, Break, Continue Lecture 14 CSE11 Fall 2013 For loops, Do While, Break, Continue General Loops in Java Look at other loop constructions Very common while loop: do a loop a fixed number of times (MAX in the example) int

More information

Kelly Patterson SED 514

Kelly Patterson SED 514 (1) Introduction to Databases: A database is a collection of information organized so that a computer program can quickly retrieve desired pieces of data. A field is a single piece of information; a record

More information

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

3D Graphics Programming Mira Costa High School - Class Syllabus, 3D Graphics Programming Mira Costa High School - Class Syllabus, 2009-2010 INSTRUCTOR: Mr. M. Williams COURSE GOALS and OBJECTIVES: 1 Learn the fundamentals of the Java language including data types and

More information

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

1. Which of the following is the correct expression of character 4? a. 4 b. 4 c. '\0004' d. '4' Practice questions: 1. Which of the following is the correct expression of character 4? a. 4 b. "4" c. '\0004' d. '4' 2. Will System.out.println((char)4) display 4? a. Yes b. No 3. The expression "Java

More information

Class Roster Create Guide

Class Roster Create Guide Overview The Class Roster import combines the Teacher and Student usernames with the Classes that were previously created. You must have created the Usernames and Classes before you can use this import.

More information

Recommended Group Brainstorm (NO computers during this time)

Recommended Group Brainstorm (NO computers during this time) Recommended Group Brainstorm (NO computers during this time) Good programmers think before they begin coding. Part I of this assignment involves brainstorming with a group of peers with no computers to

More information

Getting Started on Schoolbox Parent Guide

Getting Started on Schoolbox Parent Guide Getting Started on Schoolbox Parent Guide Part 1 How to Login Page 2 Part 2 Parent Dashboard Page 4 Part 3 Managing Notifications Page 6 Part 4 Types of Pages Page 7 Part 5 The Salesian College App Page

More information

New York University Computer Science Department Courant Institute of Mathematical Sciences

New York University Computer Science Department Courant Institute of Mathematical Sciences New York University Computer Science Department Courant Institute of Mathematical Sciences Course Title: Data Communications & Networks Course Number: g22.2662-001 Instructor: Jean-Claude Franchitti Session:

More information

STUDENT LESSON A15 ArrayList

STUDENT LESSON A15 ArrayList STUDENT LESSON A15 ArrayList Java Curriculum for AP Computer Science, Student Lesson A15 1 STUDENT LESSON A15 - ArrayList INTRODUCTION: It is very common for a program to manipulate data that is kept in

More information

Regis University CC&IS CS310 Data Structures Programming Assignment 2: Arrays and ArrayLists

Regis University CC&IS CS310 Data Structures Programming Assignment 2: Arrays and ArrayLists Regis University CC&IS CS310 Data Structures Programming Assignment 2 Arrays and ArrayLists Problem Scenario The real estate office was very impressed with your work from last week. The IT director now

More information

JAVA REVIEW cs2420 Introduction to Algorithms and Data Structures Spring 2015

JAVA REVIEW cs2420 Introduction to Algorithms and Data Structures Spring 2015 JAVA REVIEW cs2420 Introduction to Algorithms and Data Structures Spring 2015 1 administrivia 2 -Lab 0 posted -getting started with Eclipse -Java refresher -this will not count towards your grade -TA office

More information

Class Roster Update Guide

Class Roster Update Guide Overview Admins can make mass updates to the class rosters using the Bulk Import Tool. You must have created the Usernames and Classes before you can use this import. You will need administrative access

More information

Discovery Education. User and Classroom Imports. Automating using FTP/FTPs

Discovery Education. User and Classroom Imports. Automating using FTP/FTPs Discovery Education User and Classroom Imports Automating using FTP/FTPs Last Updated October 1, 2012 Overview: Completed teacher, student, class list, and class roster import templates can be written

More information

The Irving K. Barber School of Arts and Sciences COSC 111 Final Exam Winter Term II Instructor: Dr. Bowen Hui. Tuesday, April 19, 2016

The Irving K. Barber School of Arts and Sciences COSC 111 Final Exam Winter Term II Instructor: Dr. Bowen Hui. Tuesday, April 19, 2016 First Name (Print): Last Name (Print): Student Number: The Irving K. Barber School of Arts and Sciences COSC 111 Final Exam Winter Term II 2016 Instructor: Dr. Bowen Hui Tuesday, April 19, 2016 Time: 6:00pm

More information

Simple Java Reference

Simple Java Reference Simple Java Reference This document provides a reference to all the Java syntax used in the Computational Methods course. 1 Compiling and running... 2 2 The main() method... 3 3 Primitive variable types...

More information

Power Teacher August 2015

Power Teacher August 2015 Power Teacher 2015-2016 August 2015 1 What s Possible with Power Teacher 2.8 Can change a student s given name to his/her preferred name. Can leave a late-enrolling student at the bottom of the class list.

More information

Test 1: CPS 100. Owen Astrachan. October 1, 2004

Test 1: CPS 100. Owen Astrachan. October 1, 2004 Test 1: CPS 100 Owen Astrachan October 1, 2004 Name: Login: Honor code acknowledgment (signature) Problem 1 value 20 pts. grade Problem 2 30 pts. Problem 3 20 pts. Problem 4 20 pts. TOTAL: 90 pts. This

More information

CSE 143, Winter 2009 Final Exam Thursday, March 19, 2009

CSE 143, Winter 2009 Final Exam Thursday, March 19, 2009 CSE 143, Winter 2009 Final Exam Thursday, March 19, 2009 Personal Information: Name: Section: Student ID #: TA: You have 110 minutes to complete this exam. You may receive a deduction if you keep working

More information

AP Computer Science A Magpie Chatbot Lab Student Guide

AP Computer Science A Magpie Chatbot Lab Student Guide AP Computer Science A Magpie Chatbot Lab Student Guide The AP Program wishes to acknowledge and thank Laurie White of Mercer University, who developed this lab and the accompanying documentation. Activity

More information

1) Consider the following code segment, applied to list, an ArrayList of Integer values.

1) Consider the following code segment, applied to list, an ArrayList of Integer values. Advanced Computer Science Unit 7 Review Part I: Multiple Choice (12 questions / 4 points each) 1) What is the difference between a regular instance field and a static instance field? 2) What is the difference

More information

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit.

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit. Com S 227 Spring 2018 Miniassignment 1 40 points Due Date: Thursday, March 8, 11:59 pm (midnight) Late deadline (25% penalty): Friday, March 9, 11:59 pm General information This assignment is to be done

More information

CS211 Prelim Oct 2001 NAME NETID

CS211 Prelim Oct 2001 NAME NETID This prelim has 4 questions. Be sure to answer them all. Please write clearly, and show all your work. It is difficult to give partial credit if all we see is a wrong answer. Also, be sure to place suitable

More information

CS231 - Spring 2017 Linked Lists. ArrayList is an implementation of List based on arrays. LinkedList is an implementation of List based on nodes.

CS231 - Spring 2017 Linked Lists. ArrayList is an implementation of List based on arrays. LinkedList is an implementation of List based on nodes. CS231 - Spring 2017 Linked Lists List o Data structure which stores a fixed-size sequential collection of elements of the same type. o We've already seen two ways that you can store data in lists in Java.

More information

CS111: PROGRAMMING LANGUAGE II

CS111: 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 information

Notes on Chapter Three

Notes on Chapter Three Notes on Chapter Three Methods 1. A Method is a named block of code that can be executed by using the method name. When the code in the method has completed it will return to the place it was called in

More information

connected New User Guide

connected New User Guide connected New User Guide This guide will walk you through how to accomplish the following for programs launched through the McGraw-Hill connected website: Create a Teacher Account Redeem Content Create

More information

CS 455 Final Exam Fall 2015 [Bono] Dec. 15, 2015

CS 455 Final Exam Fall 2015 [Bono] Dec. 15, 2015 Name: USC NetID (e.g., ttrojan): CS 455 Final Exam Fall 2015 [Bono] Dec. 15, 2015 There are 6 problems on the exam, with 70 points total available. There are 10 pages to the exam (5 pages double-sided),

More information

Lesson 10: Quiz #1 and Getting User Input (W03D2)

Lesson 10: Quiz #1 and Getting User Input (W03D2) Lesson 10: Quiz #1 and Getting User Input (W03D2) Balboa High School Michael Ferraro September 1, 2015 1 / 13 Do Now: Prep GitHub Repo for PS #1 You ll need to submit the 5.2 solution on the paper form

More information

A.P. Computer Science A Summer Packet

A.P. Computer Science A Summer Packet A.P. Computer Science A Summer Packet Name: Advisory Teacher: AP Computer Science A Summer 2017 Dear Student, Computer Science is a growing subject of study, and one that leads to many opportunities in

More information