Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,4 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

.vscode/
8 changes: 0 additions & 8 deletions .vscode/settings.json

This file was deleted.

17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# About this Repository

This repo contains starter code for the in-book examples for LaunchCode's
[Java Web Development](https://education.launchcode.org/java-web-development/index.html)
course.

## Requirements

The classes in this repo require Java13. Please refer to the book referenced
above for instructions on how to download and use the examples.

## Updating

Occasionally, the LaunchCode team will make changes to this repository
that will affect your coursework. When you start your prep-work for each
lesson of the course, be sure to fetch to stay up to date with the
latest changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.launchcode.java.demos.datatypes;
package org.launchcode.java.demos.lsn1datatypes;

public class HelloMethods {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.launchcode.java.demos.datatypes;
package org.launchcode.java.demos.lsn1datatypes;

public class Message {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.launchcode.java.demos.datatypes;
package org.launchcode.java.demos.lsn1datatypes;

import java.util.Scanner;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.launchcode.java.demos.collections;
package org.launchcode.java.demos.lsn2controlflowandcollections;

import java.util.Scanner;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.launchcode.java.demos.collections;
package org.launchcode.java.demos.lsn2controlflowandcollections;

import java.util.ArrayList;
import java.util.Scanner;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.launchcode.java.demos.collections;
package org.launchcode.java.demos.lsn2controlflowandcollections;

import java.util.HashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.launchcode.java.demos.school;
package org.launchcode.java.demos.lsn3classes1;

public class SchoolPractice {
public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.launchcode.java.demos.school;
package org.launchcode.java.demos.lsn3classes1;

// Start working here with your Student class.
// To instantiate the Student class, add your code to the main in the file, SchoolPractice.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.launchcode.java.demos.lsn4school;
package org.launchcode.java.demos.lsn4classes2;

import java.util.ArrayList;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.launchcode.java.demos.lsn4school;
package org.launchcode.java.demos.lsn4classes2;

public class Student {

Expand Down Expand Up @@ -28,7 +28,8 @@ public String studentInfo() {
return (this.name + " has a GPA of: " + this.gpa);
}

// TODO: Uncomment and complete the getGradeLevel method here:

//TODO: Uncomment and complete the getGradeLevel method here:
// public String getGradeLevel() {
// // Determine the grade level of the student based on numberOfCredits
// }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.launchcode.java.demos.lsn4school;
package org.launchcode.java.demos.lsn4classes2;

public class Teacher {
private String firstName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.launchcode.java.demos.testing.main;
package org.launchcode.java.demos.lsn5unittesting.main;

public class Car {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.launchcode.java.demos.testing.main;
package org.launchcode.java.demos.lsn5unittesting.main;

public class Main {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.launchcode.java.demos.testing.test;
package org.launchcode.java.demos.lsn5unittesting.test;

public class CarTest {

Expand Down
68 changes: 68 additions & 0 deletions src/org/launchcode/java/demos/lsn6inheritance/Cat.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package org.launchcode.java.demos.lsn6inheritance;

public class Cat {

private boolean tired = false;
private boolean hungry = false;
private double weight;

// The biological family for all cat species
private String family = "Felidae";

public Cat (double aWeight) {
weight = aWeight;
}

/**** Getters and Setters ****/

public boolean isTired() {
return tired;
}

public void setTired(boolean aTired) {
tired = aTired;
}

public boolean isHungry() {
return hungry;
}

public void setHungry(boolean aHungry) {
hungry = aHungry;
}

public double getWeight() {
return weight;
}

public void setWeight(double aWeight) {
weight = aWeight;
}

public String getFamily() {
return family;
}

/**** Instance Methods ****/

// A cat is rested and hungry after it sleeps
public void sleep() {
tired = false;
hungry = true;
}

// Eating makes a cat not hungry
public void eat() {

// eating when not hungry makes a cat sleepy
if (!hungry) {
tired = true;
}

hungry = false;
}

public String noise () {
return "Meeeeeeooooowww!";
}
}
24 changes: 24 additions & 0 deletions src/org/launchcode/java/demos/lsn6inheritance/HouseCat.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.launchcode.java.demos.lsn6inheritance;

public class HouseCat extends Cat {
private String name;
private String species = "Felis catus";

public HouseCat(String aName, double aWeight) {
super(aWeight);
name = aName;
}

public boolean isSatisfied() {
return !isHungry() && !isTired();
}

@Override
public String noise() {
return "Hello, my name is " + name + "!";
}

public String purr() {
return "I'm a HouseCat";
}
}