Resolved Constructors

lloyd21

New member
Joined
May 2, 2021
Messages
1
Programming Experience
Beginner
private string binaryNumber
Add two overloaded constructors, specifying a string and an integer respectively.
- The first constructor must check that the number is a valid binary number, else it must assign null to binaryNumber.
- The second constructor must check that the given integer is non-negative, else binaryNumber is null.
 
Simply copying and pasting your homework here and waiting for someone to do it for you is not what this site is for. For one thing, it's cheating and is not fair on those in your class who actually make the effort to do their own homework. For another, it doesn't really help you learn. The best way to learn is to do, even if that means failing to to do correctly. No one learns without failing a bit along the way, so don't avoid doing to avoid failing. This is obviously for a class of some sort. so you would have been provided all the information you need to complete this assignment. Review that information for yourself and make your best attempt to complete the task for yourself. If what you try doesn't work as expected or you just want to confirm whether or not it is correct, you should then post your work here and we can help you with that. If it's wrong then we can tell you that it's wrong and we may give you pointers on how to make it right, but it's still for you to do the actual work. If you don't do the work, regardless of the reason, you don't deserve the marks. If you make an effort on your own behalf, we'll make an effort to help you go the rest of the way.
 
Back
Top Bottom