October 15th, 2010, 02:07 PM
First Practice Program need help...C++
Need help with simple code for calculating interest...not compound....yet. Can not figure out what code is needed to change the -double percent- to a -decimal-.
Giving me a error:
------ Build started: Project: Practice_Work, Configuration: Debug Win32 ------
Practice_Work.cpp(24): error C2440: '=' : cannot convert from 'System:ecimal' to 'double'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Here is the Code i have written so far:
// Practice_Work.cpp : main project file.
// calculating intrest over one fixed period
using namespace System;
using namespace std;
double number= 0.0;
double percent= 0.0;
double difference= 0.0;
double sum= 0.0;
//Algorithms: assigning intergers to variables
Console::WriteLine("Enter Amount: ");
Console::WriteLine("Enter Intrest Rate: ");
//Calculations for solving the algorithm
sum= number + difference;
//Printing out the results
Console::WriteLine("Total amount after intrest equals: ",Convert::ToString(sum));
October 15th, 2010, 04:46 PM
October 15th, 2010, 04:58 PM
Re: First Practice Program need help...C++
OOPS haha Thanks for that help, I will move it to there. And thanks again, gad to finally join a forum.
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.