Author Topic: My first C++ Project  (Read 6832 times)

0 Members and 1 Guest are viewing this topic.

Offline Ranman

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1354
  • Rating: +83/-0
    • View Profile
Re: My first C++ Project
« Reply #15 on: January 22, 2011, 07:50:27 pm »
It responds 5 is 0 in base 5 with this code
EDIT: I changed rem to start with the value of num it now says five is 1 in base 2 and 50 is 0 in base 2

In your example... conv is initialized as 1 and num is set to 5 at runtime. Hence, power will be 0 when you begin your last while loop (the first thing you do there is power--). DO you really want a negative value for power?

Also... you have this variable called ten, but you initialize it to 0. Does that makes sense? Consider your line of code place = pow (ten, power).
Ranman
Bringing Randy Glover's Jumpman to the TI-89 calculator. Download available at Ticalc.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: My first C++ Project
« Reply #16 on: January 22, 2011, 08:41:05 pm »
thank You for pointing out that I initialized ten to zero I fixed it now and my program is giving me correct results so far
I only had to initialize ten to 10

EDIT: I attached it in all of its simpleness now have to make it support larger numbers
EDIT2: I moved it to my first post
« Last Edit: January 22, 2011, 09:33:55 pm by ruler501 »
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline Ranman

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1354
  • Rating: +83/-0
    • View Profile
Re: My first C++ Project
« Reply #17 on: January 22, 2011, 08:46:37 pm »
thank You for pointing out that I initialized ten to zero I fixed it now and my program is giving me correct results so far
I only had to initialize ten to 10
Awesome!
Ranman
Bringing Randy Glover's Jumpman to the TI-89 calculator. Download available at Ticalc.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: My first C++ Project
« Reply #18 on: January 22, 2011, 08:49:11 pm »
I attached the executable to my post if you want to show me all of the bugs  :'(
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: My first C++ Project
« Reply #19 on: January 22, 2011, 10:50:16 pm »
Very nice! I might have a use for this. I guess I was wrong about doing a less complicated first program.
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: My first C++ Project
« Reply #20 on: January 22, 2011, 11:19:00 pm »
i had to ask a few questions but i understood the concept of what i was doing. I'll come back to this later when i learn more to add more number capability to it.
I'll post my multi-method quadratic solver later also I'll just use the same method my calculator does in the program I made for it. Just have to finish it.

EDIT: anyways i like challenges
EDIT2: I posted the code for and the program of my Quadratic Solver on my first post. It solves quadratics by the completing the Square method.
« Last Edit: January 23, 2011, 12:24:22 am by ruler501 »
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y