CMIS147 Introduction to Programing

ebote
Assignment3.pdf

Assignment 3

Before attempting this project, be sure you have completed all of the reading assignments, non-

graded exercises, discussions, and assignments to date.

Write a Java program to calculate a gamer's total XP score with a bonus per level. The program should:

(1) Prompt and read user’s input for the gamer's name, Level 1 XP (L1), Level 2 XP (L2), Level 3 XP (L3), and Engagement score (ES). User Scanner to read input.

(2) Each XP score input should be in whole numbers between 10-100 and in increments of 5. The total XP score with bonuses should be calculated as follows:

L1+L1*0.20+L2+L2*0.30+L3+L3*0.50+ES+ES*0.60

(3) Output the gamer's information and the total calculated XP score (including bonuses). (4) Prompt the user as to whether they want to calculate total XP for another gamer and repeat the input/output processing

(5) Allow user to exit the program without inputting gamer's data

Test program:

A minimum of 3 test cases should be supplied in the form of a table with columns indicating the

input values, expected output, actual output, and if the test case passed or failed. This table

should contain 4 columns with appropriate labels and a row for each test case. An example

template is shown below. Note that the actual output should be the actual results you receive

when running your program and applying the input for the test record.

The three minimum test cases should include:

(1) Run for one gamer's data (2) Run for another gamer's data (3) Start program but select to exit without inputting gamer's data

Make sure your Java program is using the recommended style such as:

• Javadoc comment upfront with your name as author, date, and brief purpose of the program

• Comments for variables and blocks of code to describe major functionality

• Meaningful variable names and prompts

• Identifiers are written in upper CamelCase

• Class name starts with upper case letter and variables in lower case letter

• Constants are written in All Capitals

• Use proper spacing and empty lines to make code human-readable

Capture execution:

You should capture and label screen captures associated with compiling your code and running

each of your 3 test cases.

Here are a couple of sample runs:

RUN1: Welcome to the Total XP calculation program!

Do you want to enter gamer's data? Yes/No => Yes Enter gamer's name => Mark Smith

Enter gamer's Level XP scores separated by space: L1 L2 L3 ES => 90 90 80 75

Gamer Name: Mark Smith L1=90 L2=90 L3=80 ES=75

Final XP score with bonuses=465

Do you want to enter another gamer's data? Yes/No => Yes Enter gamer's name => Sara Parker

Enter gamer's Level XP scores separated by space: L1 L2 L3 ES => 75 85 85 75

Gamer Name: Sara Parker L1=75 L2=85 L3=85 ES=75

Final XP score with bonuses=448

Do you want to enter another gamer's data? Yes/No => No

Thank you for using the Total XP calculation program!

RUN2:

Welcome to the Total XP calculation program!

Do you want to enter gamer's data? Yes/No => No

Thank you for using the Total XP calculation program!

Example test cases:

Input Expected Output Actual Output Pass?

Name=Mark Smith

L1=90 L2=90 L3=80 ES=75

Name=Sara Parker

L1=75 L2=85 L3=85 ES=75

Student Name: Mark Smith

Level 1=90

Level 2=90

Level 3=80

Engagement=75

Total XP + Bonus=465

Student Name: Sara Parker

Level 1=75

Level 2=85

Level 3=85

Engagement=75

Total XP + Bonus=448

Student Name: Mark Smith

Level 1=90

Level 2=90

Level 3=80

Engagement=75

Total XP + Bonus=465

Student Name: Sara Parker

Level 1=75

Level 2=85

Level 3=85

Engagement=75

Total XP + Bonus=448

Yes

Test Case 2

Test Case 3

Submission requirements

Deliverables include a Java program (.java) and a single Word (or PDF) document. The Java

and Word/PDF files should be named appropriately for the assignment (as indicated in the

Submission Requirements document.

The word (or PDF) document should include screen captures showing the successful compiling

and running of each of the test cases. Each screen capture should be properly labeled and

indicate what the screen capture represents. The test cases table should be included in your

Word or PDF document and properly labeled as well.

Submit your files to the Assignment 3 submission area no later than the due date listed in

your online classroom.

Grading Rubric:

The following grading rubric will be used to determine your grade:

Attribute Level (15-20 points)

Level (5-15 points)

Level 0 (0 - 5 points)

User input and loop Correct or one

incorrect

prompt and

captured input

and loop code

Two mistakes in

prompts and/or

capture of input

and/or loop

Three or more missing

essential elements for user

input and/or loop

Calculation Correct or one

mistake in

calculation

Two mistakes in

calculations

Three or more missing or

significantly incorrect

calculations

Application output Correct or one

mistake in

output

Two mistakes in

output data or

format

Three or more missing or

significantly incorrect

output

Test Cases Correct or one

incorrect test

case and/or test

execution

Two incorrect or

incomplete test

cases and/or test

execution

Three or more missing or

significantly incorrect or

incomplete test cases

Program

documentation and

style

Correct or one

missing

program

comment,

identifier,

and/or screen

capture

Two incorrect or

incomplete

documentation

and/or style

elements

Three or more missing or

significantly incorrect

documentation and/or style

elements