JAVA BLUEJAY PROGRAMMING EXAM 1) Write a class named staff that inherits class person in BlueJay 2) What is the value of the variable named loop and variable named count after the code has run? 3)...

1 answer below »
Hi this is an online timed programming exam on the 18th of August, 2.00pm at perth, Western Australia time. I will send you the questions via a word document file right when the exam starts. You have 2 hours to complete the exam. and please I need the answers below each question on the word document. so it's easier to understand.


JAVA BLUEJAY PROGRAMMING EXAM 1) Write a class named staff that inherits class person in BlueJay 2) What is the value of the variable named loop and variable named count after the code has run? 3) What the output of the following? int a = 8; int b = 2; int c = 5; int d = --a; a =(c--+a)%(b*a); System.out.println("a"+a); System.out.println("d"+(d+a)); 4) Explain why local variables in a method cannot be used in other methods. 5) Create a new object type of car class include car make, car weight 6) Write a loop to print string fruits = apple mango pear banana cherry in java BlueJay in ascending order. 7) How to sort an ArrayList in java BlueJay? 8) Import java.util.* string fruits = apple mango pear banana cherry in java BlueJay and terminate a loop. 9) What keyword is used to immediately terminate a loop in java? 10) What keyword is used to refer to a current object or instance variable? 11) Give an example of constructor overloading for a class student in java BlueJay. 12) Write a code for HashSet integer myhash set new hashset println size in java BlueJay. 13) What will be the output of the println statement of hash size? 14) Write a code to loop through the above hashset and print the values using java.util.iterator. 15) Write the String abracadabra abracadabra output in java BlueJay. 16) Write a declaration of a new hash map called room. 17) Write a MessagePost PhotoPost class code java BlueJay. 18) Convert the following code segment into an equivalent while loop for (int i =100; i> 0;i--) {System.out.println("i"+i);} 19) Write a method called whichnumbermonth as a parameter and returns an integer. 20) Provide two examples of selection control structure. 21) Provide two examples of iteration control structure. 22) Relationship between coupling and information hiding. 23) Difference between array and ArrayList and when to use them. 24) keySet() method belong to which class? 25) Which class does contains() method belong to? 26) Write a code to import names from a test fie in java BlueJay. 27) Create a program that would receive the following characters names from a text file and then print them onto the terminal window in a reverse order. Write a method countVowel() to count how many vowels in each character name (20 marks) 28) Create a java program that would allow the user to read the first ten numbers from a file and remove duplicate numbers and print the sum, average, highest number and lowest number. (20 marks) 29) Write a class called shape in java representing a rectangle s is a shape representing a square and c is a shape representing a circle. (20 marks) 30) Write a program that integer input and print the numbers in java BlueJay. (20 marks) 31) Write a java code to store a room name as the key and its locked status as the value. (Hash map) (20 marks)
Answered Same DayAug 12, 2021

Answer To: JAVA BLUEJAY PROGRAMMING EXAM 1) Write a class named staff that inherits class person in BlueJay 2)...

Arun Shankar answered on Aug 18 2021
158 Votes
// This is the code for Q5.
public class Animal
{
    char gender;
    double weight;
    
    // Construc
tors for the class
    public Animal(char a, double b)
    {
        if((a!='M') && (a!='F'))
            return;
        if((b>500) || (b<1))
            return;
        gender = a;
        weight = b;
    }
    
    // A constructor with...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here