الرجاء المساعدة في حل هذه الاسئلة
R-1.1
Suppose that we create an array A of GameEntry objects, which has an integer scores field, and we clone A and store the result in an array B. If we then immediately set A [4].score equal to 550, what is the score value of the GameEntry object referenced by B[4]?
R-1.6
Write a short Java function, inputAllBaseTypes, that inputs a different value of each base type from the standard input device and prints it back to the standard output device.
R-1.7
Write a Java class, Flower, that has three instance variables of type String, int, and float,which respectively represent the name of the flower, its number of pedals, and price. Your class must include a constructor method that initializes each variable to an appropriate value, and your class should include methods for setting the value of each type, and getting the value of each type.
R-1.8
Write a short Java function, isMultiple, that takes two long values, n and m, and returns true if and only if n is a multiple of m, that is, n = mi for some integer i.
R-1.9
Write a short Java function, isOdd, that takes an int i and returns true if and only if i is odd.Your function cannot use the multiplication, modulus, or division operators, however.
R-1.10
Write a short Java function that takes an integer n and returns the sum of all the integers smaller than n.
R-1.11
Write a short Java function that takes an integer n and returns the sum of all the odd integers smaller than n.
C-1.1
Write a short Java function that takes an array of int values and determines if there is a pair of numbers in the array whose product is odd.
C-1.2
Write a Java method that takes an array of int values and determines if all the numbers are different from each other (that is, they are distinct).
C-1.4
Write a short Java program that outputs all possible strings formed by using the characters 'c', 'a',
'r', ' b', ' o', and 'n' exactly once.
C-1.6
Write a short Java program that takes two arrays a and b of length n storing int values, and returns
the dot product of a and b. That is, it returns an array c of length n such that c = a · b, for i =0,… ,n − 1.
Projects
P-1.1
A common punishment for school children is to write out a sentence multiple times. Write a Java stand-alone program that will write out the following sentence one hundred times: "I will neverspam my friends again." Your program should number each of the sentences and it should make eight different random-looking typos.
ولكم مني جزيل الشكر
