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
Binary file added MainProgram.class
Binary file not shown.
13 changes: 13 additions & 0 deletions MainProgram.ctxt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#BlueJ class context
comment0.target=MainProgram
comment0.text=\n\ Write\ a\ description\ of\ class\ MainProgram\ here.\n\n\ @author\ (your\ name)\n\ @version\ (a\ version\ number\ or\ a\ date)\n
comment1.params=
comment1.target=MainProgram()
comment1.text=\n\ Constructor\ for\ objects\ of\ class\ MainProgram\n
comment2.params=
comment2.target=void\ requestInput()
comment3.params=
comment3.target=void\ processInput()
comment4.params=
comment4.target=void\ greet()
numComments=5
45 changes: 45 additions & 0 deletions MainProgram.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import java.util.Scanner;

/**
* Write a description of class MainProgram here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class MainProgram
{
// instance variables - replace the example below with your own

public String input;
/**
* Constructor for objects of class MainProgram
*/
public MainProgram()
{
// initialise instance variables
requestInput(); //This one gets input from user and stores it
processInput(); //This one checks if input is Alice or Bob, if so, greet

}

public void requestInput(){
Scanner myScanner = new Scanner(System.in);
input = myScanner.nextLine();

}

public void processInput(){
if (input.equals( "Alice") || input.equals("Bob")){
greet();
}


}

public void greet(){
System.out.println("Hello, " + input + " how are you today?");

}

}

38 changes: 38 additions & 0 deletions bluej.pkg
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#BlueJ package file
editor.fx.0.height=728
editor.fx.0.width=800
editor.fx.0.x=9
editor.fx.0.y=87
objectbench.height=100
objectbench.width=776
package.divider.horizontal=0.6
package.divider.vertical=0.8003731343283582
package.editor.height=422
package.editor.width=684
package.editor.x=556
package.editor.y=159
package.frame.height=600
package.frame.width=800
package.numDependencies=0
package.numTargets=2
package.showExtends=true
package.showUses=true
project.charset=UTF-8
readme.height=60
readme.name=@README
readme.width=48
readme.x=10
readme.y=10
target1.height=70
target1.name=MainProgram
target1.showInterface=false
target1.type=ClassTarget
target1.width=120
target1.x=70
target1.y=10
target2.height=70
target2.name=README.md
target2.type=TextTarget
target2.width=120
target2.x=10
target2.y=110
20 changes: 20 additions & 0 deletions bluej.pkh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#BlueJ package file
package.editor.height=286
package.editor.width=408
package.editor.x=419
package.editor.y=319
package.numDependencies=0
package.numTargets=1
package.showExtends=true
package.showUses=true
target1.editor.height=735
target1.editor.width=648
target1.editor.x=50
target1.editor.y=60
target1.height=50
target1.name=TicketMachine
target1.showInterface=false
target1.type=ClassTarget
target1.width=110
target1.x=80
target1.y=50
38 changes: 38 additions & 0 deletions package.bluej
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#BlueJ package file
editor.fx.0.height=728
editor.fx.0.width=800
editor.fx.0.x=9
editor.fx.0.y=87
objectbench.height=100
objectbench.width=776
package.divider.horizontal=0.6
package.divider.vertical=0.8003731343283582
package.editor.height=422
package.editor.width=684
package.editor.x=556
package.editor.y=159
package.frame.height=600
package.frame.width=800
package.numDependencies=0
package.numTargets=2
package.showExtends=true
package.showUses=true
project.charset=UTF-8
readme.height=60
readme.name=@README
readme.width=48
readme.x=10
readme.y=10
target1.height=70
target1.name=MainProgram
target1.showInterface=false
target1.type=ClassTarget
target1.width=120
target1.x=70
target1.y=10
target2.height=70
target2.name=README.md
target2.type=TextTarget
target2.width=120
target2.x=10
target2.y=110