Skip to content
Open
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
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ We will now artificially trigger a merge conflict. When we follow good git pract

1. Have BOTH Partner A and Partner B edit the below line. Each person should make it say something different.
```
EDIT THIS LINE
EDIT THIS LINE!!!
I have eddited this line - Matthew


```
1. Have BOTH Partner A and Partner B add, commit, and push the changes. You can refer to the above steps for a refresher on how to add/commit/push. One of the partners will get an error saying that their changes can't be pushed. This is OK and expected. Today we are practicing how to resolve this error.
1. Have the error partner pull the other partner's changes:
Expand Down Expand Up @@ -138,3 +141,5 @@ Try updating the program so that it can handle multiple lines of text. Or make a
[Deer](art/deer.txt)


Hello my name is Matthew.
Hello my name is Justin.
36 changes: 36 additions & 0 deletions src/Dog.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
public class Dog implements Animal {

/**
* The Dog class represents a dogand provides its ASCII art representation.
* This class implements the Animal interface and overrides the getAnimalArt
* and toString methods.
*
*/


/**
* Returns the ASCII art representation of the dog.
*
* @return A string containing the ASCII art of the cow.
*/
@Override
public String getAnimalArt() {
return
"/ \\__\n"+
"( @\\___\n" +
"/ O\n" +
"/ (_____/\n" +
"/_____/";
}

/**
* Returns the name of the animal ("dog").
* This method overrides the toString method to return the name of the cow.
*
* @return The string "cow" representing the name of the animal.
*/
@Override
public String toString() {
return "dog";
}
}
35 changes: 35 additions & 0 deletions src/Lion.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* The Lion class represents a Lion and provides its ASCII art representation.
* This class implements the Animal interface and overrides the getAnimalArt
* and toString methods.
*
* Cow by Tony Monroe. See license file for more details.
*/
class Lion implements Animal
{

/**
* Returns the ASCII art representation of the Lion.
*
* @return A string containing the ASCII art of the Lion.
*/
@Override
public String getAnimalArt() {
return " ^__^\n" +
" { (oo) }\\_______\n" +
" {(__)}\\ )\\/\\\n" +
" ||----w |\n" +
" || ||";
}

/**
* Returns the name of the animal ("Lion").
* This method overrides the toString method to return the name of the Lion.
*
* @return The string "Lion" representing the name of the animal.
*/
@Override
public String toString() {
return "Lion";
}
}
2 changes: 1 addition & 1 deletion src/SayApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static Animal getAnimalChoice(Scanner scanner) {
* @return A list of Animal objects.
*/
public static List<Animal> animalList() {
return Arrays.asList(new Cow(), new Duck());
return Arrays.asList(new Cow(), new Duck(), new Dog(), new Lion());
}

/**
Expand Down