Starting from:
$30

$24

CSE1141 Programming Assignment #1

    1. Write a program that converts the date, which is given in days, to “Year: <years>, Mount:

<mounts>, Day: <days>” format.

        ◦ 1 year has 365 days, 12 mounts

        ◦ 1 mount has 31 days

        ◦ Test your program to be sure it works on different values


Example Run 1






Example Run 2






Example Run 3










    2. Write a program that will calculate the compound monthly interest. The program asks user to enter value of principle (p), annual interest rate (r) and time (t) and finally calculates the
compound interest by following formula.
=    ∗(1+12)


A: Final amount

    P: Initial principle balance r: interest rate

t: number of time periods (in terms of months)
    • Test your program to be sure it works on different values

    • The annual interest rate is a number in percent format (9.45%)

    • Print output values with up to 2 digits after the decimal point.



Example Run 1













Example Run 2













Example Run 3















Important Notes:
    • The outputs of your programs must be the same as the examples above.

    • Only parts selected from the selected questions will be graded. So if you send only one program, you might get a grade of 0 based on our evaluation.

    • Please be sure that your programs should run properly on both your computer and a different computer.

Submission Instructions

Please zip and submit all your files using filename YourNumberHW1.zip (ex: 150713852HW1.zip) to Canvas system (under Assignments tab).

Your zip file should contain the followings:

    1. Java source code for Problem 1 (Pro1_yournumber.java)
    2. Java class file for Problem 1 (Pro1_ yournumber.class)
    3. Java source code for Problem 2 (Pro2_ yournumber.java)
    4. Java class file for Problem 2 (Pro2_ yournumber.class)

Notes:

    1. Write a comment at the beginning of each program to explain the purpose of the program. Write your name and student ID as a comment. Include necessary comments to explain your actions.

    2. Select meaningful names for your variables.

    3. You are allowed to use the materials that you have learned in lectures & labs.

    4. Do not use the things that you did not learn in the course.

    5. Each student should submit his/her own homework. You can discuss with your peers about the homework but you are not allowed to exchange code or pseudocode. This also applies to material found on the web. Should some submitted homework assignments be identical or suspected to be identical, all involved parties will get a grade of ZERO from all homework. In case of any forms of cheating or copying, both giver and receiver are equally culpable and suffer equal penalties.

    6. No late submission will be accepted.

More products