 |
CS 139
Algorithm Development
PA1: Class Average
Part
A Due in Canvas by Tuesday Feb 3 at 11:59PM
Part B Due in WebCAT by
Tuesday, Feb 10 at 11:59 PM
Late assignments will be accepted in accordance with the following penalties:
- -10% on Wednesday Feb 11
- -20% on Thursday Feb 12
- -30% on Friday Feb 13
- -40% on Sunday Feb 15
- -50% on Monday Feb 16
- Not accepted afterwards
Part C due in Canvas by
Wednesday Feb 11 or one day after you have successfully submitted to
WebCAT.
|
UPDATES:
- 02/04/2015 - Corrected the example to be consistent between input and output.
- 02/10/2015 - Corrected a description of the labels to be consistent with the examples (change right justified to left...see red correction)
Objectives - At the conclusion of this assignment students will
have demonstrated that they can:
- Input data from a keyboard.
- Use Java math operations.
- Properly format output to specification.
- Do everything necessary to create, debug, and run a java
program.
- Use comments to delineate each section of the program.
- Adhere to a Java Style Guide.
- READ AND FOLLOW DIRECTIONS!!!!!
Background
Students are frequently graded on the basis of "weighted" averages. Weighted averages value different kinds of work differently based on the syllabus requirements. For example, in this class, labs are worth 10% of the overall grade, while PAs are worth 20%. In this application you will prompt the user for the 6 grades in this class and then will produce a weighted average for the course. This application would let you try "what if" scenarios for your final grade in this class.
Requirements
PART A - Graded as a homework assignment. There
will be a separate Canvas Assignment for this.
You will provide 3 examples of different values that will be used
for your testing. These examples should include the 7 grading categories for the course and the final weighted class average. You must finish PART A before you can get help
with PART B as you should always think through a problem before you
attempt to solve it.
PART B - Submitted to webcat. WebCAT will be made available no later than Sunday morning February 8.
You will write a single Java program, GradeCalculator, that must:
- Prompt for each of the grade values and read in the corresponding value.
- Prompt for the name of the class and the name of the student.
- Calculate the weighted average for the class. Weights are:
- Homework - 10%
- Labs - 10%
- Weekly quiz - 10%
- PAs - 20%
- Midterm 1 10%
- Midterm 2 15%
- Final Exam 25%
- Display the class, student name, grade values (with appropriate labels), and calculated average.
- All output labels (for categories and final average) will be right justified in a field that is 12 wide.
- All number amounts will be displayed in a field that is 6 wide with two decimal places.
A complete dialog as it would appear at the command line would look like this. (with input values highlighted in red would look
like)
Homework grade? 75.50
Lab grade? 82.5
Weekly quiz grade? 100
PA grade? 86.45
Midterm 1 grade? 95.5
Midterm 2 grade? 80.6
Final exam grade? 92.15
Class name? Programming Fundamentals
Student name? Nancy Harris
<blank>
Programming Fundamentals
Nancy Harris
<blank>
HW: 75.50
Lab: 82.50
WQ: 100.00
PAs: 86.45
Midterm 1: 95.50
Midterm 2: 80.60
Final exam: 92.15
-------------------
Final grade: 87.77
Output specifications
Prompts
- Each input prompt must use a print statement. There should be no new line character at the end of the prompt. Notice how the input is placed directly beside the corresponding prompt.
- You must use the exact verbiage as shown in the sample dialog.
- The prompts must be in the order shown.
- Each prompt ends with a question mark (?) and a single space.
Results
- Each line of result output should terminate with the new line character.
- Each line should use teh exact verbiage as found in the sample dialog.
- The first line of result output should be a blank line.
- The next line should print the name of the course.
- The next line should print the name of the student.
- There should be a blank line next.
- For each of the category lines, you will print the label including the colon in a line that is 12 characters wide. Each of the colons should line up. There should next be a single blank space. The grade should print in a field that is 6 wide, but if there is no hundreds number, the first character would be blank as shown. Each grade should include exactly 2 decimal places and the result should be rounded.
- After printing the Final Exam grade, display a line of hyphens as a separator.
- Output the calculated Final grade. This should be the weighted average of all of the grades.
NOTES:
- Since the weights mean something they should be constants.
- For this and every other PA, you should only create 1 Scanner object. Multiple Scanner instantiations (new Scanner...) will cause WebCAT to fail.
- Your program should use appropriate data types for the values being
input and calculated, and appropriate and meaningful names for all
variables and constants.
- The program source must follow all StyleGuide
conventions used in this class.
Part B Deliverables
- You should submit, GradeCalculator.java to via
Web-CAT (http://webcat.cs.jmu.edu).
- Your program will be judged on correctness (80%) and conformance
to the StyleGuide
(20%). Your program must pass all submission tests to be graded. The checkoff chart is found here.
Part C Reflection - graded as
a regular homework assignment. There will be separate Canvas Assignments
for this.
You will write a reflection document for this assignment which will
let you consider the process of building this program. It will also
contain a place to critique this assignment for this class.
Honor Code
This is an individual programming assignment. This assignment should
be viewed as a take home exam. Your work on the assignment and your
submission must conform to the JMU Honor Code.
Authorized help is limited to the classroom handouts, lab material, the
TAs for any CS139, our graduate student and the professor. Copying work
from another student or the Internet is an
honor code violation, which will result in a zero on the assignment and
possibly further sanctions. You may use the internet to search for help, but each site that you use hould be acknowledged in the Reference section of the code documentation.
Your work on this assignment is subject to
review by MOSS
which is a plagiarism detection tool for programs. Submission to WebCAT
constitutes your submission of work for academic credit and your
agreement that your work may be submitted to MOSS.