Join the social network of Tech Nerds, increase skill rank, get work, manage projects...

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 265
    Answer it

    Converting a String to Double

    Write a program to read the input amount as a string and parse it to Double using the 'valueOf/parseDouble' method.

    Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, attribute names, and method names should be the same as specified in the problem statement.


    Consider the class BillHeader with the following private members

    Data Type Variable Name
    Date issueDate
    Date dueDate
    Double originalAmount
    Double amountOutstanding

    Include appropriate getters and setters.

    Consider the class Main. It includes the method main,


    • amountOutstanding can be calculated by subtracting the amount paid so far from the original amount
    • All double values should be displayed upto 2 decimal places

    The link to download the template code is given below
    Code Template

    Input and Output Format:

    Refer sample input and output for formatting specifications.

    Sample Input & Output:
    [All text in bold corresponds to input and the rest corresponds to output]

    Enter the issue date as dd/MM/yyyy


    Enter the due date as dd/MM/yyyy


    Enter the original amount


    Enter amount paid so far


    Issue date: 12/07/2015

    Due Date: 21/08/2015

    Original amount Rs.2000.0

    Amount outstanding Rs.1000.0




 0 Answer(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: