Ask your own question, for FREE!
Computer Science 20 Online
sleepyjess:

@ultrilliam

Ultrilliam:

Whats the error?

sleepyjess:

1 attachment
Ultrilliam:

It can mean a few things, could you paste the full code here?

sleepyjess:

redid it (had a lot of extra stuff from changing things around) and it's not giving that error anymore

Ultrilliam:

:thumbs_up:

sleepyjess:

buuuuuuut

sleepyjess:

do { cout << "Please enter A, B, or C." << endl; cin >> package; } while(package != 'a' || package != 'A' || package != 'b' || package != 'B' || package != 'c' || package != 'C'); this isn't working like it's supposed to

Ultrilliam:

\```cpp insert code here \```

sleepyjess:

it's not stopping the loop once a, b, or c is entered

sleepyjess:

```cpp do { cout << "Please enter A, B, or C." << endl; cin >> package; } while(package != 'a' || package != 'A' || package != 'b' || package != 'B' || package != 'c' || package != 'C'); ```

sleepyjess:

ooohhhhh

Ultrilliam:

*opens visual studio to debug*

Ultrilliam:

>namely cause its fun to have a excuse to open VS lol

sleepyjess:

lol

Ultrilliam:

>needs to reinstall c++ components :/ YOLO I'll just do this the old fashioned way I guess lol

Ultrilliam:

```cpp do { cout << "Please enter A, B, or C." << endl; cin >> package; } while(package != 'a' || package != 'A' || package != 'b' || package != 'B' || package != 'c' || package != 'C'); ``` I don't actually see a issue with this, but it's been a while since I really played with C++, so I'm gonna go ahead and open up Visual Studio. I have a idea but I could be way off lol

sleepyjess:

just came up with one more question... last one (I think)... is there a way to have it print out the value of something like `packageA - packageB`? Like if packageA costs $25 and packageB costs $16, would it print out 9 if i did ```cpp cout << packageA - packageB << endl; ```

Ultrilliam:

Correct, though I would more do ```cpp cout << (packageA - packageB) << endl; ``` But that's just a nitty gritty thing

Ultrilliam:

nit picky*

sleepyjess:

cool

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!