hello, I am back again asking for help. This is my last project and need extreme help!
this is the question:
Write a program that will calculate the simple interest (I =P*R*T) of an item. P is Principal, R is interest rate, and T is number of years. You will ask the user for input of P, R, and T, then based on that caluclate simple interest, I, and print to the screen. Save the program as ACT 7
No offense lilrj, but if you can't code a program that multiplies 3 numbers and prints the result you really shouldn't pass your class. Have you tried at all? We are very happy to help those who are actually trying to learn but you appear to be asking us to help you cheat!
ya thats true man, if you don't give it a go there is no way you can learn. am also a newbie but i do try my best and if things get block and i cant do it anymore i then seek for help
Nice attempt but I see a few issues. Did you get this to compile and run???
We may have different compilers but normally you need to specify the namespace for cout and cin. For example: std::cout << "Enter a Number:";
You can also put usingnamespace std; before your main(). That will automatically add it for the rest of you code. Some people like using this but others (like me) would rather specify the namespace manually to avoid possible clashes.
Also, interest rate should technically be a float since it's a percentage. The way you have it now the user would have to know that 18% should be entered as the integer 18. Most people would assume that they should enter .18 (which would be a percentage). Not a big deal though.
I would also add something like: cout << "Your calculated interest rate is: "; before you output the result (cout << I;) just to make it clear.
I'm glad you worked this through yourself. It's really the only way to learn to code. Youtube has some great tutorial videos so keep that up too.
BTW, if you select your code in a post and click the <> button to the right it will format your code to look good on this forum.