While we are primarily here to help people with their Free Code Camp progress, we are open to people on other paths, too. Some of what you are asking is pretty trivial in the Free Code Camp context, so you might find that if you’re not getting the instruction and material you need in your current studies, the FCC curriculum will really help you get started. At a modest guess I’d say investing a 4-5 hours working through the curriculum here will really pay off. You can find the curriculum at https://www.freecodecamp.org/learn.
With your current questions, we don’t have enough context to know what you already know or don’t know, so it is impossible to guide you without just telling you the answer (which we won’t do).
It is pretty typical on here for people to share a codepen / repl.it / jsfiddle example of what they have tried so that anyone helping has more of an idea of what help is actually helpful.
Please provide some example of what you’ve tried and I’m sure you’ll get more help.
You got a nice list of features there, so it’s a straightforward thing to do.
Don’t get discouraged by the amount of text, but just ask yourself, what different tasks the program is supposed to do in what order.
Then you’ll notice what information you need to provide beforehand (like making a list of sample-products → which the text said should have at least 3 entries).
Next question is what the output of the tasks should look alike (somewhat provided in the Legend).
You got a menu with 5 tasks, which hints at 5 functions that can be called.
Depending if you are making a GUI or a pure console-application, you gotta think about design further. If not, it’s mostly about turning the big project into it’s logical parts and then build those and then later combine them into the big project.
Kinda like building something with lego: regardless of how big some result may be -what you are actually doing a lot of little steps.
On a quick glance, it looks good
Though keep in mind, this is a program for a fictional company → that company doesn’t want to fiddle with the code, that was your job. So the Sales-dialoge must be completly self-sufficient. Right now the company would need to edit it in case their product or prices change.
In reality, the company would have a database with products, prices, maybe taxes and other special additions → the program would read those out and build the entire sales-dialoge itself. Now for your task, it could be enough to create a data-structure containing the 3 products with their prices. Point is, when writing a program, the less places there are that might need editing later, the better.
Imagine the company has not only 3 product, but 3000 → right now this would add almost 9000 lines into your sales in addition to writing all of them into the Products-Class. And it seems like you wrote “Foods\n” as a product. Just, don’t. If you want a linebreak at the end of the output, add a print() at the end of the loop. It’s the purpose of the output-generater to generate the output - not of the inputs.
Thank you for response Mr. Jagaya , I think I understand what you mean,
I will try to do some experiments by following your instructions. Thanks a lot.
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.