CSI Lecture 17

CSI Lecture 17 - CSI 201 Introduction to Computer Science...

Info iconThis preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon
CSI 201 Introduction to Computer Science Spring 2010 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
LECTURE 17 Wednesday, March 24, 2010 2
Background image of page 2
ICLICKER QUESTION 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ICLICKER QUESTION A. Object B. Class C. Java D. Picture E. None of the Above All classes are descended from what class? SECONDS REMAINING 4
Background image of page 4
ANNOUNCEMENTS 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
SUMMARY In this assignment you will add a method to the Picture class (Picture.java) to create a color component layout. DEADLINE This assignment is due on Tuesday, April 13 at 11:59 pm. PRE-REQ You should read chapter 6 in the book before working on this assignment. DESCRIPTION COMPONENTLAYOUT Create a new method: public Picture componentLayout() in Picture.java . This method will create and return a new picture object. The new picture should be a grid layout with four versions of the picture. The four versions will be Grays, Reds, Greens, and Blues. Each version will contain the pixels that fit in that category, and there will be no overlap. The layout will be as follows: Grays Reds Greens Blues The new picture will obviously have twice the width and twice the height as the original. You should check each pixel to see where it belongs. Use an if/else if/else statement. You should check for grayscale first. To determine if a pixel is grayscale: • Compute the intensity • Create the grayscale color of that pixel • Check if the color distance between that pixel and the grayscale color is less than 16 After that, check for each of the other three regions. A pixel belongs in the red region if its red component is larger than green and blue. Similar for green and blue. Once you determine the region where a pixel belongs, copy it to the correct location in the new picture object. (Think about the x and y values) Introduction to Computer Science CSI201 Spring 2010 ASSIGNMENT 4 ASSIGNMENT 4 Assignment 4 is now posted on Blackboard It is due Tuesday, April 13 at 11:59 pm. Review the Assignment Guidelines on Blackboard for information regarding grading policy. 6
Background image of page 6
STANDINGS Many of you have been asking about your current standing in the course. You can Fgure this out for yourself: The Midterm is worth 20% Assignments are worth 15% Labs are worth 20% iClicker points are worth 20% 7
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
STANDINGS So, current average = Midterm * .2 + ((Asgn1 + Asgn2 + Asgn3)/3) * .15 + ((Lab1 + . .. + Lab8)/8) * .2 + (iClicker * 115/53) * .2 That will be out of 75, so multiply by 100/75 to get your average out of 100. 8
Background image of page 8
TODAY’S CONTENT… 9
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CREATING CLASSES 10
Background image of page 10
This material corresponds to chapter eleven in the text. Creating Classes 11
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CLASS DECLARATION To declare a Student class Click on the New button in DrJava Type in: public class Student { } Save it as the fle Student.java Click on File then Save Click the Compile All button to compile it 12
Background image of page 12
DECLARING FIELDS Syntax visibility
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 44

CSI Lecture 17 - CSI 201 Introduction to Computer Science...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online