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.
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();
}
}
}
We hope you found what you were looking for. Feel free to revisit us for more answers and updated information. Your visit means a lot to us. Don't hesitate to return for more reliable answers to any questions you may have. Discover more at Westonci.ca. Return for the latest expert answers and updates on various topics.