Define the inheritance and polymorphism

Assignment Help C/C++ Programming
Reference no: EM13867304

Now that your ordering system is constructed in a truly object-oriented manner, you can take advantage of this organization. Consider another product that is similar to your existing product but that has one property or attribute that is somewhat different. As a concrete example, assume that your product has a size property and that the valid values for size are large, medium, and small. A slightly different product might use size values 10", 15", 20", and 25". These two products would have names: a string. However, the value in the name field would be different for these two different kinds of products. In particular, one is an int and the other is a string.

Complete the following:

Create a base class (also called a superclass) that contains all of the properties that are common to both of these products. Create 2 derived classes (also called subclasses) that contain different kinds of sizes. If your product does not already have a name property, you will need to add one along with appropriate get- and set-methods.

Modify your program so that at an appropriate point in the ordering process, the program requests the name or kind of product. At that point, the correct kind of product class needs to be instantiated. Polymorphism should ensure that the correct kind of size information or method is used.

Modify your program so that it requests 3 products. Create an array of products and save all of the product instances in this array. You might want to think about how an indefinite number of product orders might be handled. However, do not implement this extension for this course.

You will need to change how you handle file output or input. Instead of creating or writing a new file for each product, you need to create an empty file when the program starts. Each new product should then be added to the file. You no longer need to create the confirmation dialog based on data that are read back in after each individual product is ordered. Instead, you will confirm the entire 3-product order after all 3 product orders have been completed. This can be done by reading the order file and displaying or confirming

the product orders one after another.

You must revisit your UML diagrams one last time and revise them to represent the final online ordering system in structural diagrams (the class diagrams) and in a behavioral diagram (the use case diagram).

The Phase 5 Individual Project deliverables are as follows:

Save the final program code that you just developed and ran successfully in a .zip file that includes all of your Java project files.

Update the Key Assignment design document title page with a new date and project name.

Update your previously completed work based on your instructor's feedback.

Perform a screen capture of each of the ordering system dialogs that are displayed during execution just after you have entered the requested information. Place these screen captures in Week 5: Inheritance and Polymorphism.

Review and revise your class diagrams and use case diagrams where appropriate to include the new program organization and structure.

Be sure to update your table of contents before submission.

Reference no: EM13867304

Questions Cloud

Determine the hardness of water : The hardness of 10,000 litres of hard water sample was completely removed by passing it through a zeolite softner. The zeolite softner required 5000 litres of NaCl solution containing 1170 mg of NaCl/litre. Determine the hardness of water?
Describe the types of activities accounted : List the three categories of funds used in governmental accounting, and describe the types of activities accounted for in each category.
What do you recommend based on the expected monetary value : What do you recommend, based on the Expected Monetary value of each option? Why is that?
Understand common configurations for controlled : All Questions need to be answeredTASK 1:  Understand common configurations for controlled and uncontrolled rectification
Define the inheritance and polymorphism : Inheritance and Polymorphism
What was opcs total payroll cost for january : What was OPCs total payroll cost for January? Will the carrying value of the bond increase or decrease after recording interest in February? What is the interest payment OPC will need to pay annually on the bond? What was the gain or loss was recogni..
What is the purpose of fund accounting : What is the purpose of fund accounting?
Develop propositionss that need to be examined problem : Analyse the problem and develop propositions/hypotheses that need to be examined to address the problem. Develop a research action plan that details and explains steps to be taken at each stage of the research process.
Define fund as the term is used in governmental accounting : Define fund as the term is used in governmental accounting.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a function that takes an integer array

1. Write a function that takes an integer array and the array's size as parameters. The function will check if the array is sorted. If it is, it will return a 1. If it is not sorted it will return 0. The function should not  sort the array.

  Draw a two-dimensional house seen from the front

Draw a two-dimensional house seen from the front, the way a child would: with a dor, two windows, and a roof with a chimney

  A perfect solution is impossible or too expensive

Optimization is often encountered in engineering problems. More often than not, a perfect solution is impossible or too expensive to find and implement. Therefore, we resort to sub-optimal, yet useful, solutions. This assignment tackles a classical p..

  The program calls a function called getgrades

The program calls a function called GetGrades that will read in grades from the keyboard, the number of grades should also be input by the user.

  Declare a 1-dimensional array of integers

In pseudocode and in C code, declare a 1-dimensional array of Integers called InternetHits that will hold up to 10 Integer values representing the number of hits a Web site receives.

  Write a c program that multiplies user entered number

Write a C program that multiplies user entered number till product of these numbers reach 1000. Which means the number that is entered multiplies itself until it reaches 1000.

  Program that will ask for a month

Write a program that will ask for a month (1-12) and a year (yyyy). the program should then produce a calendar showing the month name and year and have all of the days displayed under it.

  Program that contains two functions in addition to main

Write a program that contains two functions in addition to main. The first one takes 2 arguments (an int array and an int) and returns nothing.

  What is the best way to output the result of a function

What is the best way to output the result of a function?

  Program that stores a series of numbers in a binary tree

Write a program that stores a series of numbers in a binary tree

  Distinguish syntax and purpose of while-loop and for-loop

Distinguish the syntax and purpose of while-loop and syntax of a for-loop. Give C++ code examples of both loops and descriibe the main differences.

  Two-dimensional array to compute the polar coordinates

Write a C program that will read from the input file the time, the x-coordinate, and the y-coordinate values into a two-dimensional array. The program will use the two-dimensional array to compute the polar coordinates.

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