Qtr No. 213, New Town Yehlanka Indore 454775
Consider the following code snippet:
public class Bill { public virtual void ShowBillAmount(double rentPerMonth,int durationInMonths) { Console.WriteLine("Total Bill Amount is: "+(rentPerMonth*durationInMonths)); } } public class Prepaid : Bill { public new void ShowBillAmount(double rentPerMonth, int durationInMonths) { int discount = 100; Console.WriteLine("Total Bill Amount is: " + ((rentPerMonth* durationInMonths)-discount)); } } public class Program { public static void Main() { Bill billObj = new Bill(); Bill prepaidObj = new Prepaid(); billObj.ShowBillAmount(200,4); prepaidObj.ShowBillAmount(180,2); } }
Select the output from the following options:
a. Total Bill Amount is: 800
Total Bill Amount is: 360
b. Total Bill Amount is: 800
Total Bill Amount is: 260
c. Total Bill Amount is: 700
Total Bill Amount is: 360
d. Total Bill Amount is: 700
Total Bill Amount is: 260
Option a
Option b
Option c
Option d
To get all Basic CSharp Programming Assessment Exam questions Join Group https://bit.ly/infy_premium_group
We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.
Qtr No. 213, New Town Yehlanka Indore 454775
admin@prepflix.in