Design a class named Business that contains: JavaDoc comments on the entire class definition only JavaDoc at the top of the class application only   A String attribute named name for the Business name A String attribute named symbol for the Business’s stock symbol A double attribute named lastPrice that stores the stock price one month ago A double attribute named currentPrice that stores the stock price for the current time A default constructor An overloaded constructor that creates a Business with a specified Business stock symbol and name An overloaded constructor with all attributes Accessors and mutators for each attribute A copy Constructor

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Part I - Design a class named Business that contains:

JavaDoc comments on the entire class definition only

JavaDoc at the top of the class application only

 

  • A String attribute named name for the Business name
  • A String attribute named symbol for the Business’s stock symbol
  • A double attribute named lastPrice that stores the stock price one month ago
  • A double attribute named currentPrice that stores the stock price for the current time
  • A default constructor
  • An overloaded constructor that creates a Business with a specified Business stock symbol and name
  • An overloaded constructor with all attributes
  • Accessors and mutators for each attribute
  • A copy Constructor   
  • An Equals Method   
  • A toString() method to display current state of the object, formatted!

Create a BusinessDriver application.

  • You will have at least 4 methods in this application
    • main() –
    • setBusinessData() - this reads the data from the file (call the file businessData.txt)
    • displayBusinessData() - this displays the data to the screen, calling the toString() method of all objects
    • sortData() - This will sort the data by choice either name of stock or current price
  • Create an arraylist of the 10 Business objects
  • Create a menu:
  • Options
  • 1 = List the objects in the arraylist
  • 2 = List just the Business names of the array list
  • 3 = List just the Business Name and current stock price
  • 4 = Exit
  • Read the data for the array from a file (see below)
  • Call each method as described above then list the menu and loop until the user exits.

BusinessData.txt (the data is set up like this: Business symbol, Business name, lastprice, current price - copy and paste this into a .txt file)

GPRO  
GoPro, Inc.
10.71
13.69
SBUX
Starbucks
59.53
58.46
JCP
JC Penney
7.73
10.78
AMZN
Amazon
531.07
576.32
AE
Adams Resources and Energy
34.96
33.77
KO
Coca-Cola
42.72
43.60
MCD
McDonald's
121.47
115.99
TSLA
Tesla Motors
173.48
187.90
AAPL
Apple Inc
96.35
100.67
FB
Facebook
112.69
108.93

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY