تم التصميم ع #C وتوجد أخطاء لم أعرف حلها وارجوا من الذين لديهم الخبره مساعدتي
وسأرفق لكم الكود بعد البرمجة وبه أخطاء
أختكم / ميمي
homework5#:lnheritance and Polymorphism
1.the goal in this problem is to write classes and amin program to simulate different pric-ing plans for an internet service provider. this exercise concentrates on using inheritance and polymorphic methods ( virtual functions ). Suppose you work in the marketing department of the Baltimore on-line (BOL) service provider. You want to determine which payment plan is better for different customers. The types of plans include the customer, hacker, and chat-room plans:
Table 1 : Different ISP plans
صورة مرسلة

In the customer plan, customers get 4 hours of connection time a month for $10.00 and pay a fixed rate of $4.00 an hour for access time over 4 hours. The Hacker Plan is designed so that customers who Spend more time on-line save money by paying a higher monthly fee of $20.00 for the first ten hours, and $2.50 an hour after that. Chatroom plan members pay $50.00 for unlimited monthly access and also pay an additional charge of 10 cents
for each time they dial up.
Write class definitions for Customer and for the derived sub-classes Hacker, and chatRoom.
Customer should contain data members common to all customers, like the number of hours connected for a month, the customer's name, the amount of disk space the customer requires and so on. Also implement a method for computing a bill, computeBill () which uses the ap-propriate algorithm and data member to compute a monthly charge for each type of customer. In all classes be sure to also include any constructors and other methods that you think are needed. The derived classes should contain any data members and initializations specific to's payment plan and a specific implementation for the computeBill () method which overrides the default method from the Customer class. Demonstrate programmatically which plan is better for the following customers:
• John Dough, a customer spending 6 hours on-line per month who dials-up 35 times and does not host any web pages (uses zero megabytes of disk space).
• Jane doe, a customer who spends 18 hour on-line per month, who dials-up 75 times and hosts 30 megabytes of web pages. (Note: Customer is not is not a valid option be-cause of the 1 MB Disk space limit).
• Javiar Dinero, a customer who spends 48 hours on-line per month, who dials-up 90 times, and who hosts 10 megabytes of web pages. (Note: Customer is not a valid option because of the 1 MB Disk space limit).
بليز ساعدوووا اختكم *_^
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Customer
{
// private fields
private double hrs ;
private double dollars ;
private double Additional Rate;
private int Disk Space Limit;
private double Charge per connection ;
// Customer Constructor
public Customer()
{ Console.WriteLine("New customer crted.parameterless constructor called..");
}
public Customer(double hrs, double dollars ,double Additional Rate,int Disk Space Limit,double Charge per connection);
{
this.hrs=hrs ;
this.dollars= dollars;
this.Additional Rate=.Additional Rate;
this. Disk Space Limit= Disk Space Limit;
this. Charge per connection= Charge per connection ;
Console.WriteLine("New customer crted.parameterized constructor called..");
}
// public properties
public double hrs
{
get{return double hrs;}
}
public int Disk Space Limit
{
get{return disk Space Limit;}
set{ Disk Space Limit=value;}
}
public double Additional Rate()
{ get{return Additional Rate ;}
set{ Additional Rate = value;}
}
}
class Hacker:Customer
{ // private fields
private int name;
private computer Bill ;
private int isvaalidplan;
}
//public Constructors
public Hacker
{Console.WriteLine("New Hacker crted.parameterless constructor called..");
}
public Hacker( int name; int computer Bill ; int isvaalidplan)
:base(regName)
{
this.Name= name;
this. computer Bill= computer Bill;
this.isvaalidplan=isvaalidplan;
Console.WriteLine("New Hacker crted.parameterized constructor called..");
}
public double computer Bil()
{
get{return computer Bil;}
set{ computer Bil =value;}
}
class ChatRoom:Customer
{ // private fields
private int name;
private computer Bill ;
private int isvaalidplan;
}
//public Constructors
public Chat Room
{Console.WriteLine("New ChatRoom crted.parameterless constructor called..");
}
public Chat Room ( int name; double computer Bill ; int isvaalidplan)
:base(regName)
{ this.Name= name;
this. computer Bill= computer Bill;
this.isvaalidplan=isvaalidplan;
Console.WriteLine("New ChatRoom crted.parameterized constructor called..");
}
public double computer Bil()
{
get{return computer Bil;}
set{ computer Bil =value;}
}
}
static void Main(string[] args)
{ Customer[] list = new Customer[9];//array that can hold 9 customers
list[0]=new Customer("John Dough",6,35,0);
list[1]= new Hacker("John Dough",6,35,0);
list[2]= new ChatRoomMember("John Dough",6,35,0);
list[3]=new Customer("Jane Doe",18,75,1);
list[4]= new Hacker("Jane Doe",18,75,1);
list[5]= new ChatRoomMember("Jane Doe",18,75,1);
list[6]=new Customer("Javiar Dinero", 48,90,1);
list[7]= new Hacker("Javiar Dinero", 48,90,1);
list[8]= new ChatRoomMember("Javiar Dinero", 48,90,1);
// and so forth...
for(int i=0;i<list.Length;i++)
{System. Out.Print("Customer" +list.getName())+"would pay"+
list.computeBill()+"dollars with a"+
list.getPlanName()+"type of plan.\n");
}
}
}
using System;