Professional Documents
Culture Documents
Jobsheet 6 - M Rizal Al Baihaqi
Jobsheet 6 - M Rizal Al Baihaqi
1. What is the output if the input is 2100? Please explain your answer! How to ensure that output
-Because the first if statement is (year % 4) which mean if year can divided by 4 it’s a leap year,and if its
not leap year(cant divided by 4) print else(not leap year)
-https://github.com/Majid5654/Tugas-kelas/blob/main/pemilihan2perobaan1.java
4. The year 2000 is a multiple of 4 and a multiple of 100, but it is a leap year. So that, there is an
additional rule to determine leap year. If the year is a multiple of 100 and is also a multiple of 400
then that year is a leap year. Modify the program to adjust to these rule! (Create the algorithm
Question 2
1. Modify the source code, so that it can detect the other types of triangles (equilateral triangle and
isosceles triangle)
-https://github.com/Majid5654/Tugas-kelas/blob/main/selection2exp208.java
-Question 3
1. Explain the function of (int) in the syntax netSalary= (int) (income - (income * tax));
Is for narrowing casting type since the variable tax used doubke and we want the calculation to turn out
to be a int
2. Run the program by entering category = BUSINESSMAN and income = 2000000. Observe what
-The equalsIgnoreCase() method in Java is used to compare two strings while ignoring their case
differences. It returns a boolean value of true if the two strings are equal, and false if they are not. This
method is useful when we want to compare two strings without considering their case sensitivity. For
example, if we have two strings "Hello" and "hello", equalsIgnoreCase() will return true when used to
compare them
BUSINESSMAN and income = 2000000. Observe what happens! Why is the result like that? What
-The equals() method in Java is used to compare two strings, and returns true if the strings are equal,
and false if they are not. This method compares the content of the strings, and not their memory
location. It is commonly used to determine whether two objects are considered equal based on their
attributes or properties. The equals() method is defined in the Object class, which is the root class for all
Java classes. If a class needs customized equality comparison, it should override this method
3. Assignment
Create a program code based on the flowchart that was created in the 6th Fundamentals
Programming Course meeting assignment related to the Project! Push and commit the results of your
-https://github.com/Majid5654/Tugas-kelas/blob/main/mod.java