0

Learning C++

I know that the best way to learn programming is to practice and write a lot of code. I know how arrays, functions, classes and etc. work but I don't really know where to use them. What is the best place in which I can found some exercises and stuff to help me get better? Some kind of course and evaluation of my code would be useful too.

4th Oct 2024, 3:58 PM
Kinga Sulej
Kinga Sulej - avatar
3 Antworten
+ 2
Hello Kinga Sulej! Try Github, it has a vast of projects created by variety of C++ experts. Here are some beginner-to-intermediate C++ project ideas to practice and enhance your skills along the way. 1. Calculator Description: Create a basic calculator that performs addition, subtraction, multiplication, and division. Practice: Loops, conditionals, and functions. 2. To-Do List Manager Description: Build a console-based application where users can add, delete, and view tasks. Practice: Working with arrays or vectors, file I/O for saving tasks. 3. Simple Text-Based Game (e.g., Tic-Tac-Toe) Description: Create a command-line game with basic mechanics. Practice: Arrays, conditionals, loops, and functions. 4. Bank Management System Description: Implement a system to manage user accounts, deposits, and withdrawals. Practice: Structs or classes, file handling, and simple algorithms.
4th Oct 2024, 5:20 PM
ShadowCipher
ShadowCipher - avatar
+ 2
Also you can try and filter codes in sololearn to suit your C++ preference. Chek them out, some codes have tasks, you may review the tasks and give it a try by build something out it in your own sense. Some of those codes are 👇👇 https://sololearn.com/compiler-playground/cnrk13r4aOI7/?ref=app
4th Oct 2024, 5:26 PM
ShadowCipher
ShadowCipher - avatar
0
One great way to learn coding is to practice on one small project, but keep going back and upgrading the code for more features. In real life, programmers are always adding capabilities to existing code. You can make up small projects just to practice coding. One popular idea is to create a vending machine. Build it in phases so you can practice. 1. Display a list of items in the vending machine. 2. Display a menu so someone can purchase those items. 3. Add prices and quantities for each item. 4. Create a class for items (barcode, name, category, description,, weight, calories, etc.) 5. Then maybe break that into more objects - such as - nutrition (calories, nutrition, serving size, etc) 6. Create an inventory class that supports (item, quantity, price) and methods for order, re-order. 7. Create the vending machine as a class of it's own. Give it properties such as location, id, and an inventory object. You can continue to build on this as much as you want. Maybe even add a warehouse where you can restock from. Then vendors that carry certain barcodes. You'll have to identify the vendor and reorder items that way. Then you can have reports to show sales trends. Store all the information in a sqlite database or json database, etc., so each run will remember everything. Now of course you don't have to make this bogus application. You can make something even more robust with real world data. There are plenty of APIs out there you can write code against. Most are free. github.com has an api where you could write a program that queries github.com and fetches data and then do reports, screens, searches, etc., in your own code. The point being, there are lots of things. Depends on your skill level and time you want to invest. My illustration is how you can take a very easy menu based vending machine and turn it into a handful of objects and relationships over time. But if you like real-world projects, you'll want to interface with a database or API. Programs are nothing without data
4th Oct 2024, 5:00 PM
Jerry Hobby
Jerry Hobby - avatar