Help Wanted :)

This is a discussion on Help Wanted :) within the C++ Programming forums, part of the General Programming Boards category; Hey guys, I need a little help
1. Write a class "Bulb" which has a private member - type bool!- ...

Help Wanted :)

Hey guys, I need a little help

1. Write a class "Bulb" which has a private member - type bool!- "Balance", default constructor which sets the state to FALSE and public methods "PushTheButton" that will turn on and off the lamp and "Check" which will print out "Light" or "Dark" depends on the current state (0-dark, 1-light). Create an object "Turning" of class "Bulb" and turn it on and off several times.

2. Write a class "Employees" which has private data members: "path", "age" and "wages". Write constructor which initialized data members while creating a object. Write destructor which print out "Destructor employees - fired". Write an access method that can change some of the data members and methods that can get their value. Write a "friendly" function that calculates how much
employee has earned.
Note: the function accepts a reference to an object of class "Employees".
You need to calculate how much employee earned during his work
(months*number of working years*wages)

yup, i missed that part.. i'm one of those people who don't read rules but anyway, it makes more fun if you do by yourself and btw, i didn't need for homework or something like that..i was just interested how would someone else do the same program.

If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

1. i'm not a boy
2. yes,i'm student on faculty for electrical engineering , branch - computer engineering.
3. google.com is my best friend.
4. believe it or not - i didn't come to beg for my homework or don't know what
5. "hey guys, i need a little help" - i should use another words, then maybe you wouldn't think that i come to beg
6.. all in all , i don't know why i'm typing all this things, when you will think so or so what do you want to think, AND when you wont reconsider about any other solutions

Bulb looks OK, except for indentation. One thing, though. CheckButton should be const.

For Employees, you should have a look at this.
Earning also does not need to be a friend function for the class. It can simply use the public interface to get the required data. It should also take a const reference instead of a reference. Public interface get functions should be const. Indentation should also be fixed.

A female electrical engineer, eh? A rare beast, but hopefully one becoming less rare.

Originally Posted by VioletGirl

3. google.com is my best friend.

My condolences. My two best friends are a person and a dog. Incidentally, both are female.

Originally Posted by VioletGirl

4. believe it or not - i didn't come to beg for my homework or don't know what
5. "hey guys, i need a little help" - i should use another words, then maybe you wouldn't think that i come to beg

It will probably help if, as you learn, you also give something back. Even if your advice to others isn't perfect, the attempt is important (even the most knowledgeable folks here get it wrong sometimes, and are picked up by someone else).

The attempt to help someone is often the best way that you can learn too.

Originally Posted by VioletGirl

6.. all in all , i don't know why i'm typing all this things, when you will think so or so what do you want to think, AND when you wont reconsider about any other solutions

The question you were given is pretty specific. There isn't much scope for considering other solutions.

If you want people to really look at options, don't nail down your question so much.

If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.