Design a class named stocktransaction that holds a stock

Assignment Help Computer Engineering
Reference no: EM133561432

Question 1:

1) Design a class named StockTransaction that holds a stock symbol (typically one to four characters), stock name, 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.

2) Design an application that declares two StockTransaction objects and sets and displays their values.

3} Design an application that declares an array of 10 StockTransactionobjects. Prompt the user for data for each object, and then display all the values.

4) Design an application that declares an array of 10 StockTransactionobjects. Prompt the user for data for each object, and then pass the array to a method that determines and displays the two stocks with the highest and lowest price per share.

Question 2:

1) Design a class named PhoneCall with four fields: two strings that hold the 10-digit phone numbers that originated and received the call, and two numeric fields that hold the length of the call in minutes and the cost of the call. Include a constructor that sets the phone numbers to Xs and the numeric fields to 0. Include get and set methods for the phone number and call length fields, but do not include a set method for the cost field. When the call length is set, calculate the cost of the call at three cents per minute for the first 10 minutes, and two cents per subsequent minute. Create the class diagram and write the pseudocode that defines the class.

2) Design an application that declares three PhoneCalls. Set the length of one PhoneCall to 10 minutes, another to 11 minutes, and allow the third object to use the default value supplied by the constructor. Then, display each PhoneCall's values.

3) Create a child class named InternationalPhoneCall that inherits from PhoneCall. Override the parent class method that sets the call length to calculate the cost of the call at 40 cents per minute.

4) Create the logic for an application that instantiates a PhoneCall object and an InternationalPhoneCall object and display the costs for each.

Reference no: EM133561432

Questions Cloud

Write 2 use cases for the egrants project : Write 2 use cases for the eGrants project. You may use the requirements written in the simple sentence format for the eGrants project developed in a previous
What is a vpn how does a vpn work how secure is a vpn : What is a VPN? How Does a VPN Work? How Secure is a VPN? Is it Legal to Use a VPN? What are VPN Logging Policies? Which is better, a free VPN or a subscription
Explain the major components of the project resource plan : Explain the major components of the project resource plan and the importance of selecting the right resources for the project. Please find an additional source
Healthcare industry not developed data clearinghouses : Why has the healthcare industry not developed data clearinghouses and nationwide sources of market data, as other industries have?
Design a class named stocktransaction that holds a stock : Design a class named StockTransaction that holds a stock symbol (typically one to four characters), stock name, and price per share. Include methods to set
Effectiveness of activity in promoting mental health : Evaluate the effectiveness of this activity in promoting mental health and wellbeing for nurses and/or midwives and prevents/addresses workplace burnout.
What are the different language centers in the brain : What are the different language centers in the brain? What are the different types of language disorders?
List the thunderstorm components or associated clouds that : List the thunderstorm components or associated clouds that you would see, in the order that you would see or experience them.
Explain the functions of the respiratory system : Explain the functions of the respiratory system. Explain functions of nose and nasal cavity. How are gases transported to tissues?What helps to clean alveoli.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Determine the value of a number in an ieee

Write a C program that will determine the value of a number in an IEEE-like floating point format and create this directory inside the original directory that you created for Part 1. Copy all of the files from Part 1 into this directory.

  Determine the current gain of the circuit

Determine the current gain (13) of the circuit in Figure 5.6(a) if R1, = 8 KO and /lc = 500 fl.

  Can the banker algorithm grant the request immediately

If a request from process P1 arrives for additional resources of (0,5,2), can the Banker's algorithm grant the request immediately? Show the system state.

  What is bootstrap and what is responsive web design

CSET3200 Assignment - Web Services- HTML& CSS. What is Bootstrap? What is Responsive Web Design? Why Use Bootstrap? Where to Get Bootstrap

  Write assembly language programs to input the switch

Assume that two PIC18F4321s are interfaced in the SPI mode. A switch is connected to bit 0 of PORTD of the master PIC18F4321 and, an LED is connected to bit 5.

  What are the advantages of the bus sizing mechanism

What is the difference between the way in which the 68000 and the 68020 use the function code outputs?

  What are the business practices of this organization

Access Alliance Multicultural health and Community Service What are the business practices of this organization? (HR, Finance, Leadership, Ethics, Budget

  Design a variation of binary search for performing operation

Design a variation of binary search for performing operation find All(k) in a dictionary implemented with an ordered search table.

  What are important considerations for an organization

Different types of storage devices are optimal for different situations. Explain what situations are appropriate for the following devices and explain.

  Process of preparing your dataset for analysis

process of preparing your dataset for analysis, you will often need to define PK and FK. One such situation occurs when working with state and county data

  Describe the processes used in taking an order

Think about a recent order you made (pizza, book, clothes, shoes, etc) online or over the phone. Describe the processes used in taking an order.

  What is the power density away from a directive antenna

What is the power density (in Watts) 30 km away from a directive antenna that has a transmitted power of 38 dBm and a directive antenna gain of 24 dB?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd