Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,387 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,214 people online right now. Registration is fast and FREE... Join Now!




C++ help please

 
Reply to this topicStart new topic

C++ help please, call class?

tyserman474
post 22 Aug, 2008 - 10:15 AM
Post #1


New D.I.C Head

*
Joined: 28 Mar, 2008
Posts: 49

Hi all,
I am really having some problems, have worked on it for 4 days now.
CODE

#include <iostream>  
    #include <iomanip>  
    #include <math.h>  
    #include <stdlib.h>  
    #include<cctype>
    #include <stdio.h>
    using namespace std;
    
    class mortgageCal
    {
    private:
    double intYear;
    public:
        class mortgageCal () : intYear(){};

    double loanAmt();       // amount of the loan  
    double term();        // term in years  
    double numMonths();     // term converted to months  
    double intMonth();      // interest converted to months  
    double paymentAmt();       // variable for monthly payment  
    double balance();       // running total  
    double principleAmt(); // amount towards loan  
    double amtMortgage();   // total amount to be paid back  
    };
    template<class T>
    double  getIntInPut(T loanAmt, T term, T intYear);  
    
    int  main()
    {
    mortgageCal mortCalc;


I have to have the class and under the main when I called the
mortgageCal mortCalc;
I thought that it would include my public file but when I compile it I get "undeclared identifier". Can I get someone to push me in the right direction to get the public files into my main folder. I just can't seem to figure out how, like I said, I have been working on this for 4 days now.
Thanks
User is offlineProfile CardPM

Go to the top of the page

red_4900
post 22 Aug, 2008 - 11:12 AM
Post #2


Code Dreamers

****
Joined: 22 Feb, 2008
Posts: 791



Thanked 10 times
My Contributions


I'm not too sure of this myself. Just trying. Check your constructor. I think the problem lies there. Other than that, I don't think there's any problem.

And it would have been preferable if you posted your whole code so that we can try to compile it ourselves and figure out what went wrong in your code.

Hope that helps. smile.gif
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/22/08 06:59AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month