a. Add a nested class to Stock named Company. Company contains the following fields: (i) name, (ii) city, (iii) state, (iv) number of employees and (v) founded year. b. Add a default and fully parameterized constructor to Company. c. Add a method to Company named determineStatus. If the price of the stock associated with the Company object is more than 200, a message shoud be printed to the screen with the name of the company and the label High. If the price of the stock associated with the Company is between 100 and 200, a message shoud be printed to the screen with the name of the company and the label Medium. If the price of the stock associated with the Company object is less than 100, a message shoud be printed to the screen with the name of the company and the label Low. d. In the StockTester class, create an additional Stock object named stockedwCompany using the default constructor. Using this object, create a Company object named newCompany with name: Big Company, city: Rogers, state: Arkansas, number of employees: 20 and founded year: 2010. Print out the information associated with newCompany to the screen.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter3: Using Methods, Classes, And Objects
Section: Chapter Questions
Problem 13PE
icon
Related questions
Question

a. Add a nested class to Stock named Company. Company contains the following fields: (i) name, (ii) city,
(iii) state, (iv) number of employees and (v) founded year.
b. Add a default and fully parameterized constructor to Company.
c. Add a method to Company named determineStatus. If the price of the stock associated with the
Company object is more than 200, a message shoud be printed to the screen with the name of the
company and the label High. If the price of the stock associated with the Company is between 100 and
200, a message shoud be printed to the screen with the name of the company and the label Medium. If
the price of the stock associated with the Company object is less than 100, a message shoud be printed
to the screen with the name of the company and the label Low.
d. In the StockTester class, create an additional Stock object named stockedwCompany using the default
constructor. Using this object, create a Company object named newCompany with name: Big Company,
city: Rogers, state: Arkansas, number of employees: 20 and founded year: 2010. Print out the
information associated with newCompany to the screen.

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
void method
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT