Design a class named StockTransaction that holds a stock symbol (typically one to four characters), stock name, number of shares bought or sold, and price per share. Include methods to set and get the values for each data field. Create the class diagram and write the pseudocode that defines the class.
Design a class named FeeBearingStockTransaction that descends from StockTransaction and includes fields that hold the commission rate charged for the transaction and the dollar amount of the fee. The FeeBearingStockTransaction class contains a method that sets the commission rate and computes the fee by multiplying the rate by transaction price, which is the number of shares times the price per share. The class also contains get methods for each field.
Create the appropriate class diagram for the FeeBearingStockTransaction class and write the pseudocode that defines the class and the methods.
Design an application that instantiates a FeeBearingStockTransaction object and demonstrates the functionality for all its methods.

Answers

Answer 1

The class diagram and pseudocode for the StockTransaction class is given below

What is the class?

plaintext

Class: StockTransaction

-----------------------

- symbol: string

- name: string

- shares: int

- pricePerShare: float

+ setSymbol(symbol: string)

+ getSymbol(): string

+ setName(name: string)

+ getName(): string

+ setShares(shares: int)

+ getShares(): int

+ setPricePerShare(price: float)

+ getPricePerShare(): float

Pseudocode for the StockTransaction class:

plaintext

Class StockTransaction

   Private symbol as String

   Private name as String

   Private shares as Integer

   Private pricePerShare as Float

   Method setSymbol(symbol: String)

       Set this.symbol to symbol

   Method getSymbol(): String

       Return this.symbol

   Method setName(name: String)

       Set this.name to name

   Method getName(): String

       Return this.name

   Method setShares(shares: Integer)

       Set this.shares to shares

   Method getShares(): Integer

       Return this.shares

   Method setPricePerShare(price: Float)

       Set this.pricePerShare to price

   Method getPricePerShare(): Float

       Return this.pricePerShare

End Class

Read more about StockTransaction  here:

https://brainly.com/question/33049560

#SPJ1


Related Questions

In Java Please

4.24 LAB: Print string in reverse
Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters "Done", "done", or "d" for the line of text.

Ex: If the input is:

Hello there
Hey
done
the output is:

ereht olleH
yeH

Answers

The program that takes in a line of text as input, and outputs that line of text in reverse is given

The Program

import java.util.Scanner;

public class ReverseString {

  public static void main(String[] args) {

       Scanner input = new Scanner(System.in);

       String line;

       do {

           line = input.nextLine();

           if (!line.equalsIgnoreCase("done") && !line.equalsIgnoreCase("d")) {

               String reversed = reverseString(line);

              System.out.println(reversed);

           }

       } while (!line.equalsIgnoreCase("done") && !line.equalsIgnoreCase("d"));

   }

  public static String reverseString(String text) {

       StringBuilder reversedText = new StringBuilder();

       for (int i = text.length() - 1; i >= 0; i--) {

           reversedText.append(text.charAt(i));

       }

       return reversedText.toString();

   }

}


Read more about programs here:

https://brainly.com/question/30783869

#SPJ1

For this lab activity, the HousingCrunch activity in part 1 will be modified to load housing data from a CSV file instead of having the options manually added to the houseList (also known has hardcoded values). In addition to prompting the user for name and a seed value, the program should also prompt for the filename containing the housing data. The data file will contain more data fields than will be used in this application as we are only interested in the housing data stored in the 1st field of each row. The screenshot below shows a spreadsheet view of the provided CSV data with the first field of each row outlined in red.

MASH Database Spreadsheet

It will be extremely helpful to review the CSVParser Deeper Look Video and Guided Experimentation examples before starting on this activity.

NOTE: In Computer Science we teach students to begin counting at zero because zero is the first index value of arrays, strings and many other programming related things. When working with data from muggles (non-programmer folk), the first data element is often referred to as record 1 or row 1 or column A or field 1. Just open a spreadsheet and look at the column and row identifiers. As programmers it is our responsibility to be aware of this difference and make certain our programs behave correctly.

Expected Program Output (with sample user input)
Please enter your name: Luke
Please enter a seed value: 123
Please enter the filename: MASHDatabase.csv

Hello Luke,
You should buy a shack.

Answers

To modify the HousingCrunch program, prompt the user for their name, a seed value, and the filename containing the housing data in CSV format.

How  is this so?

Load the housing data from the CSV file, extracting only the first field of each row.

Use the user's name, seed value, and the housing data to determine their recommended house option.

Finally, print the personalized recommendation to the console.

Note that CSV format, short for Comma-Separated Values format, is a plain text file format used to store tabular data.

Learn more about program at:

https://brainly.com/question/30783869

#SPJ1

Other Questions
In the process of starting a car, which step happens first? If we accept moral or cultural relativism, would it make sense to talk abcmoral progress? Why? What would be the basis for understanding moralrogress? 1. Which of the items below is NOT one of the 5 competitive forces that shape strategy, according to Porter? Group of answer choices Bargaining power of suppliers Threat of new entrants Rivalry among existing competitors Consumers unmet needs2. Which of the following statements below is correct when conducting a competitor analysis? Group of answer choices Start with size, growth, and profitability. The only component that truly impacts competitor actions is their cost structure. Organization and culture are not a relevant component of a competitor analysis. Only conduct a SWOT analysis. a nurse is planning care for a client following a gastric bypass surgery. the nurse should include which of the following dietary instructions when preparing the client for discharge The male reproductive system consists of three columns of erectile tissue. Which of the following descriptions of this organ is correct?Group of answer choicesa A dorsally located corpus spongiosum (which contains the penile urethra) and two ventrally located corpora cavernosab A dorsally located corpus cavernosum (which contains the penile urethra) and two ventrally located corpora spongiosac Two dorsally located corpora cavernosa and a ventrally located corpus spongiosum (which contains the penile urethra)d Two dorsally located corpora spongiosa and a ventrally located corpus cavernosum (which contains the penile urethra) Who rules the first house? Type the program's output Input target =1 int ( input ()) n=1nt (1nput ()) while n Show if 139 and 450 are equivalent under modulus 7 or not. hat is a short hedge using futures? When is it appropriate?b) Assume that the risk-free rate is 2% per annum (continuous compounding) for all maturities. Compute the six-month forward prices of the following assets:i) A stock index that provides a continuous dividend yield of 7% per annum. The current spot price of the index is $1840.ii) A share that will distribute a $2 dividend in 2 months. The current spot price of the share is $23.c) What is a lower bound for the price of a three-month European put option on a non-dividend-paying stock when the stock price is $340, the strike price is $385, and the risk-free rate is 10% per annum?d) Describe the marking-to-market process for futures contracts.e) Can futures prices become negative? Is your answer the same for all types of underlying assets? Try to support your answer using academic theory and empirical examples. Use the following sample of numbers for the next 4 questions: a. What is the range? (1 point) b. What is the inter-quartile range? (2 points) c. What is the variance for the sample? (3 points) Show Your Work! d. What is the standard deviation for the sample? (1 point)x355610 Algebraically write the interest rate parity condition (approximation) using the following notation:i = the interest rate in the home countryi* = the interest rate in the foreign countryR = the current spot exchange rate (remember that the exchange rate is the price in home currency of a unit of foreign currency)F = the forward exchange rateExplain, in words, the logic of the condition -- the relationship between interest rate difference and spot and future exchange rates.Suppose that U.S. interest rates are 4 percent more than rates in the EU (HINT: treat the US as if it were the home country). Would you expect the dollar to appreciate or depreciate against the euro, and by how much? Brand loyalty is a favorable attitude toward and consistent purchase of a single brand over time. on january 1, 2024, wendall company purchases new equipment for $649,000. wendall is required to make a down payment of $135,000 and issue an installment note for the remaining balance of $514,000. the note requires payments of $70,166.04 every three months, beginning march 31, 2024, over the next two years. the interest rate on the note is 8% annually (or 2% every three months). required: 1. record the purchase of equipment with down payment of $135,000 and the installment note of $514,000 on january 1, 2024. 2. record the first payment of $70,166.04 on march 31, 2024. Consider the following scenario:A Global ProTech employee contacts you, her HR professional, because she has a concern about her department manager, who she describes as rude and unappreciative. In addition, the employee expresses that she believes the manager has taken credit for her work on a project. She adds that her managers emails are often impersonal, harsh, and curt. She is frustrated and does not know what to do to improve the working relationship with her manager. You also meet with the manager to review the managers actions leading up to the meeting, along with the interactions between the manager and the employee. Then, you schedule a meeting with the employee and the manager to assist with managing this conflict situation. You realize that, before the meeting, you need to take time to reflect on and plan the meeting agenda and what you will do.To complete this Assignment, take time to consider what you have learned from preparing and/or participating in the Simulation experience. Also, review the Learning Resources and research other quality resources, in order to respond to the following key points in a 3- to 5-page academic paper.Identify at least 2 of the key issues you want to make sure are addressed at the meeting and your goals for the meeting.Identify the steps you will take during the meeting to manage this conflict situation.Explain how you intend to demonstrate active listening, and other communication skills, throughout the meeting.Explain at least 3 conflict management skills that you, as an HR professional, need to effectively handle this situation and why you chose these strategies for this situation.Explain at least 3 conflict management strategies you plan to use to address this scenario and why you chose these strategies.Explain your goals for moving forward, in including what the employee and manager will need to do before having a follow-up meeting with you. Answer the below questions through any tool and create a dashboard for question 3. Share all the responses for question 1 and 2 in Word or summary report.QuestionsWhat related metrics are most associated with a countrys happiness index? (i.e. GDP, Generosity)Highlight 2-3 trends you are seeing in the data. Summarize your findings and the impact of these trends.Visualize the data in a Tableau / Einstein dashboard for an audience of leaders who are trying to improve the happiness of their population. Part B Repeat Part A for the situation where Mari's lemonade stand makes a profit (meaning she has enough money to pay for her startup costs and has some money left over ). Draw your number line on a separate sheet of paper. What is quantitative easing? It is an example of contractionary monetary policy where the central bank sells longer-term assets that are not normally sold to commercial banks. It is an example of expansionary monetary policy where the central bank sells longer-term assets that are not normally sold to commercial banks. It is an example of expansionary monetary policy where the central bank purchases longer-term assets that are not normally purchased from commercial banks. It is an example of contractionary monetary policy where the central bank purchases longer-term assets that are not normally purchased from commercial banks. If the fdic has a $59.5 billion insurance fund and must use 5.6% of it to cover several failed banks, approximately how much money is left in the fund? a. $56.17 billion b. $62.83 billion c. $66.16 billion d. $3,332 million please select the best answer from the choices provided a b c d What type of estimation that surrounds the point estimate with a margin of error to create a rang of values that seek to capture the parameter?A. Inter-quartile estimationB. Quartile estimationC. Intermediate estimationD. None of the above You have a network connected using a physical bus topology. One of the cables that connects a workstation to the bus breaks.Which of the following best describes what effect this will have on network communications?A) Devices on one side of the break will be able to communicate with each other; deviceson the other side of the break will be able to communicate with each other.B) All devices except the device connected with the drop cable will be able tocommunicate.C) All devices will be able to communicate.D) Devices on one side of the break will be able to communicate with each other; deviceson the other side will not be able to communicate.E)No devices will be able to communicate.