Difference between revisions of "IB Computer Science 1"

From WLCS
 
Line 1: Line 1:
== Friday (5/11/12) ==
+
== [[IBCS1 - Archives]] ==
'''Agenda:'''
 
* Demo Java Functions Practice
 
* Half of the class has yet to complete 9 exercises from [http://codingbat.com/java/String-2 Java->String-2]
 
** [[Media:JavaStrings_Basic.ppt]]
 
* Introduction to Java Arrays
 
** [[Media:JavaArrays_Basic.ppt]]
 
* Walk through a couple array problems
 
* Complete at least 10 problems in [http://codingbat.com/java/Array-1 Java-Array-1]
 
 
 
* Complete at least 6 problems in [http://codingbat.com/java/Array-2 Java-Array-2]
 
 
 
* '''If you are a senior, please complete the following surveys:'''
 
** [https://spreadsheets.google.com/viewform?hl=en&formkey=cmpucDFrRDJUekY5VEphYzE2V25ZSVE6MA..#gid=0 Graduating Senior Survey]
 
** [https://spreadsheets.google.com/viewform?formkey=dERxTUlReGxiTEowMlpVTnNjazJsbUE6MQ End-of-Course Survey]
 
 
 
== Monday - Wednesday (5/7/12 - 5/9/12) ==
 
* Methods & functions in Java
 
*# Do you want the method/function to be usable by other files?
 
*#* Yes - '''public'''
 
*#* No - '''private'''
 
*# static (just put it there)
 
*# Do you want the method/function to return anything?
 
*#* Yes - put the return type (e.g. '''int''', '''double''', '''String''', etc.)
 
*#* No - '''void'''
 
*# What do you want the name of the method/function to be?
 
*#* Must be all one word, no spaces (follows same rules as variable names)
 
*# Do you want the method/function to have any input '''parameters'''?
 
*#* No - just have empty parentheses
 
*#* Yes - declare the variable parameters and their types in the parentheses
 
** Example template: public/private  static  RETURNTYPE  FUNCTIONNAME(PARAMETERS)
 
** Example: public static int functionName(int x, int y)
 
* Java Functions Practice
 
# '''int compare(int a, int b)'''
 
#* Define a compare(int a, int b) function that returns 1 if a > b, 0 if a == b, and -1 if a < b
 
#* Test your compare function with 3 different function calls:
 
#** compare(5, 4)
 
#** compare(7, 7)
 
#** compare(2, 3)
 
# '''double hypotenuse(double a, double b)'''
 
#* Define a hypotenuse(double a, double b) function that returns the length of the hypotenuse of a right triangle given the lengths of legs a and b
 
#* Test your hypotenuse function with the following function calls:
 
#** hypotenuse(3, 4)
 
#** hypotenuse(12, 5)
 
#** hypotenuse(7, 24)
 
# '''double f2c(double t)'''
 
#* Define a function named f2c(double t) that converts the temperature parameter t from Fahrenheit to Celsius and returns it.
 
#* If you don't remember the formula to convert, then look for it online!
 
#* Create your own function calls that test the function
 
# '''double c2f(double t)'''
 
#* Define a function named c2f(double t) that converts the temperature parameter t from Celsius to Fahrenheit and returns it.
 
#* If you don't remember the formula to convert, then look for it online!
 
#* Create your own function calls that test the function
 
 
 
== Tuesday - Thursday (5/1/12 - 5/2/12) ==
 
* Demo the following today:
 
** [[Quadratic Formula Assignment]]
 
** [[MPAA calculator assignment]]
 
** [[Guessing Game Assignment]]
 
** [[Print Shapes Exercises]]
 
** [[Looping Exercises]]
 
 
 
== Archives ==
 
* [[IBCS1 - 1112 - April]]
 
* [[IBCS1 - 1112 - March]]
 
* [[IBCS1 - 1112 - February]]
 
* [[IBCS1 - 1112 - January]]
 
* [[IBCS1 - 1112 - December]]
 
* [[IBCS1 - 1112 - November]]
 
* [[IBCS1 - 1112 - October]]
 
* [[IBCS1 - 1112 - September]]
 

Latest revision as of 08:28, 13 September 2023