At Westonci.ca, we connect you with the answers you need, thanks to our active and informed community. Get detailed and accurate answers to your questions from a dedicated community of experts on our Q&A platform. Get immediate and reliable solutions to your questions from a community of experienced professionals on our platform.

The following table describes the required fields for two classes and typical values stored in those fields.

You are required to create a base class Printer and its child class PrinterCumScanner. Each of these classes should have user defined constructor and overridden Display() method so that the following test driver can work properly.

Sagot :

Answer:

hope this helps,if it did pls mark my ans as brainliest

Explanation:

using System;

class Printer{ string companyName; int pagesOutput;

double price;

public Printer(string companyName,int pagesOutput,double price){

this.companyName=companyName; this.pagesOutput=pagesOutput; this.price=price;

}

public virtual void Display(){ Console.WriteLine("companyName: "+companyName+" pagesOutput: "+pagesOutput+" price: "+price);

}

}

class PrinterCumScanner:Printer{ int imageDpi;

public PrinterCumScanner(string companyName,int pagesOutput,double price,int imageDpi):base(companyName,pagesOutput,price){ this.imageDpi=imageDpi; }

public override void Display(){ base.Display(); Console.WriteLine("imageDpi: "+imageDpi);

}

}

public class Program { static void Main(string[] args) { const int NUM_PRINTERS=3;

Printer []stock=new Printer[NUM_PRINTERS];

stock[0]=new Printer("HP",40,89.50);

stock[1]=new PrinterCumScanner("HP",40,215.0,320); stock[2]=new PrinterCumScanner("Cannon",30,175.0,240);

foreach(Printer aPrinter in stock){ aPrinter.Display();

}

}

}