Welcome to Dream.In.Code
Become a C++ Expert!

Join 136,947 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,870 people online right now. 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
12 Mar, 2008 - 10: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
+Quote Post

MarkoDaGeek
RE: Mortgage Solver
13 Mar, 2008 - 09:56 AM
Post #2

Dirty Technophile
Group Icon

Joined: 13 Oct, 2001
Posts: 10,906



Thanked: 1 times
Dream Kudos: 970
Expert In: Computer Networking, Web Development, Blogging

My Contributions
Moved to C.
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Mortgage Solver
13 Mar, 2008 - 10:01 AM
Post #3

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,228



Thanked: 40 times
Dream Kudos: 25
My Contributions
We'd be pleased to help. What have you got so far?
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/3/08 11:26PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month