I have done my project. Everything ia working out fine. But teacher told me to complete it with multiple classes. so ive done it. but thngs are not working out properly. file is creating huge size and untill i close the black running box. please help me with that. tomorrow is my project submission.
here is the complete code that ive done, but teacher refused it because of being too simple. its working fine. https://db.tt/b4oUTKGi
but here is the problemetic code that is not working properly. please check it. https://db.tt/5hSlOqG7
(main problem i am facing is, whether im subscribing for Voice Packages or Internet Packages, then the program is acting weird while printing file, that means creating a file. but when for a profile im subscribong for both Voice Packages or Internet Packages they are working fine)
*may be my syntax are wrong in some cases. I have used polymorphism in c++
**just create a profile for phone number any 11 digit. and any balance you want to input.
please see the every class definition, i dont know it is okay or not, but mani problem in in main function. :(
I'm not sure what problem your teacher would have with your code if I'm perfectly honest. If your code works and does what it is supposed to then the last thing you would really want to do is overcomplicate things and add even more classes into the mix. I'm pretty certain that most programmers on the planet would prefer simpler code over more complicated code.
I don't agree with your teacher, you've obviously done a good job writing your 2000+ line project.
Anyway, I will attempt to help you best I can. And since you've written such a big project it can be quite difficult to see where the problem is just by looking at it. Are all your classes working as they should be? Is it just the part where it writes the file where the problem is? Or elsewhere too?
EDIT: if it was a syntax problem then your code wouldn't compile at all, which it does. It might be that you've removed something from the old version or added something else in that makes that code not work anymore.
I'm with you, cause he didn't understood me. Sorry to say. about my teacher. anyway , i have solved the printing problem by myself just erasing 2044, 2046, 2047 & 2048 numbered line on pro.cpp . But still i think i haven't got some syntax enrichment.
Questions & Asking:
1. can you check the classes and their connection between main() function. and if it is improve able (code syntax) then your suggestion is acceptable.
2. If I want to create a function for the program that will display all the packages that i have subscribed , is it possible ? (cause if you see my completed code Project.cpp there is a display function that displays value. but im not able to make it work on pro.cpp , cause the internet class and voice class is diffrent . so should i call diffrent display function for each class seperately and call 3 of them together ? )
Ok, one thing I have noticed is that you haven't got implementations of the read() function for some of your classes like the Profile and Voice classes. That may well be contributing to why the file isn't being written properly and the data isn't being displayed properly.
As for your second option, anything is possible in code if you know how to write and implement it. There are 2 ways I can think of doing this which is to either add all the subscribed packages into an array/vector or to call all the class functions to display all the subscribed packages like you said.