Microsoft Visual C#
Microsoft Visual C#
7th Edition
ISBN: 9781337102100
Author: Joyce, Farrell.
Publisher: Cengage Learning,
bartleby

Concept explainers

Question
100%
Book Icon
Chapter 10, Problem 2E
Program Plan Intro

Program Plan:

  • Create a class Photo and include data member width and height of type double in it.
  • Include property for each data member.
  • Add protected field named price and set property for its get accessor.
  • Create constructor of class to take two arguments for width and height and set the value of price field as per mentioned rules of height and width.
  • Derive class MattedPhoto, add additional field color in it and override the base constructor to change the value of price field.
  • Derive class FramedPhoto, add additional fields material and style and override the base constructor to change the value of price field.
  • Create a program class having main method. Inside the main method create objects of each of above class and use ToString method to display the attributes of these classes.

Program Description:

The main purpose of the program is to create a class Photo, derive two other classes MattedPhoto and FramedPhoto from it and demonstrate method of these classes.

Blurred answer
Students have asked these similar questions
What is cloud computing and why do we use it? Give one of your friends with your answer.
What are triggers and how do you invoke them on demand? Give one reference with your answer.
Discuss with appropriate examples the types of relationships in a database. Give one reference with your answer.
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT