- A.
Write code to print out the following graph.
- B.
Write code to draw the following shape.
- C.
Write code to make this triangle.
- D.
Write a function to check if an integer is divisible by another integer.
For example:
(1) Given input 10, 5, output is “yes, 2”;
(2) Given input 11, 2, output is “no”;
- E.
Write Java code to draw the Christmas tree.
- F.
Write code to find all factors for a given positive integer.
For example, when a user inputs “10,” your program should output 1, 2, 5, 10
- G.
Write a method that accepts a month (i.e., an integer between 1 and 12) as a parameter and returns the number of days in that month in the current year.
- H.
Write code to produce a product of two numbers that are inputs from the console:
Please enter two numbers for multiplication
Next number --> 7
Next number --> 15
Product = 105
- I.
Write a method to examine whether a positive integer is a prime number or not.
- J.
Write a method to convert an integer number to a string of that number's representation in binary. For example, given a parameter “19,” it should return “10011”.