In works in code playground but refuses to work in coach | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

In works in code playground but refuses to work in coach

#include <iostream> using namespace std; int main() { // your account's balance auto balance = 2452.4; // price for each notebook auto price = 259.99; // Task: calculate the number of notebooks you can afford and output it. // Hint: use an integer to store the result. int numbernote = balance / price; // Task: calculate the amount left over on your account after the purchase and output it on a new line. // Hint: calculate the total price of the purchase, then substract it from the balance. double paid = price * numbernote; double left = balance - paid; cout<<left; }

6th Dec 2023, 7:54 PM
YT bean
2 Answers
+ 1
It just doesn't run? Does it give you an error or something?
6th Dec 2023, 8:11 PM
Mohammed shoaib
0
YT bean , It looks like the quiz expects you to output the number of notebooks you can buy, followed by how much money you have left, but you're only outputting how much money you have left.
10th Dec 2023, 3:15 AM
Rain
Rain - avatar