You are on page 1of 2

CMPE 101: Object Oriented Programming

Homework 01

Deadline: 25.03.2021 19:00

RULES

• Students have to do both: submit their code and attend the test. In case of lack of
one, the student will not be graded.

• Codes without documentation (comments) will not be evaluated.

• This work is an individual study. Plagiarism is strictly prohibited, involved students


will get zero.

CODE SUBMISSION

• Students should write and submit their code in one java file.

• Code Submission slot will be available under Weekly Content/Homeworks folder as


”Homework01 Code Submission”.

• Solution without comments will not be evaluated.

• The code submissions whose students did not attend the test will not be evaluated.

• Late submissions will not be accepted. Submission system will be closed after deadline.
Submissions via e-mail will not be accepted.

TEST

• Test will be held on 25th March between 19:00 and 23:30.

• Test slot will be visible under Weekly Content/Homeworks folder as ”Homework01 Test”
on 25th March 19:00.

• Students can attend any time at this time duration. After 23:30, students will not
able to attend the test.

• The duration of the test will be 30 minutes. Be sure that you saved your answers
during the test.

• Questions in the test will be about the codes written. Be prepared before the test,
e.g. open your Eclipse etc.

• In the test, questions may ask to manipulate your code or test your code with different
values. Be sure that your codes are dynamic for changes.

1
QUESTIONS

Part I
(40 points)
Write a program that calculates the result of following function of given x:
x
X
f (x) = f (k − 1) + (−1)k .f (k − 2) + x
k=1

where f (−1) = 0 and f (0) = 0.

Part II
(40 points)

Implement the Newton’s Algorithm to find cube-root ( 3 n) of a given number. The number
of iteration and initial value (x1 ) should be determined by user.

You can refer here for Newton’s Algorithm: https://youtu.be/FMCOebUGG94

Part III
(20 points)
Write a program that finds summation of all factors of a given number x. For example, the
factors of 18 is {1, 2, 3, 6, 9, 18}, so the summation is 39.

You might also like