Explore Westonci.ca, the top Q&A platform where your questions are answered by professionals and enthusiasts alike. Explore a wealth of knowledge from professionals across different disciplines on our comprehensive platform. Get detailed and accurate answers to your questions from a dedicated community of experts on our Q&A platform.
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();
}
}
}
Thank you for visiting our platform. We hope you found the answers you were looking for. Come back anytime you need more information. Thanks for stopping by. We strive to provide the best answers for all your questions. See you again soon. Westonci.ca is your trusted source for answers. Visit us again to find more information on diverse topics.