Bestlap – Eclipse 1 – WITH Emergo TASK 1: if the player often

advertisement

Bestlap – Eclipse 1 – WITH Emergo

TASK 1: if the player often crashes the car, a penalty must be applied to the

totalScore variable. Due to the penalty, its value might also be negative. The

GameScreen class already has a penalty attribute that you should use. Therefore,

totalScore should be changed to the following: totalScore = this.gc_computeLevelScore() – penalty; (line 1276)

Now, follow the steps below:

1.

AFTER changing totalScore, START THE TIME by clicking on .

2.

Execute Emergo for the totalScore variable.

3.

Identify if there are other parts in the code that need to be changed so that the system accepts properly negative scores. If so, change them.

4.

Do you think you finished the task? If yes, click on . A test case will execute to verify is you indeed accomplished the task. If so, (green screen), you finished the task. If the test fails, (red screen), you did not finish the task yet. Keep going until the green screen shows up.

TASK 2: Developers reported two unused variables:

tires, GameScreen class, line 1649; and

xP, GameMenu class, line 1056.

Now, indicate possible feature expressions to fix the unused variable problem:

1.

START THE TIME clicking on .

2.

Execute Emergo for the tires variable. After, use the rectangle below to write the feature expression to encompass tires and fix the problem.

#ifdef ( )

Image tires = null;

#endif

3.

Execute Emergo for the xP variable. After, use the rectangle below to write the feature expression to encompass xP and fix the problem.

#ifdef ( ) int xP = g.getClipWidth();

#endif

4.

Both rectangles are fulfilled? Then, click on .

5.

Type your ID and you are done.

Bestlap – Eclipse 2 – WITHOUT Emergo

TASK 1: if the player often crashes the car, a penalty must be applied to the

totalScore variable. Due to the penalty, its value might also be negative. The

GameScreen class already has a penalty attribute that you should use. Therefore,

totalScore should be changed to the following: totalScore = this.gc_computeLevelScore() – penalty; (line 1276)

Now, follow the steps below:

1.

AFTER changing totalScore, START THE TIME by clicking on .

2.

Identify if there are other parts in the code that need to be changed so that the system accepts properly negative scores. If so, change them.

3.

Do you think you finished the task? If yes, click on . A test case will execute to verify is you indeed accomplished the task. If so, (green screen), you finished the task. If the test fails, (red screen), you did not finish the task yet. Keep going until the green screen shows up.

TASK 2: Developers reported two unused variables:

tires, GameScreen class, line 1649; and

xP, GameMenu class, line 1056.

Now, indicate possible feature expressions to fix the unused variable problem:

1.

START THE TIME clicking on .

2.

Use the rectangle below to write the feature expression to encompass

tires and fix the problem.

#ifdef ( )

Image tires = null;

#endif

3.

Use the rectangle below to write the feature expression to encompass xP and fix the problem.

#ifdef ( ) int xP = g.getClipWidth();

#endif

4.

Both rectangles are fulfilled? Then, click on .

5.

Type your ID and you are done.

MobileMedia – Eclipse 3 – WITH Emergo

TASK 1: The MobileMedia image webserver provides only PNG (non-vector) and

EPS (vector) images. Change the server variable value for the following one: http://another/server/ . This new server provides not only PNG and EPS, but a new format: PDF. So, server must be exactly like this:

String server = “http://another/server/”; (line 73)

Now, follow the steps below:

1.

AFTER changing server, START THE TIME by clicking on .

2.

Execute Emergo for the server variable.

3.

Identify if there are other parts in the code that need to be changed so that the system works properly with this new server. If so, change them.

4.

Do you think you finished the task? If yes, click on . A test case will execute to verify is you indeed accomplished the task. If so, (green screen), you finished the task. If the test fails, (red screen), you did not finish the task yet. Keep going until the green screen shows up.

TASK 2: Developers reported two unused variables:

numberOfViews, MediaUtil class, line 93; and

albumMusic, MainUIMidlet class, line 90.

Now, indicate possible feature expressions to fix the unused variable problem:

1.

START THE TIME by clicking on .

2.

Execute Emergo for the numberOfViews variable. After, use the rectangle below to write the feature expression to encompass numberOfViews and fix the problem.

#ifdef ( ) int numberOfViews = 0;

#endif

3.

Execute Emergo for the albumMusic variable. After, use the rectangle below to write the feature expression to encompass albumMusic and fix the problem.

#ifdef ( )

AlbumListScreen albumMusic = new AlbumListScreen();

#endif

4.

Both rectangles are fulfilled? Then, click on .

5.

Type your ID and you are done.

MobileMedia – Eclipse 4 – WITHOUT Emergo

TASK 1: The MobileMedia image webserver provides only PNG (non-vector) and

EPS (vector) images. Change the server variable value for the following one: http://another/server/ . This new server provides not only PNG and EPS, but a new format: PDF. So, server must be exactly like this:

String server = “http://another/server/”; (line 73)

Now, follow the steps below:

1.

AFTER changing server, START THE TIME by clicking on .

2.

Identify if there are other parts in the code that need to be changed so that the system works properly with this new server. If so, change them.

3.

Do you think you finished the task? If yes, click on . A test case will execute to verify is you indeed accomplished the task. If so, (green screen), you finished the task. If the test fails, (red screen), you did not finish the task yet. Keep going until the green screen shows up.

TASK 2: Developers reported two unused variables:

numberOfViews, MediaUtil class, line 93; and

albumMusic, MainUIMidlet class, line 90.

Now, indicate possible feature expressions to fix the unused variable problem:

1.

START THE TIME by clicking on .

2.

Use the rectangle below to write the feature expression to encompass

numberOfViews and fix the problem.

#ifdef ( ) int numberOfViews = 0;

#endif

3.

Use the rectangle below to write the feature expression to encompass

albumMusic and fix the problem.

#ifdef ( )

AlbumListScreen albumMusic = new AlbumListScreen();

#endif

4.

Both rectangles are fulfilled? Then, click on .

5.

Type your ID and you are done.

Download