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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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