Welcome, Guest. Please Login
NTCS Homework Board
  Should discrepancies arise between this website and what is told in class, the information given in class takes priority
  HomeHelpSearchLogin Teacher Calendar Activities Calendar  
 
 
Page Index Toggle Pages: 1
Send Topic Print
Java Syntax Lessons (Read 14 times)
Reply #6 - Oct 6th, 2017 at 7:15am

Mr. Vant Erve   Offline
YaBB Teacher
TechCommittee

Posts: 873
 
Sorry I couldn't be there (again) today guys.  You may work together to complete the Arrays treasure hunt.  Even fire up the projector and take it up together if you'd like!

If you get through lessons 13-15 and you want to tackle the Practising Arrays Lesson, here's a link to a video that will help you understand what Plinko is like.  You can skip the first 1:50.  You may show this on the big screen too if you'd like.

I'll actually be with you in class on Friday!
« Last Edit: Oct 10th, 2017 at 2:55pm by Mr. Vant Erve »  

<>< <>< <>< <>< <>< <>< <>< <>< <><
                 Mr. D. Vant Erve

         "I sing, for I cannot be silent;
      His love is the theme of my song"
                 -Fanny J. Crosby
IP Logged
 
Reply #5 - Oct 4th, 2017 at 9:31am

Mr. Vant Erve   Offline
YaBB Teacher
TechCommittee

Posts: 873
 
Here are the lessons on arrays.  See how many you can get through tonight, but don't hurt yourself!
 

<>< <>< <>< <>< <>< <>< <>< <>< <><
                 Mr. D. Vant Erve

         "I sing, for I cannot be silent;
      His love is the theme of my song"
                 -Fanny J. Crosby
IP Logged
 
Reply #4 - Sep 25th, 2017 at 1:17pm

Mr. Vant Erve   Offline
YaBB Teacher
TechCommittee

Posts: 873
 
Here are the lessons on looping.  Read over the first two (9 and 10) and try the homework.
 


<>< <>< <>< <>< <>< <>< <>< <>< <><
                 Mr. D. Vant Erve

         "I sing, for I cannot be silent;
      His love is the theme of my song"
                 -Fanny J. Crosby
IP Logged
 
Reply #3 - Sep 14th, 2017 at 5:20pm

Mr. Vant Erve   Offline
YaBB Teacher
TechCommittee

Posts: 873
 
Here are some handouts for the days I'm gone to Chandos next week.  These are all available in the Coursefiles folder on the server as well, but just in case it's not up and running . . .
  • MONDAY: work on #6 and #7 in class
  • TUESDAY:
    • the supply teacher will have a hardcopy of the solutions for #6 and #7 for you to check your answers individually
    • Start work on #8 - due early next week.
  • WEDNESDAY: Work on #8 - due early next week.
 

<>< <>< <>< <>< <>< <>< <>< <>< <><
                 Mr. D. Vant Erve

         "I sing, for I cannot be silent;
      His love is the theme of my song"
                 -Fanny J. Crosby
IP Logged
 
Reply #2 - Sep 14th, 2017 at 3:34pm

Mr. Vant Erve   Offline
YaBB Teacher
TechCommittee

Posts: 873
 
Here is the filled in version of "5 - Comparison Notes" along with some Java code to check the answers of the homework.

Code:

import java.util.*;

public class ComparisonNotesChecker {
    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);

        // Question 1 setup  --  Comment these out to check Question 2
        String s1 = "I understand";
        String s2 = s1;
        String s3 = in.nextLine();      // user types ‘I understand’

        // Question 2 setup -- "Uncomment" these to check Question 2
        //         String s1 = "hello";
        //         String s2 = s1;
        //         String s3 = in.nextLine();  // user types ‘hello’
        //         s1 = "bye";

        if(s1 == s2) System.out.println("a True");
        if(s1.equals(s2))  System.out.println("b True");    
        if(s1 == s3)  System.out.println("c True");       
        if(s1.equals(s3))  System.out.println("d True");   
        if(s2 == s3)  System.out.println("e True");       
        if(s2.equals(s3))   System.out.println("f True");
    }
}

 

<>< <>< <>< <>< <>< <>< <>< <>< <><
                 Mr. D. Vant Erve

         "I sing, for I cannot be silent;
      His love is the theme of my song"
                 -Fanny J. Crosby
IP Logged
 
Reply #1 - Sep 13th, 2017 at 12:58pm

Mr. Vant Erve   Offline
YaBB Teacher
TechCommittee

Posts: 873
 
Syntax Chart #2 and the simple Java program template are attached.

And here's the code for the finished MyFirstIfStatement:

import java.util.*;
public class MyFirstIfStatement
{
    public static void main(String[] args)
    {
        //gonna be taking input so we need a Scanner
        Scanner userInput = new Scanner(System.in);

        int secretNumber = 42;

        //tell user all about the program and get input!
        System.out.println("Secret Number Program!! Wanna play?\nYes you do. Guess my secret number (0-100)");
        int num = Integer.parseInt(userInput.nextLine());

        //check to see if the input is valid
        if (num < 0 || num > 100) //out of bounds case
        {
            System.out.println("Guess between 0 and 100");
        }
        else    //input is valid, so see if it's right
        {
            if (num != secretNumber) System.out.println("You Lose!");
            else System.out.println("You Win!");            
        }   
    }
}


« Last Edit: Sep 14th, 2017 at 3:42pm by Mr. Vant Erve »  

<>< <>< <>< <>< <>< <>< <>< <>< <><
                 Mr. D. Vant Erve

         "I sing, for I cannot be silent;
      His love is the theme of my song"
                 -Fanny J. Crosby
IP Logged
 
Sep 6th, 2017 at 4:28pm

Mr. Vant Erve   Offline
YaBB Teacher
TechCommittee

Posts: 873
 
Here's what we did together in class today.  Please do Question #1 from the Homework section at the bottom.  And question 2!
« Last Edit: Sep 7th, 2017 at 1:12pm by Mr. Vant Erve »  

<>< <>< <>< <>< <>< <>< <>< <>< <><
                 Mr. D. Vant Erve

         "I sing, for I cannot be silent;
      His love is the theme of my song"
                 -Fanny J. Crosby
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print