Ask Java Expert


Home >> Java

Programming Assignment: Create class domains in NetBeans and test them

Problem Scenario: A local mutual fund company is in need of a Java programmer to assist them with some of their needs. Various fund managers in the office take care of multiple stocks in the manager's fund.

The company needs to be able to track information about their fund managers and their stock trades.

For each FundManager, the office needs to know: Broker's license number (Unique String - three letters followed by five digits)

• Broker's first name (String)

• Broker's last name (String)

• Broker's department number (String of digits and a dash, formatted as "###-###")

• Broker's commission rate (double representing a percentage)

The mutual fund company has had issues with incorrect license numbers and department numbers, so they are requesting a way to be able to determine if the they are correct.

For each StockTrade, the stock broker's office wants to track: Stock symbol (Unique 3 or 4-char string, all uppercased)

• Stock price per share (double)

• Stock number of shares (int) NOTE: Only whole shares can be traded for this program

• Broker's license number (to match license number in FundManager)

• Whether trade is taxable (boolean)

The mutual fund company has also had issues with incorrect stock symbols, prices, and number of shares, so they are requesting a way to be able to determine if the they are correct.

Program Requirements: The assignment this week is to create and test some of the classes for the problem scenario above. These classes will be used to implement data structures in later assignments.

The program must follow the CS310 Coding Standards from Content section 1.9.

To set up a project directory for your program:

o Create a new project in NetBeans, and name it CS310 + last name (e.g. CS310Smith).

o Use the default Main Class name provided by NetBeans (e.g. cs310smith.CS310Smith). This will cause NetBeans to create a package for your source code files.

o NetBeans will create the default folders for the project.

o NetBeans will create the main method within the main class (e.g. CS310Smith.java)

You will create two additional classes in the same CS310 folder as the CS310.java file (click on the CS310 folder before selecting New File).

The additional classes are:

• a FundManager class

• a StockTrade class

These classes will be used for creating and manipulating the FundManager and StockTrade objects, and will not contain a main method. All class attributes/properties/data fields will be encapsulated within the objects, and therefore will be defined as private.

After you create the FundManager and StockTrade classes, use the tips provided in the NetBeans reader to generate the following methods for both classes:

- constructors, getters, and setters

- equals() - must compare ALL attribute values

- toString() - must include ALL attribute values

The FundManager and StockTrade classes should include two constructors each:

- an empty constructor

- a constructor that accepts all of the attributes of the class as parameters

While NetBeans can help you create the basic methods, you will also need to add additional data error checking methods, as follows:

Error checking methods defined within the FundManager class:

• Check the broker's license

o contains 3 letters followed by 5 digits within the String.

• Check the department number

o 7 chars long and contains a dash and digits in the correct places, and all of the first three digits are 1, 2, or 3

Error checking methods defined within the StockTrade class:

• Check the stock symbol

o is 3 or 4 uppercased alphabetic characters long

• Check the stock price

o is not over $1000.00 per share

• Check the number of shares

o is not over 100,000

All of these error checking methods will simply check the proper attribute and return a true or false. Use appropriate method names that reflect the true case for the returned value.

Information related to above question is enclosed below:

Attachment:- CS310-ProgAssn1.rar

Java, Programming

  • Category:- Java
  • Reference No.:- M92658464
  • Price:- $70

Priced at Now at $70, Verified Solution

Have any Question?


Related Questions in Java

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Fundamentals of operating systems and java

Fundamentals of Operating Systems and Java Programming Purpose of the assessment (with ULO Mapping) This assignment assesses the following Unit Learning Outcomes; students should be able to demonstrate their achievements ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As