Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ssignments Section 1.1> 1. What is the difference between an object and a class?

ID: 3748666 • Letter: S

Question

ssignments Section 1.1> 1. What is the difference between an object and a class? Give some examples. 2. According to the application, how many days are between 1/1/1900 and 1/1/2000? How many leap years are there between those dates? What about between 1/1/2000 and 1/1/2100 Explain the differences in these answers 3. Use the DaysBetween application to answer the following: a. How old are you in days? b. How many days has it been since the United States adopted the Declaration of Independence, an July 4, 1776 . How many days between the day that jean-Francois Pilatre de Rozier and Francols Laurent became the first human pilots, traveling 10 kilometers in a hot air Paris and the day Neil Armstrong took one small step onto the moon, at the Sea of Tranquility, on july 20, 19697 1783, near t anta O Type hese to search

Explanation / Answer

1. Object vs Class

Class is a template which holds state(fields), behaviour(methods) of objects.

An object is an instance of a class which has values for their states and corresponding behaviour.

Example:

Person is a class which holds name, age. class person { String name; int age; }

Person p1 = new Person("john", 21); Here p1 is an object whose name is john and age is 21.

2)

a,b) There are 25 leap years in both the cases.

c) Difference in answers:

In the first answer, 1900 is not an leap year. Because it is not divisible by 400.

Others are divisible by 4. Similarly 2000 is leap year because divisible by 4 but 2100 is not leap year as same reason as 1900.

We are allowed to answer only 4 sub parts. If you have more, please post another question. In case of any doubts, please comment.