Transportation Test Case #1 / Case#2 in C++ Course | SoloLearn: Learn to code for FREE!

+3

Transportation Test Case #1 / Case#2 in C++ Course

Hi dear friends. I wrote a C++ code. But Sololearn says my code is not quite correct. I sent a feedback for it to Sololearn. But they didn't reply me. So, I ask your help.This is a test of Sololearn. Sololearn gives the inputs and gets the outputs in the C++ course. Even if the outputs are correct, Sololearn says that there was some bugs. And Sololearn advice me to practice with code coach. But the code coach is paid. I don't know what the omission is. Where do you think there are errors or omissions? https://code.sololearn.com/c6ojwKkY3cSJ/?ref=app

11/29/2020 1:33:24 PM

lifeismyschool

26 Answers

New Answer

+6

Remove the text from the output so that it prints only the number, just like their example and what they show in "Expected output". Change cout<<"Empty Seats: "<<emptyseats; To cout<<emptyseats;

+8

In test problem of sololearn we have to only follow the sample input and output which is already given in explanation. We don't need to add anything extra for more appropriate code. (As we know in Competetive exams or any websites/practise websites we have to just follow the sample output and input rules) And all code coach problems are not paid. Some of them are paid or we can say that those code coach problems are for pro users only. U can solve approx 25-30 code coach problem (in community section) . I hope this will help for u.

+6

Like the others said omit the printed text but u can do it in a very simple way like this: #include <iostream> using namespace std; int main() { //your code goes here int a,b; cin>>a; /*a is for number of passengers*/ b= 50-a%50; cout<< b; return 0; }

+4

As mentioned by Brian "empty seats" text is extra. 😅

+3

https://www.sololearn.com/Discuss/2314301/?ref=app Read this u will get your answer.

+2

Brain I tested it myself and I got what you mean.

+2

Thanks a lot everyone. I passed the test cases. Sololearn have 5 test cases. But it just let me to see the first two ones it says although it said I passed the other three test cases. Do you know why?

+2

Hello Amit. You can ask any question to people in Sololearn.

+2

Thank you everyone. I did it.😉

+2

A simple three lines of code implementation. First, you use the modulus function to find the remainder, which are the passengers on the last bus. Then, to find the empty seats, you use bus capacity minus away the last passengers. https://code.sololearn.com/cAsIKRZH3quK/?ref=app

+1

This is a test of Sololearn. Sololearn gives the inputs and gets the outputs in the C++ course. Even if the outputs are correct, Sololearn says that there is some bugs. And it advice me to practice with code coach. But the code coach is paid. I don't know what the omission is.

+1

But the bug is just that?

+1

Thanks a lot for your advices. I will try to practice with code coach problems in community section. But I guess, I didn't add any something extra in this code. What is extra in the code?

+1

Thanks a lot for answer of hidden test cases.

+1

Michael Rose Sololearn puts inputs automatically. This is a practice test of Sololearn.

+1

oh sorry just started yesterday

+1

It is ok😊

+1

#include <iostream> using namespace std; int main() { //your code goes here int a; cin>>a; cout<<50-a%50; return 0; }

+1

cout<<(50-a)%50; is okay.

+1

#include <iostream> using namespace std; int main() { //your code goes here int a; cin>>a; cout<<50-(a%50); return 0; }