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

The _______ operator has the highest precedence. * dot +- decrement Answer: When

ID: 3803079 • Letter: T

Question

The _______ operator has the highest precedence. * dot +- decrement Answer: When the number of repetitions are known in advance, you should use a _______ while do... while for None of the above Answer: Good debugging techniques include: Inserting output statements in your program. Tracing variables Using an IDE debugger All of the above Answer: The new operator: allocates memory is used to create an object of a class associates an object with a variable that names it. All of the above. Answer: When the parameters in a method have the same as instance variables you can differentiate them by using the _______ parameter. String hidden default this Answer: The name of a method and the list of ______ types in the heading of the method definition is called the method signature. parameter argument return primitive Answer: Static variables arc often used: in arithmetic expressions to communicate between objects within looping structures all of the above Answer: All of the following are wrapper classes except: Siring Integer Character Double Answer: The correct syntax for accessing the length of an array named Numbers is: Numbers.length() Numbers.length both A and B none of the above Answer: The base type of an array may be all of the following but: string boolean long all of these may be a base type of an array. Answer: Inheritance is the process by which a new class-known as a ______ is created from another class, called the ______. base class, derived class derived class, base class inherited class, base class base class, inherited class Answer: The keyword extends indicates: encapsulation polymorphism inheritance none of the above Answer: The special syntax for invoking a constructor of the base class is: super() base() parent() child() Answer: ______ refers to the ability to associate many meanings to one method name by means of the late binding mechanism. Inheritance Encapsulation Polymorphism None of the above Answer: You cannot create an object using a/an: superclass constructor subclass constructor ancestor class constructor abstract class constructor Write a complete Java program that prompts the user for a series of numbers to determine the smallest value entered. Before the program terminates, display the smallest value Write Java code that uses a do... while loop that prints even numbers from 2 through 10. Write a method called power the computes x^n where x and n and positive integers. The method has two integer parameters and returns a value of type long. Create a class named Appointment that contains instance variables startTime, endTime, dayOfWeek (valid values arc Sunday through Saturday), and a date which consists of a month, day and year. All times should be in military time, therefore it is appropriate to use integers to represent the time. Create the appropriate accessor and mutator methods. Create a Java class named Book with instance variables title, author, ISBN, and yearPublished, Include javadoc style comments to describe your interface. Such a class would normally have methods, but you are not required to supply any methods. Add accessor and mutator methods to the Book class created in question #13. Add a constructor and a copy constructor to the Book class created in question #13. Write a Java method that takes an integer array as a formal parameter and returns the sum of integers contained within the array. Declare and create a 10 times 10 multidimensional array of doubles. What is the output of the following code? Declare and create a 10 times 10 multidimensional array of doubles. What is the output of the following code? ini[] numbers = new int[10]; for(int i=0; i

Explanation / Answer

Soution for 16th Question:

import java.util.Scanner;
public class smallestNumber
{
public static void main(String[] args)
    {
        int small=0,num;
        System.out.print("Enter the how many numbers you enter: ");
        Scanner input=new Scanner(System.in);
        int n=input.nextInt();
        for(int i=0;i<n;i++)
        {
        System.out.print(" Enter number-"+(i+1)+": ");
        num=input.nextInt();
        if(i==0)
            small = num; //First number assigning to variable small
        if(num<small) //Here checking the condition if any smallest idetified
          {
           small=num;
          }
}

Solution for 17th Question:

import java.util.Scanner;
public class HelloWorld
{
public static void main(String[] args)
    {
        int num = 2;
        Scanner input=new Scanner(System.in);
        System.out.println("Evennumbers between 2 to 10 are: ");
        do
        {
        if(num%2 == 0)   //Here condition checking if number is divisible by 2 or not.
            System.out.println(num);
            num = num+1;
        }while(num<=10);
    }
}
System.out.println(" Smallest number of entered "+n+" numbers: "+small);
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote