![]() |
Coding in C++
Not really sure if this is the place to put this or if anyone here knows c++ but..
I've been trying to learn it recently in hopes of becoming fluent one day as my first computer language. Here's an unoriginal calculator I made. PHP Code:
|
Im pretty sure GS2 is based off of java c++ so you might have some help here
|
Quote:
We did this assignment in my first year Computer Programming class in HighSchool. Next, we edited the calculator code to work with strings (using delimiters in Java, substrs in C++). I'd give you the reference assignment, and code (if needed) but unfortunately, everything is on my class desktops and I won't have access to them or the syllabus until tomorrow. Glad you're learning, we need more programmers in the world. |
amazing thumb up
|
I like how you made some functions but didn't use them
|
Quote:
|
Quote:
|
Next step, start parsing strings. Also notice how your code is duplicated for both choice inputs? You should avoid that since as the product grows, future code maintenance efforts become harder as a result. For example, what if you want to change your input source.
Please continue posting your code, it's good to see someone making an effort. |
Quote:
I thought you had to add the functions on top of the main for some reason. Quote:
If you could send me the reference that would be great. Quote:
I'll try and keep this updated frequently :) |
Quote:
For example parsing "1 + 4 - 2". While this can become arguably complicated it can start off quite basic and grow to a great degree depending on the complexity you'd like to achieve, for example implementing brackets. Also I'll give you a hint, using a stack based implementation will probably be the best way to go with this problem. Familiarise yourself with queues, stacks, and other common data structures and have a think about that. |
Quote:
I felt a bit mischievous today aha. So I made file remover. Using the stealth function to hide the window once executed. It basically just deletes anything I specify before I compile it once the person opens it up. Nothing really useful except to mess with people lol. I'll try to get a mod to rename my thread as well.. PHP Code:
|
Quote:
|
Quote:
|
Quote:
|
Are you saying the prebuilt python stacks are flawed?
|
| All times are GMT. The time now is 04:28 PM. |
Powered by vBulletin/Copyright ©2000 - 2026, vBulletin Solutions Inc.