Question: CSCI 1 3 0 2 Programming Principles II Georgia Southern University Department of Computer Science Fall 2 0 2 4 Lab 2 Point Value: 2
CSCI Programming Principles II
Georgia Southern University
Department of Computer Science
Fall
Lab
Point Value: points
Due: Friday August end of lab
Objectives
Update an existing class to use OO principles.
Pass and return objects tofrom methods.
Use debugging techniques to debug and correct code.
Use the IDEs builtin debugger to debug and correct code.
Archive Java source code files and other documents into a zip file.
Description
Complete the following steps as described and upload requested materials to Folio in the
appropriate Dropbox in a single zip file. Also upload the requested materials to the appropriate
section of Gradescope.
Students should work in groups of two for this lab. When submitting your zip file, fill out
the comment header and indicate both group member names.
Your submitted zip file should be named Lab#LastNameLastNamezip. For
instance, LabJonesSmith. Any requested screenshots andor answers to questions
should be included in a separate Word document.
All programs should have a comment header. That comment header should include
information similar to:
File: PAssignjava
Class: CSCI
Author: Christopher Williams
Created on: Jun
Last Modified: Aug
Description: Display three messages to the console
Before writing any code, for each problem, discuss with your partner how you plan to
approach solving the given problem. Once you both agree on a way to attempt the
problem, only then should code be written.
Pay attention to names and any other requested material. Failure to include material will
result in the loss of points as described below.
Lab Problems
For all problems, use inline comments to describe major actions. Ask for assistance if needed.
NOTE: For this lab, you will be modifying the WaterBottle class and test program provided
in Folio. Look for the TODO comments and delete each comment when you complete it
These show up in Eclipse in the Tasks tab: Windows Show View Tasks.
Objects and Classes Visibility Using your WaterBottle class and make the
following updates:
Additional Requirements
Update all instance members, constructors, and methods so they have the correct,
recommended visibilities according to OOP convention.
Add accessor get and mutator set methods for all data members.
All data members should have a value greater than
If a client tries to set a value of or below, set the data member to the
default values of height and radius. These values should be
checked in the appropriate mutator only and all methods should have the
correct visibility.
Update all constructors so they use the newly built mutator methods.
Once your class is complete:
Update your test program WaterBottleTestjava to test all additions to the class. It
may be helpful to create an array of WaterBottles to gain practice using those items.
Verify that all values are being set correctly by printing them to the Console or using the
debugger to test the additional items. Make sure to test any values that contain a
defined range by attempting to update that value incorrectly.
You do not need to include WaterBottleTest.java when submitting to Gradescope as
it will create its own WaterBottle instances and test all required components.
After instructorTA checkoff, BOTH students should submit a final, identical version to
Gradescope. This version is used for your final grade.
Objects and Classes Static Items Using your WaterBottle class from Problem and
make the following updates:
Additional Requirements
Add a static data member named largestInitialVolume with the appropriate data
type and visibility.
Add an accessor for the largestInitialVolume data member with the correct visibility,
modifiers, return type, name, and parameter list. This method should return the value
of the largestInitialVolume by accessing it in a static context.
Add a public method named checkInitialVolume that determines if a WaterBottle has a
larger volume than the largestInitialVolumes current value. If so update the
largestInitialVolume by accessing it in a static context. Provide the appropriate visibility,
return type, and parameter list for this method.
Update your class so that the checkInitialVolume method is called upon WaterBottle
creation and appropriately sets the static members value. Double check that the
correct value is populated no matter which constructor is used.
Once your class is complete:
Update your test program WaterBottleTestjava to test all additions to the class.
Verify that all values are being set correctly by printing them to the Console or using the
debugger to test the additional items.
You do not need to include WaterBottleTest.java when submitting to Gradescope as
the autograder will create its own instances and test all required com
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
