You're trying to use a single char variable to store a lot of numbers This makes no sense.
char ISBN{};
This is ONE char. You can store a single char in it. Just one.
So if your ISBN is more than one digit, this is totally unsuitable.
That said, you're only using one char anyway.
1 2 3 4 5 6
|
for (Counter = 0; Counter < 10; Counter++)
{
WeightedSum = ISBN * (10 - Counter);
Sum = WeightedSum + Sum;
}
| |
ISBN never changes. If you're ISBN value is 1234123412 , aren't you meant to do a calculation using the 1, and then a calculation on the 2, and so on? You're not doing that.
Honestly, delete it all. Start again. Break it into tiny pieces. Get each piece correct before you move on. This is just a big bag of mistakes.
Don't use a char. That makes no sense. How can you store a ten digit ISBN in a single char?
the professor suggested reading in the ISBN and storing it under a char variable. |
I suspect he misspoke, or you completely misunderstood.
I suggest the first thing you do is get the ISBN from the user, and print it on screen. So you know you're actually taking it as input.