Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • CONVERTING A STRING TO DOUBLE

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 233
    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,

    Note:

    • 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

    12/07/2015

    Enter the due date as dd/MM/yyyy

    21/08/2015

    Enter the original amount

    2000

    Enter amount paid so far

    1000

    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
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
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: