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

Join 108,957 C++ Programmers for FREE! Ask your question and get quick answers from experts. There are 1,562 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Mortgage solver

 
Reply to this topicStart new topic

Mortgage solver, help me to convert this to c and pascal please............

zkim
post 12 Mar, 2008 - 11:36 PM
Post #1


New D.I.C Head

*
Joined: 11 Mar, 2008
Posts: 6


My Contributions


CODE

class mort {
    public static void main(String arg[]) throws IOException


        {
        BufferedReader stdin =
        new BufferedReader ( new InputStreamReader (System.in));
        DecimalFormat twoDigitsPastPoint = new DecimalFormat("0.00");
        String get_Balance,get_Annual,get_Payment;
        int J, Month;
        double Annual_Rate=0.00, Balance=0.00, Interest=0.00;
        double Payment=0.00, Monthly_Rate=0.00;
        System.out.print("\t ==MORTGAGE SOLVER VERSION 1.0==");
        System.out.print("\n\n");
        System.out.print("WHAT IS THE CURRENT MORTGAGE BALANCE? :=> $ ");
        get_Balance = stdin.readLine();
        Balance = Double.parseDouble(get_Balance);
        System.out.print("WHAT IS THE ANNUAL INTEREST RATE? :=> % ");
        get_Annual= stdin.readLine();
        Annual_Rate = Double.parseDouble(get_Annual);
        System.out.print("WHAT IS THE MONTHLY PAYMENT? :=> $ ");
        get_Payment= stdin.readLine();
        Payment = Double.parseDouble(get_Payment);
        // Computation Routine
        Monthly_Rate = (Annual_Rate / 12.0);
        Monthly_Rate = (0.01 * Monthly_Rate);
        System.out.print("\n");
        System.out.print("\tTHE NEXT 12 MONTHS ");
        System.out.print("\n");
        System.out.print(" MONTH INTEREST BALANCE\n");


            for (J=1; J<=33; J++) {
            System.out.print("-");
        }
        System.out.print("\n\n");


            for (Month=1; Month<=12; Month++) {
            Interest = (Monthly_Rate * Balance);
            Balance += Interest - Payment;
            System.out.println(Month + " " + twoDigitsPastPoint.format(Interest)
            + "" + twoDigitsPastPoint.format(Balance));
        }
        System.out.print(" === END OF COMPUTATION === ");
    }
} // END OF CODE
User is offlineProfile CardPM

Go to the top of the page


MarkoDaGeek
post 13 Mar, 2008 - 10:56 AM
Post #2


Dirty Technophile

Group Icon
Joined: 13 Oct, 2001
Posts: 10,796



Thanked 1 times

Dream Kudos: 970

Expert In: Computer Networking, Web Development, Blogging

My Contributions


Moved to C.
User is offlineProfile CardPM

Go to the top of the page

Amadeus
post 13 Mar, 2008 - 11:01 AM
Post #3


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 11,775



Thanked 17 times

Dream Kudos: 25
My Contributions


We'd be pleased to help. What have you got so far?
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 9/4/08 09:29PM

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