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

Join 86,399 C++ Programmers. There are 1,459 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a C++ Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

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



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
+Quote Post


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


Dirty Technophile

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

Moved to C.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

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


g++ -o drink whiskey.cpp

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

We'd be pleased to help. What have you got so far?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
Time is now: 5/17/08 06:12AM

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