Download Lesson 11 use existing subprograms File

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
LESSON 10 ALGORITHMS WITH NEST ED STRUCTURES
Course:
ICS3U
Lesson #:
11
Unit: 1
Time (minutes):
3 hours
Curriculum expectations:
A3.1 demonstrate the ability to use existing subprograms (e.g., random number
generator, substring, absolute value) within computer programs;
Lecture Notes:
Java Class Library
The Java Class Library (JCL) is a set of dynamically loadable libraries
that Java applications can call at run time. Almost all of JCL is stored
in a single Java archive file called "rt.jar", which is provided with JRE
and JDK distributions.
If we want to know functions of a library class, we need to read java
API(Application Programming Interfaces).
How to use String class?
Step 1, Go to google to search Java API
Step 2. Click Java 8 API and find String class
Step 3, Find method to convert any string to uppercase.
Step 4. Write a java program(ConverMe.java) to conver any input
string to Uppercase
public class ConvertMe {
public static void main(String[] args){
String s=args[0];
System.out.println(s.toUpperCase());
}
}
Note: How to use a class in general
Step 1, Create a object using class
For example:
String s=new String(“I love computer programming”);
S is an object. It is an instance of String class.
Step 2, Call a method to do what you want to do
String s1=s.toUpperCase();
toUpperCase() is a method of String class.
Teaching Strategies:
*
Class Activity (teacher
facilitation)
Direct Instruction (discussion
possible)
*
Experiential learning (learn by
doing)
Class Discussion (teacher
facilitated)
*
Direct Instruction (teacher-led)
*
Worksheets/Surveys
Small Group Discussion
Individual or Group Research
Partner Discussion/Conferencing
Teacher Modeling
1:1 Conferencing Teacher &
Student.
Text-based modeling
Teacher reading to class
Use of Computers / Internet
Silent individual reading
Use of video tape or audio
materials
Group based reading
Role Playing
Independent Work (teacher
facilitation)
Presentations.
Group Work (teacher facilitation)
Guest Speaker / Interviews /
Questions
*