Skip to content

six0four/ceng212

Repository files navigation

CENG 212

Table of Contents

  1. Week 01 Lab Sessions

  2. Week 02 Lab Sessions

  3. Week 03 Lab Sessions

  4. Week 04 Lab Sessions

Week 01 Lab Sessions

Reporting an Academic Computer Fault

Please let ali.owayid@humber.ca know the station identifier (e.g. J209A-N-011) and the problem such that he can submit a service request, if the same problem persists - ask for a ticket number and let me know what it is.

Short video and introductions

Reflective Learning

First Java Program - Using Linux

  1. Use an ssh terminal such as PuTTY to connect to munro.humber.ca
  2. Once logged in create a directory for this course:
[n12345678@munro ~]$ mkdir ceng212
  1. Change to that directory:
[n12345678@munro ~]$ cd ceng212
  1. Enter/duplicate then compile the 5 lines of simple.java code from this repository:
[n12345678@munro ceng212]$ javac simple.java
  1. Run the program by typing:
[n12345678@munro ceng212]$ java simple

Getting started with NetBeans - Using Windows

  1. Start NetBeans:
    01startmenu

  2. Create a new project:
    01newproject

  3. Select the type of project:
    01javawithant

  4. Select a project name and location (it will likely end up between 100 kB and 200 kB in size).
    01namelocation

  5. Add a print statement and run the program:
    01addprintrun
    01buildsuccessful

  6. Complete the handout.

Week 02 Lab Sessions

  1. Start NetBeans and complete the handout.

Week 03 Lab Sessions

  1. Start NetBeans and complete the handout.

Week 04 Lab Sessions

  1. Note that NetBeans may be available in this list of labs.
  2. Start NetBeans and create a new project as per lab 01. Exception: you should name it FirstnameLastname_Arrays and save it in the folder H:\ceng212\lab04.
  3. Add the methods:
public static double mean (double [ ] x){
   return -1;}
public static double seriesSum(){
   return -1;}
public static int getUppercaseCount(String s){
   return -1;}

04methodsadded 4. SAVE YOUR PROJECT.
5. Right click on FirstnameLastneame_Arrays.java and Select Tools->Create/Update Tests.
04createupdatetests
6. Accept the defaults by clicking OK:
04testdefaults
7. Right click on Test Libraries and select Add JAR/Folder...
04addjar
8. Navigate to C:\Program Files\NetBeans 11.0\platform\modules\ext\ and use Ctrl to select both hamcrest-core-1.3.jar and junit-4.12.jar:
04junitham
9. Replace the following in FirstnameLastneame_ArraysTest.java

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;

with

import org.junit.Test;
import static org.junit.Assert.*;

04junitfour
10. Remove

	@BeforeAll
    public void setUpClass() {
    }
    
    @AfterAll
    public void tearDownClass() {
    }
    
    @BeforeEach
    public void setUp() {
    }
    
    @AfterEach
    public void tearDown() {
    }

04beforeafter
11. Test the project from Run -> Test Project (FirstnameLastname_Arrays) Alt+F6
04testproject
04testfailed
12. Complete the coding and submission as described in the handout.

About

CENG 212

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published