asking about my simple code... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

asking about my simple code...

i just wanted to ask you guys to alert me if there are a better way to type this code... im just new at this so yea... its not that fancy thing but i need help to improve myself so i will be happy to hear some advices, rate it from 10 as a second code for me in this class,thanks. my code :- https://code.sololearn.com/cLHwkU7W3o89/#cpp

27th Aug 2018, 6:14 PM
Ặňặ Ǯǿmry MặƧđař Ặnśậk
Ặňặ Ǯǿmry MặƧđař Ặnśậk - avatar
2 Answers
+ 2
Ặňặ Ǯǿmry MặƧđař Ặnśậk you can check with input validation... for example, distance between market to home should not be negative... one more point is about method you have used to initialize member variables... it's not wrong but constructor should be used for this purpose
27th Aug 2018, 6:23 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 1
Ketan Lalcheta thank you i will try to do something like that next. about the part of my method ik that the constructor should be better but just now i have learned it i mean after i wrote my code already. and yeah thank you a lot i appreciate your advices ^^.
27th Aug 2018, 7:19 PM
Ặňặ Ǯǿmry MặƧđař Ặnśậk
Ặňặ Ǯǿmry MặƧđař Ặnśậk - avatar