Starting from:
$30

$24

Comprehensive Lab #1 Solution

Lab description




In this lab you will create a Java file, ComprehensiveLab1.java and complete the outlined challenge below.







This comprehensive lab will enable you to apply, in a practical scenario, the topics we have introduced in the class so far: input/output, variables, conditionals and loops.







Challenge




You have been hired by CS 1301 and CS 1101 instruction team to create a program that calculates a student’s grade, called uGrade. uGrade will have a simple menu at the beginning:







1. Calculate 1101 Grades

2. Exit







Welcome to uGrade! Enter the menu option you want (1 or 2):







Option 1. Calculate 1101 Grades (Lab).




This option will allow a user to input the MAXIMUM points for each one of the grading categories as well as each one of the user’s current grades.







CS 1101 categories and their percentages are the following:

● 58% Lab assignments (including labs and comprehensive labs)

● 12% Homework

● 25% pop quizzes and in-lab assignments

● 5% Lab participation (includes on-time attendance, active participation in lab discussion, activities including teamwork, and completion of any quizzes for attendance and survey purposes)







In addition, each numerical grade for CS1301 and CS1101 should be mapped to a letter grade with the following rules:

A: 90-100% // In math notation this is from 90 inclusive to 100 inclusive: [90, 100] B: 80-89% // In math notation this is from 80 inclusive to 90 exclusive: [80, 90) C: 70-79% // In math notation this is from 70 inclusive to 80 exclusive: [70, 80) D: 60-69% // In math notation this is from 60 inclusive to 70 exclusive: [60, 70)

F: 0-59% // In math notation this is from 0 inclusive to 60 exclusive: [0, 60)







Option 2. Exit




This option will print:

Good bye, thank you for using uGrade!

Notes:

Each category may have different total points, e.g, 100, 10, etc. Your program will convert this to a percentage.




Testing example.




Assume Alice wants to calculate her current grades for CS1101.







Step 1. Alice will type “1” in the main menu.







Step 2. Alice will be prompted to input how many grades she has received so far for lab assignments.

Input the number of grades you have received for lab assignments:6

Alice inputs 6.







Step 3. Alice will be prompted to input the maximum grade of all the lab assignments.

Input the maximum grade of all the lab assignments: 600.

Alice will input 600.







Step 4. Alice will be prompted to input each one of her grades, 6 in this case:

Input Grade 1: 100

Input Grade 2: 75

Input Grade 3: 85

Input Grade 4: 90

Input Grade 5: 100

Input Grade 6: 50







Alice inputs 100,75,85,90,100,50.







Alice’s current score for this category is 500 out of 600, which corresponds to a percentage of 83.33%. Given that lab assignments are worth 58%, her current grade percentage for this category is: 48.33%.







Step 5. Alice will be prompted to input how many grades she has received so far for homework.

Input the number of grades you have received for homework:4.







Step 6. Alice will be prompted to input the maximum grade of all the homework.

Input the maximum grade of all the lab homework:4

Alice will input 4.







Input Grade 1: 1

Input Grade 2: 1

Input Grade 3: 0

Input Grade 4: 1







Alice inputs 1,1,0,1







Alice’s score for homework is 3 out of 4, which corresponds to a percentage of 75%. Given that homework are worth 12%, her current grade score for this category is: 9.

Alice’s current lab grade is 48.33+9=57.33, which corresponds to an F.







Step 7. Alice will be prompted to input how many grades she has received so far for pop quizzes and in-lab assignments.

Input the number of grades you have received for pop quizzes and in-lab assignments:3.







Step 8. Alice will be prompted to input the maximum grade of all the pop quizzes and in-lab assignments.

Input the maximum grade of all the pop quizzes and in-lab assignments:30

Alice will input 30.







Input Grade 1: 10

Input Grade 2: 9

Input Grade 3: 8







Alice inputs 10,9,8







Alice’s score for pop quizzes and in-lab assignments is 27 out of 30, which corresponds to a percentage of

90%. Given that pop quizzes and in-lab assignments are worth 25%, her current grade score for this category is: 22.5.







Alice’s current lab grade is 48.33+9 + 22.5=79.83, which corresponds to a C.







Step 9. Alice will be prompted to input how many grades she has received so far for lab participation.

Input the number of grades you have received for lab participation:5.







Step 10. Alice will be prompted to input the maximum grade of all the lab participation.

Input the maximum grade of all the lab participation:5

Alice will input 5.







Input Grade 1: 1

Input Grade 2: 1

Input Grade 3: 0

Input Grade 4: 0

Input Grade 5: 0







Alice inputs 1,1,0,0,0







Note: Participation is 0 if not participated and 1 if participated in this example.







Alice’s score for lab participation is 2 out of 5, which corresponds to a percentage of 40%. Given that lab participation are worth 5%, her current grade score for this category is: 2.







Alice’s current lab grade is 48.33+9 + 22.5 + 2=81.83, which corresponds to a B.







Step 11. uGrade will print:

Your current grade is 81.83 which corresponds to a B.

Alice will see the main menu again.







1. Calculate 1101 Grades

2. Exit







Welcome to uGrade! Enter the menu option you want (1 or 2):







Bonus:




Think about a bonus feature you could include that will allow you to practice using input/output operations, a sequence of steps, conditionals or loops. You should be able to explain your bonus feature.







Objective 1




Print your name and student ID to the screen, in the format:

YourLastName, YourFirstName, YourStudentID







Objective 2




Implement the above problem description.







Make sure you follow best practices when writing your code such as, creating variables with consistent names, adding documentation when needed and using proper indentation.




Run your program




Run your program and make sure that it’s working as expected, e.g., by entering the inputs you used in your tracing example, you will see the expected outcomes.







What do you have to turn in?




A Java file named ComprehensiveLab1.java inside a zip folder named LastNameFirstName-complab1.zip







Criteria for grading:




● 5 pts - complete objective 1

● 15 pts - Appropriate use of input/output operations (in Java)

● 20 pts - Appropriate use of conditional (i.e., if-then) statements (in Java)

● 20 pts - Appropriate use of iterations (i.e., for-loop, while-loop ) statements (in Java)

● 15 pts - Appropriate documentation (in Java)

● 10 pts - Appropriate notation and indentation (in Java)

● 15 pts - Program compiles, runs and contains the functionality required.

● 20 pts - Bonus feature







Tips




Start early.

Plan to work 3 to 5 additional hours outside the lab to complete this assignment and make sure your submission is on time.

Ask clarifying questions to the instruction team if something is not clear.

More products