Sounds harsh, but I speak from experience. It would be nice if other people could learn from my mistakes. Seems unlikely.
And you haven't told us what you already know, what's likely to be on the exam, what level you need to work at, what you're likely to be asked to do, whether you'll need to write a program, whether you need to design a program, or, really, anything.
Step 1: Find out what's likely to be on the exam.
Step 2: Decide honestly what you already know.
Step 3: Ask a specific question.
Step 4: Lather, rinse, repeat.
... write a program which tells the difference
between two integers ...
I don't understand what that actually means, but you could start by:1. Write a precise example of an exam question,
2. Write a program that you think answers the question,
3. Make sure it runs,
4. Ask for advice about what you've done well, and what you've done badly,
5. Lather, Rinse, Repeat.
2. If you are in twelfth grade, you aren't expected to be a good C++ engineer/dev, you are expected to know some curriculum they gave you already.
3. If you have the curriculum, you should start grinding through the lessons you have already been given. It's what you are going to get tested on.
Sorry, this may not seem helpful, but getting as far as you can through the courseware you should already have, is going to be the best thing to do. Unplug the internet if you can, and just grind through it. If you pass, it will have built character.
Edit; ColinWright has some good comments too. Seriously look at what you already know, and try to use any questions/tests built into your curriculum (if there are any) to test yourself.
First: Don't panic. It won't help and in fact will make things worse. Most of the fear comes from the unknown, which the rest of these steps address.
Second: follow ColinWright's four steps in his comment here. (What you should have been doing anyway, but I'm sure you already know that. Anyway it's too late to change the past).
Third: Consider the context: did you just goof around all semester when you should have been learning C++ or have you been doing a bunch of programming languages and C++ is simply the latest of the set?
If it's the latter case, then realistically the test won't cover much of the language and the amount you will need won't be so huge (see item "First" above). You can ask the teacher for help.
If it's the former case, well, OK, you know you won't be getting an awesome grade. Take a few deep breaths, reflect on this and then put it aside. You can't affect that but you can affect how well you do.
Fourth: Realize that one part of this lesson is about planning and context. To you, a year 12 student, this is a big deal. To me, who just turned 50 this week, it's simply the kind of thing that added to the mix that made me who I am. I was a good, diligent student AND I was a fuck up. At the same time, all mixed together. And I ended up being what many people would call a success.
My friend Esther Dyson likes to say, "always make new mistakes." That means it's best if you both learn from what happened (perhaps poor planning, which is chronic among students; or perhaps just a lack of perspective) so that you eventually learn not to make the same mistake, but also learn that you will always be making mistakes your whole life.
I know a final exam seems like a huge deal, and I'm not trying to tell you not to take it seriously! But in the scheme of things you'll survive and, depending on how you handle it, thrive.
There is a ton of C++ info on the web (of varying quality, of course) but sometimes I think, when trying to learn something new, getting offline and looking at a physical book improves my focus.
I've read many C++ books over the years, but the one that finally made everything click, at least for me, when I was first learning C++, was "C++ How to Program" by Deitel and Deitel. The copy I have is 20 years old (yes, I'm old :) ) but I suspect the newer editions (http://www.amazon.com/C-How-Program-8th-Edition/dp/013266236...) have similar approachability.
Good luck to you and, as others have suggested, do not panic. Though it seems like a massive deal to you right now, rest assured your perspective will change down the road.
2. Follow it.
3. Write the exam. Who needs arrays, inheritance, or polymorphism?
But seriously, both ColinWright and Rantenki have pretty much hammered a nail there. You haven't given us any more details other than you're a 12th grade student.
- Until what part do you have to learn? What do you have to do?
- How much time do you have to concentrate each day?
- How desperate are you?
- Is your goal simply to pass, or to get a good grade?
- Following on the first point, is this an yearly exam? or end-of-term exam? Figuring out what the problem is the first step of solving one.
Thinking like a programmer/engineer, and problem solving, that takes a lot longer than 10 days.
I would say focus on learning libraries, since that's the majority of what people consider "learning" a language. Syntax is somewhat easy (minus some....okay many of c++'s nuances), but learning libraries is the difficult part.
Don't read though, do. You need to actually write programs to become good at writing programs. Don't spend time reading specifications, because that will only get you so far.
If you're good at math, the first few problems on project-Euler would be a good starting point, but there are other challenge type websites around.
Personally, knowing what I know now, the place to start is * <iostream> standard I/O (console) * <fstream> file I/O * <cmath> Math library
Becoming familiar with some functions in those libraries will get you a decent starting point
I have no idea if this is good, but its free: http://rooksguide.org/
Do well.