Homework

So i have this homework i need to have done and i'm not really good with C++ so i had a friend send his to me but i can't turn in the exact same thing. What could i change in this code to make it look different but have the same output?

#include<iostream>
using namespace std;

class ATM {

private:
char *location;
const char type;
int nbr100;
int nbr20;
static int MIN_BALANCE;

public:
ATM(char l[]= "\0", char t='R', int n1= 80, int n2= 600):type(t)
{
location= new char[strlen(l)+1];
strcpy(location,l);
if(t=='A'?'A':'R'){
nbr100=(n1>=0||n1<=500?n1:80);
nbr20=(n2>=0||n2<=800?n2:600);
int total= n1*100+n2*20;
}
}
void withdraw(int amount)
{
int x= amount%20;
if(x==0||x<=nbr100*100+nbr20*20)
{
nbr100= nbr100-amount/100;
nbr20= nbr20-(((amount/100)%10)/2);
cout<<"The number of one hundred dollar bills are "<<amount/100<<"the number of 20 dollar bills are"<<(((amount/100)%10)/2)<<endl;
}
else
cout<<"Operation cannot be completed"<<endl;
}
ATM& deposit(int x,int y)
{
if (x%100==0)
{
nbr100= nbr100+x;
}
else
cout<<"Enter the number of one hundred dollars you want to add "<<endl;
if (y%20==0)
{
nbr20=nbr20+y;
}
else
cout<<"enter the number of twenty dollars you want to add"<<endl;
int totalamount= nbr100+nbr20;
cout<<"the total number of money deposited is :"<<totalamount<<endl;
return*this;
}




void checkbalance()
{
int totalamount=nbr100*100+nbr20*20;
if(totalamount<MIN_BALANCE)
cout<<"Refill your account with cash"<<endl;
}

void chekATMStatus()
{
cout<<"ATM location:"<<location<<endl;
cout<<"ATM TYPE:"<<type<<endl;
cout<<"The remaining number of hundred dollar bills:"<<nbr100<<endl;
cout<<"The remaining number of twenty dollar bills:"<<nbr20<<endl;
checkbalance();
}
};

int ATM::MIN_BALANCE= 2000;

int main()
{
ATM S("Baabda",'A',300 ,500 );
ATM M("Jounieh", 'R', 100, 600);

S.withdraw(1020);
M.deposit(1,4);
S.withdraw(1060);
M.deposit(4,18);

S.chekATMStatus();
M.chekATMStatus();
The whole point of homework is to evidence that you understand the subject matter.

Straight up copying or try to change minor details is pointless and your lecturer will probably see right through it.

If you're totally stuck, I guess it's cool to use this as a guide, but you should be more concerned with understanding the subject, rather than trying to pass this off as your own. What if some of this comes in up a future exam?
The deadline is for tomorrow and i have been buried with work (outside uni). I am going to get over all of the material as soon as i have less pressure on me. The thing is i just don't have time to understand everything for tomorrow and this HW is 5% of my grade.
Topic archived. No new replies allowed.