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 1 (30 Points)
Suppose a company’s total market value is equal to its “stock price per share” multiplied by “the total number of shares in the market.” Create a “procedural style” program that meets the requirements below. Create a class namedP01_MarketValueProceduralStyle and test the market values of two companies as specified below.
Prompt the user to enter the following values for the first company one by one through a dialog box.
The name of the first company
the share price of the first company (double type)
the number of shares of first company (integer type)
Now, prompt the user to enter the following values for the second company one by one through a dialog box.
The name of the second company
the share price of the second company (double type)
the number of shares of second company (integer type)
Compute the market value of the first company and store it into an appropriate variable type.
Display the first company’s name and its market value using a dialog box.
Compute the market value of the second company and store it into an appropriate variable type.
Display the second company’s name and its market value using a dialog box.
Using the if-else construct, check which company’s market value is greater than the other and display the information and the difference using a dialog box. Also, check if the market values are the same as part of this comparison.
Test the program with all the three scenarios possible in the above step.
My tutorial contains Java Programs - Eclipse Project and Document.
If you have more questions, please contact me via email email@example.com
I will help you any time
Thank you !