Monday, May 24, 2010

Exponents in C++?

I just recently started learning C++ and I'm trying to write my first basic program. I decided to make one that would calculate the future value of an annuity when the user enters the present value, interest rate, and time.


Here's the code for the program. (I couldn't put the whole code, so I stripped out all the couts and cins.) The problem is in the 8th line with text in it. I need to make FV = PV * (1 + interest)^months. For some reason I can't use the ^ symbol for exponents.





#include %26lt;iostream%26gt;


using namespace std;


int main()


{


string exit;


typedef float f;


f PV, interest, months, FV;





FV = PV * (1 + interest)





cout %26lt;%26lt; "The future value of your deposit will be: $" %26lt;%26lt; FV %26lt;%26lt;endl;





cin%26gt;%26gt;exit;


return 0;


}

Exponents in C++?
use the math.h library





pow()
Reply:use: f(x)pow(exponent)
Reply:you us math or you do it manually





base, more ,x,y as int





base= 1000$


more= 1000 depot each year


x= 1,065


y=10 years





i=0;


base = base * x


for (i%26lt;y;i++)


{


base = base + more


base * x


}











look like that have fun


if you dont use labrary it take less place and it will run faster


I can't find a good book on C#?

I tried several books , C# For Dummies excellent until you start the OOP chapters. Poorly explained with bad examples.





C# from Sam's is also ok but when it comes to the OOP it use a lot of math examples and does not make its point.





I got Learning C# 2005 from Oreilly , I had no idea that oreilly books assume a programming background. So that one was also a waste of time





Guys any idea where I could get a good book? I check Amazon and found one from Mr Smiley. It is expensise but I don';t know if it is worth to buy. So far I purchased 4 books none can teach me OOP. I am ok with the loping %26amp; all that though.

I can't find a good book on C#?
Hi Joe,


My site below under Computer Talk has a link to a lot of online free books and tutorials that should help get you headed in the right direction. Hope this helps

tropical flowers

Can someone help me with C++?

Hi, i am just learning C++ and 3d mapping... can someone help me either give me a link or explain how to incoperate the map into C++? i know i sound like a total n00b but please help... thanks in advanced

Can someone help me with C++?
try http://www.cplusplus.com it has a lot of information.
Reply:no


Do you know of a c++ interactive training tool?

Hello there, I've been learning c++ from a couple of book for the last 2 weeks. I've read through about 600 page so far, starting from scratch and doing all the examples in the books.





Its proving to be very very laborious and I also can't really afford £1400 for a 5 day course to cover everything.





What would be really good is an interactive c++ leanrning tool, but I can't find one.





Would you know of one?

Do you know of a c++ interactive training tool?
Yes, we call them compilers. And some of the best are free. Check out the links, compilers, editors, IDEs and tutorials on the URL below.


If you are already using one, that is about as good as anyone can do. Some free advice is this: *SLOW DOWN*. It is better, far better IMHO, in the beginning to work through the examples slowly, modify the code so you get a real idea of which statements and variables create / control /destroy what and a *REAL* working foundation. I don't know if this is your first language or your three hundredth, but C++ is too complex to grasp in 5 days, 5 months or even likely in 5 years. Try backing up and reworking through some other tutorials, then back to the book(s) you've already got. Do you know C? How about the Win32s API? MFC? Free libraries of any kind? It is difficult to give advice to someone not knowing where in the process of learning a language they are at. Stay at it, ask questions (smart ones with enough details) on forums and slow up a bit so it absorbs. Good luck!
Reply:You can buy this book


Its really nice and detailed and most likely, the training program that costs 1400 would use this book as a guide





http://www.deitel.com/books/cppsimply1/
Reply:Not an interactive one but i do have an e-book.


if u want it you can select this as the best answer and mail me at ark_alok@yahoo.co.in with a proper subject.


How to move my " Visual C# Express Edition "(the entire working program) from one sytem to another ?

I am currently learning C# on Visual Studio Express Edition


for few weeks on a system.Now i am in a need to work on


a different sytem in which the program is not installed ;


can i simply copy the "visual studio" from "program files" from one sytem to another , i have come to know that program like this e.g .net sdk have their necessary files distributed at various locations (c:\windows\..etc) %26lt;also i want to mention installation via "http://msdn.." again is not feasible%26gt;


...........so please somebody tell me the detailed list of files i actually need to "copy and paste" for the same task ?

How to move my " Visual C# Express Edition "(the entire working program) from one sytem to another ?
It will be hard to do it this way(not impossible but hard). I will try one more time on a system that have Internet to save the package and then copy it to a system without Internet


Easy c++ game ideas?

i recently started learning c++ 3 days ago and i'm interested in making console based games any ideas for an easy but fun game?





thanx!!

Easy c++ game ideas?
My first computer game program was black jack. Who could resist that?





It's nice because it uses just enough tricks and tools for the new programmer:


- random number generation


- get user input (agree to another card or stay)


- storage array for 5 cards


- a loop for getting the 5 cards, and no more than 5 (rules, right?)


- summing the cards, analyzing if user is over, under, Winner





---Easy to expand on the game as you gain programming proficiency:


- play the dealer (computer, or even 2nd user)


- fancy display of cards, instead of just names/numbers


- sounds and images to signal win or loose...


- develop an array of 52 cards that is randomly sorted and picked off, like a real deck...


- develop a betting/payout system...calc odds so payout stays at 15% like a casino...





If you like math, probability, simple gaming, and gathering experince fast with a game you and others might actually enjoy, this could be it.





you go!
Reply:Seems that you are the very beginner, so start simple.





Then try to make some game which requires handling of random behavior, like playing rock, paper, scissors with computer.


Then try to make Snake. It is easiest thing you can try to do.





The next stage is building world. Try to build simple world using sprites and tiles (square images). The game world dont have to be sophisticated, just static images are enough at first time.





Add player actor into the world try to add motion to it: going left, right, up, down.





The hardest part of making game is to add computer controlled actors cos you should consider many things:


- movement (basic geometrics, calculating angle of movement, angle of firing)


- collision detection (what if two actors collide?)


- action behavior (which requires some AI techniques)


- event response (also AI)








Making games even simple one is not easy task. So start small. Then incrementally upgrade your game.
Reply:number munchers
Reply:I thought about doing this for a while, but never got around too it. Make a MUD ! Its all text based, don't have to worry about graphics at all. The user selects actions based on choices you provide and they type what action they want to do.





Could be a real simple MUD





A) Attack dragon using melee


B) Cast Spell


C) Move RightF


D) Move Left


E) Move up


F) Move Down





I was thinking of doing this and making it real simple. Simple spells and weapons. No inventory would be used. No food.





the only tricky part really would be keeping track of where the player was in the room and navigating around the dungeon.

sound cards

Can C++ be used for video game designing?

I'm learning C++ and am curious as to what would be a fun applictaion for it.

Can C++ be used for video game designing?
Yes, it can, and it most certainly is. About 70 percent of commercial games on the market are made in C/C++.





Then again... 99 percent of statistics are made up. :) Lol





Anyway, game designing is most definately something that you can use C++ for, and is a very common use for it.





Have fun!
Reply:not just video game designing but each and every designing.
Reply:Yes, you can do it via c++ with the help of any supportive languages if you want to more help so visit Given URL below





http://www.commediait.com
Reply:check out Blizzard's job postings, see what they look for from people who apply for their programming positions. You see C++ , C++, C++ all the time. ADVANCED SKILLS in C++, X years of experience in C++.





http://www.blizzard.com/jobopp/