How to solve Ballpark Orders | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to solve Ballpark Orders

I can’t even manage to get an output. I’ve tried to use a method and that also doesn’t work. https://code.sololearn.com/cXsp2kVHbvTf/?ref=app

13th Jun 2020, 1:33 AM
Aleysha
Aleysha - avatar
3 Answers
+ 1
Aleysha Read problem again. String containing 4 words with separated by space. So you need to split String into list. Iterate the list and compare the String using eql? function and get the total amount. Finally apply tax on that amount and add this tax in total amount to get result.
13th Jun 2020, 2:34 AM
A͢J
A͢J - avatar
0
AJ Anant I’m about halfway through the ruby tutorial, I havent even heard of the eql? function yet. I thought I may have been doing something I already knew incorrecly, Do you think you’d need more than beginner knowledge to solve this?
13th Jun 2020, 2:56 AM
Aleysha
Aleysha - avatar
0
Aleysha Yes if you are going to solve these type of problem then you need to know more than the beginner but Ruby is easy language than other languages like Java , C#, C , C++ etc. You need to know about functions, how to implement them, where to implement. eql? used to compare 2 String. So in this problem you can't compare with == because it's compare object not value. You can check like this a.eql?(b) it will return either true or false.
13th Jun 2020, 5:51 AM
A͢J
A͢J - avatar