+ 6
What is the object oriented way to become rich?
sense of humor
6 Respuestas
+ 6
Bank.money = 10000000;
+ 3
Here is another
https://code.sololearn.com/cp65urY93Qqr/?ref=app
+ 3
class Person {
int money;
public void Person(String n) {
this.money = 0;
}
}
class Main {
public static void main(String[] args) {
Person cheeze = new Person();
cheeze.money = /* insert amount here */;
System.out.println(cheeze.money);
}
}
omg i feel so smart typing this out
0
Class you extends person{
String name;
you(String name) {
this. Name = name;
}
public idea think(){
return new idea();
}
public boolean checkIfGood(idea I) {
if (I.isGood()){
I. Make() ;} else {
I.destroy();
this.checkIfGood(this.think());
}
}
Public static void main (String[] args) {
you y = new you(args [0]);
y.checkIfGood(y.think());
}
}
0
class richPerson: public person
{
friend class usurper ;
private:
void withdrawMoney(int);
void depositMoney(int);
int balance();
callDriver();
....//all the rich people methods
public:
...
}
class usurper: public person
{
...
}
int main()
{
richPerson Scrooge;
usurper you_as_Spouse;
int amount;
cout << "How much?"
cin >> amount;
while (Scrooge.balance())
{ you_as_Spouse.withdraw(amount);}
return 0;
}