Intro to Java 2014-15

Intro to Java 2014-15


 Extra credit

Quarter 4

2-d Arrays

Objects in Java

  • Objects in Java
    • Constructor, what it is, and what’s role is
    • default value of datatypes
    • instance vs local variables and defaults
    • private vs public
  • Student Assignment

Quarter 3

Unit 1 : Java

 

 

25h

 


 

Last year’s page.

 

bool isLeapYear(int yr) Create a function bool isLeapYear( int yr) that returns true if the year is a leap year, false otherwise

Create a Leap Year calculator. Ask the user for a year and determine the number of leap years that have occurred from between 1581, the first leap year, and the year that the user entered.. You may assume that the input is a number, but you are responsible for ensuring that the number is a valid number (ie not before 1581 etc..)

Tip for testing your program: Try numbers that are multiples of 400, 100 and 4 .

Quiz/Test on Wed November 5th

  • definition of pass by value
  • definition of pass by reference
  • parts of a function , return value  (void vs int)
  • be able to state the output of running code (like our classroom examples)

 

 

Leave a Reply