Can someone give me tips and pointers about how i should approach this assignment and steps I need to do ?
Thanks
In this module you learned how to create polymorphic code using virtual functions.
A file filter reads an input file, transforms it in some way, and writes the results to an output file. Write an abstract file filter class that defines a pure virtual function for transforming a character. Create one subclass of your file filter class that performs encryption, another that transforms a file to all uppercase, and another that creates an unchanged copy of the original file.
The class should have a member function
void doFilter(ifstream &in, ofstream &out)
that is called to perform the actual filtering. The member function for transforming a single character should have the prototype
char transform(char ch)
The encryption class should have a constructor that takes an integer as an argument and uses it as the encryption key.
The only thing i can provide in terms of code is the pre processor directives and variables. I don't know how to do things in this assignment such as classes, etc
> im in college getting an education
Who's paying for it - you, your parents, or taxpayers at large?
Is this your major? Where in your imagination, you pass with flying colours and a well paid job that enables you to pay off your debts awaits. Based on the level of course material you say you've "studied" and your apparent skill level, that edifice is going to come crashing down at the first closed book assignment/exam.
Seriously, if it's your money on the table and this is your plan to pay it back - you're screwed.
> The only thing i can provide in terms of code is the pre processor directives and variables.
That sounds about like the first lesson.
> In this module you learned how to create polymorphic code using virtual functions.
Mmm, your palindrome fiasco was M5 and this is M6.
Which was the first one you started to have some doubts about knowing fully - M2?
> I read about virtual functions but doesn't mean i actually understood it.
Well keep reading until you think you understand it.
Then keep doing exercises until you actually understand it.
It's like you're standing around in the kitchen hoping to become a master chef, just from observing others working and reading a few menus. It's not going to happen.
Real kitchen mastery comes from a long list of knife wounds, over and under cooked dishes and maybe even the occasional fire.
Programming is the same - without the physical pain and bad smells.
It's a lot of frustration, study, going back over past examples, trying different things.
Not running to a forum every time you get a syntax error.
> I'm getting an error at line 44 and 46. Can someone hlep me fix/debug this
It's a meaningless waste of a post without knowing what's in the invisible filter.h file.
Sure. The problem is at line 44 and line 46. Delete those lines and you are good to go.
That was sarcasm by the way. Obviously we cannot help you if you do not provide all the code. What is "Copy?" What is the definition of that class? What is the definition of the doFilter method? What error messages are you receiving? Providing none of this information while expecting us to fix your problem is asinine.
Hi, I am a beginner, can you teach me how to build a nuclear powered rocketship in my basement?
That is what you ask here. A week ago you could not write a loop by yourself (and as best as I can tell, you still can't). I don't believe you can write a simple class by yourself, and see no evidence that you can in the code you posted. How you gonna do virtual polymorphic classes when you don't know what a class is? If you want to play the beginner card, stop asking advanced questions.
Prove me wrong, do the simplest part of the assignment: write me a class that uppercases file data: " another that transforms a file to all uppercase". That does not need anything advanced, so, you can do this, right? Its < 10 lines of code.
If I were just learning C++ as leisure your recommendation would be valid. Fully learn beginner functions before I ask advanced stuff. However, I am a college student in college. I don't get to pick the assignment. So as the semester has progressed the teacher has given us more advanced items each week. This is why you might be seeing me post even harder things.
It's not like i can ask the teacher to pause the semester while i learn beginner things. I have to try and keep pace with beginner stuff and the advandced stuff.
its also not like you learned anything taught to date. You are so far behind you are going to fail now. So, your post tells me you can't do the easy part of the assignment, let alone the new complex things, is that what you are saying? That you can't uppercase a string, but expect to grok virtual/poly/inherited stuff?
Its not like most of the people here are self taught either. We all went through college. We know what its like. Many of us, myself included, got behind in a class and failed or dropped it to try again later.