![]() |
|
11-11-2014
|
1 |
|
:
Join Date: Jul 2012
Location: Minnesota
Posts: 818
|
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:
Last edited by fp4; 11-26-2014 at 09:12 PM.
|
|
11-12-2014
|
2 |
|
(☞゚∀゚)☞ dank meme ☚(゚ヮ゚☚)
Join Date: Oct 2012
Location: Utah
Posts: 5,261
|
Im pretty sure GS2 is based off of java c++ so you might have some help here
|
|
11-12-2014
|
3 | |
|
Banned
Join Date: Jul 2014
Location: Omaha, NE
Posts: 610
|
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. |
|
|
11-12-2014
|
4 |
|
Registered User
Join Date: Apr 2012
Posts: 347
|
amazing thumb up
|
|
11-12-2014
|
5 |
|
Banned
Join Date: Sep 2012
Posts: 1,059
|
I like how you made some functions but didn't use them
|
|
11-12-2014
|
6 |
|
Banned
Join Date: Jul 2014
Location: Omaha, NE
Posts: 610
|
|
|
11-12-2014
|
7 |
|
Banned
Join Date: Aug 2013
Posts: 804
|
|
|
11-12-2014
|
8 |
|
The muffin man
Join Date: Sep 2011
Location: Burger Refuge
Posts: 2,262
|
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. |
|
11-13-2014
|
9 | ||
|
:
Join Date: Jul 2012
Location: Minnesota
Posts: 818
|
I took them out and the program still worked! I thought you had to add the functions on top of the main for some reason.
If you could send me the reference that would be great.
I'll try and keep this updated frequently
|
||
|
11-13-2014
|
10 | |
|
The muffin man
Join Date: Sep 2011
Location: Burger Refuge
Posts: 2,262
|
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. |
|
|
11-24-2014
|
11 | |
|
:
Join Date: Jul 2012
Location: Minnesota
Posts: 818
|
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:
Last edited by Motrox; 11-24-2014 at 01:21 PM.
|
|
|
11-24-2014
|
12 | |
|
Registered User
Join Date: Sep 2014
Posts: 3
|
|
|
|
11-24-2014
|
13 | |
|
The muffin man
Join Date: Sep 2011
Location: Burger Refuge
Posts: 2,262
|
|
|
|
11-24-2014
|
14 |
|
Software Engineer
Join Date: Sep 2011
Location: Gold Coast, Australia
Posts: 787
|
|
|
11-24-2014
|
15 |
|
Banned
Join Date: Sep 2012
Posts: 1,059
|
Are you saying the prebuilt python stacks are flawed?
|