CS520 WEEK 2 ASSIGNMENT
GENERAL RULES FOR HOMEWORK ASSIGNMENTS
You are strongly encouraged to add comments throughout the program. Doing so will help your facilitator to understand your programming logic and grade you more accurately.
You must work on your assignments individually. You are not allowed to copy the answers from the others. However, you are encouraged to discuss approaches to the homework assignment with your section mates and the facilitator in your section via the discussion board.
Each assignment has a strict deadline. However, you are still allowed to submit your assignment within 2 days after the deadline with a penalty. 15% of the credit will be deducted unless you made previous arrangements with your facilitator and professor. Assignments submitted 2 days after the deadline will not be graded.
The assignment solution will be available 48 hours after the assignment deadline.
When the term lastName is referenced in an assignment, please replace it with your last name.
You are strongly encouraged to add comments into your program!
Create a new Java Project in Eclipse named HW2_lastName. Create a package named cs520.hw2 and complete the following three parts by writing the appropriate classes under this package.
Part 2 (30 Points)
The goal of this problem is to transform the procedural style computation of the previous problem into an object-oriented application. In order to do this, create two classes named P02_MartketValue and P03_MarketValueTest as specified below.
The class named P02_MartketValue describes each company and should have
§ The instance (or member) variables – name, stockPrice, and numberOfShares.
§ The appropriate set methods for the above three variables.
§ The appropriate get methods for the above three variables.
§ The method getMarketValue which returns the market value of this company.
§ The method printMarketValue which displays the name the market value of this company using a dialog box.
The class named P03_MarketValueTest creates two company objects and tests them as follows:
In the main method, instantiate two objects of the type P02_MartketValue named company1 and company2.
Perform the equivalent steps to the ones carried out in Part 1.
My tutorial contains Java Programs - Eclipse Project and Document.
If you have more questions, please contact me via email firstname.lastname@example.org
I will help you any time
Thank you !