A
anfaengerin
Gast
Ich habe eine schwere Übung (für mich zumindest )und weiss nicht wie ich es machen soll.Könnte mir vielleicht jemand helfen?
public class ScoreBoard{
private int score = ???;
public ScoreBoard(){
}
public void increaseBy( int amount ){
score = ??? + ???;
}
public int getScore(){
return ???;
}
public boolean isSufficient( int maxScorePossible ){
if( ??? )
return true;
else
return false;
// wobei man auch direkt schreiben könnte:
// return ???;
}
public static void main( String[] args ){
ScoreBoard score = new ScoreBoard();
score.increaseBy( ??? );
score.increaseBy( ??? );
score.increaseBy( ??? );
score.increaseBy( ??? );
score.increaseBy( ??? );
if( score.isSufficient( ??? ))
System.out.println( ??? );
else
System.out.println( ??? );
}
}
public class ScoreBoard{
int score = 0;
public ScoreBoard(){
}
public void increaseBy( int amount ){
score = score + amount;
}
public int getScore(){
return score;
}
public boolean isSufficient( int maxScorePossible ){
if(score>=0.5*maxScorePossible)
return true;
else
return false;
// wobei man auch direkt schreiben könnte:
// return ???;
}
public static void main( String[] args ){
ScoreBoard score = new ScoreBoard();
score.increaseBy( 8);
score.increaseBy( 5);
score.increaseBy( 6);
score.increaseBy( 10);
score.increaseBy( 4);
int maxScorePossible = 42;
if( score.isSufficient( score>=0.5*maxScorePossible))
System.out.println( "reicht aus");
else
System.out.println("reicht nicht aus");
}
}
if( condition )
statement;
else
statement;