**Neuer Kurs!**Jeder Programmierer sollte

**generative KI**lernen!

+ 1

# c++ help

In introduction to c++, i'm at module 1 quiz The purpose of the quiz is, How much money will be left after buying the printer?, the program: int money = 1000; Int price = 145; Int result = money [ ] price; // ? - ? + ? * ? / ? % ? cout << result In this case, I think it's about subtraction, but when I write the minus symbol in the free space, it says that there is an error. So if somebody can help me i'll be glad 🤔.

9 Antworten

+ 4

I think you should analyze more on the text “left over.” It is not subtraction but it is still related to the topic discussed on this module. If you have 1000 and the printer costs 145, you’ll be able to buy 6 printers. The question is asking about how much money will be left if you’ve bought those 6 printers :> hint: what will you input to show a remainder from a division

+ 5

I think you misread the question.
Original text:
Your company needs printers and provides $1000 to buy ***as many of the same printers as possible***.
Your text:
How much money will be left after buying ***the printer***?

+ 3

TRUTH You got the right idea but you just have a syntax error. And yes, its subtraction.
You forgot to add a semicolon for your cout << result;
Also, not sure if its a syntax error but its best if you lowercase the “I” for type int in your variables.
https://sololearn.com/compiler-playground/ciXGM5sw1zTJ/?ref=app

+ 3

What do you mean by “can’t write”?

+ 3

TRUTH
Different wording can lead to different result.
Say you have $100 and want to buy as much candy as you can.
Each candy cost $30.
You can buy 3 candies and $10 left.
If you buy a candy, you have $70 left.

+ 2

Nana Fish % 💀 (i'm cooked in programming) thx after all <3.

+ 1

Junior yes but i can write this mini program correctly in compiler but, i can't write in quiz so i can't pass, i don't know what's wrong with it, maybe a sololearn problem?

+ 1

Junior seems like i can't normally explain so, try by yourself so u will see "what i can't write" 💀

+ 1

Wong Hei Ming no i just wanted to say in simple words.