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
Empty file added README.TXT
Empty file.
17 changes: 12 additions & 5 deletions TooLargeTooSmall.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

/**
* Write a description of class TooLargeTooSmall here.
*
* @author (your name)
* @version (a version number or a date)
*
* Checks to see if guess is equal to chosen number.
* @David Comer
* @2/5/21
*/
public class TooLargeTooSmall {
private Integer chosenNum;
Expand All @@ -13,11 +13,18 @@ public class TooLargeTooSmall {
*/
public TooLargeTooSmall(Integer seed) {
// initialise instance variables

chosenNum = seed;
}

public Integer guess(Integer g) {

if (chosenNum == g){
return 0;}
else if (chosenNum > g){
return -1;}
else if (chosenNum < g){
return 1;}

return chosenNum;

}
Expand Down
4 changes: 2 additions & 2 deletions TooLargeTooSmallTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
/**
* The test class TooLargeTooSmallTest.
*
* @author (your name)
* @version (a version number or a date)
* @David Comer
* @2/5/20
*/
public class TooLargeTooSmallTest
{
Expand Down