ICS 4U First Online Homework
In order to ease you into this online learning and to see who has made it this far we are only going to do a little homeowork
today. Make sure you keep checking the website and your TDSB student email for information about the class and from your other
courses, the school and the TDSB.
Copy the following program and load it in JGrasp (or any other Java IDE) (continue down
to the bottom of this page and fill in the form even if you can't run
the program):
public class RollCall
{
public static void main(String[] args)
{
String name = "Bob";
int total = 0;
for (int i = 0; i < name.length(); i++)
total += name.charAt(i);
if (name.equals("Bob"))
System.out.println("Total = 0");
else
System.out.println("Total = " + total);
}
}
|
|
On the first line in the main method replace the string "Bob" with your own first name. Run the program and note what number gets printed out.
Have a look at this smart board document. Scroll down to the bottom of the page and find a question. You will
answer that question as well as well as two questions about the program you ran above on this Google form. This will help me know
that you are ready to continue this course online.