Que Vodafone mobile company wants software to maintain the account of its Prepaid Customers.
Create a class PREPAID having the following attributes
1. Name_of_Owner
2. Sim_no
3. Mobile_no
4. Balance
On purchase of any new sim a new object of PREPAID class is to be made and values of the attributes
are to be allocated via parameterized constructor except balance
Class should have following methods
1. addBalance() ---------------------{With Parameter No Return type}
{Hint: This method will add the recharge amount to the current balance}
2. currentBalance() ------------------{No Parameter With Return type}
{Hint: This method will return the current balance}
3. balanceDeduction() -------------{With Parameter With Return type}
{Hint: This method will take duration of call in minutes only as parameter, reduce the balance by rate 50p per
minute and return the updated balance}
4. showInfo() -----------------------{No Parameter No Return type}
{Hint: This method will display all attributes}
My Code
#include<iostream.h>
#include<conio.h>
class Prepaid
{
private:
char name[];
long sim;
long mobil;
float bal,total,minute;
float current;
float recharge;
float min;
char n[10];
long s,mobi;
Compiling VODAFONE.CPP:
Error VODAFONE.CPP 27: Too many types in declaration
Error VODAFONE.CPP 28: 'Prepaid::inf(char *,long,long)' is not a member of 'Prepaid'
Warning VODAFONE.CPP 33: Style of function definition is now obsolete
Warning VODAFONE.CPP 45: Style of function definition is now obsolete
Error VODAFONE.CPP 49: Expression syntax
Error VODAFONE.CPP 59: Unexpected }
Error VODAFONE.CPP 64: Extra parameter in call to Prepaid::inf()
Error VODAFONE.CPP 65: Extra parameter in call to Prepaid::addBalance()
Error VODAFONE.CPP 67: Extra parameter in call to Prepaid::balanceDeduction()