Insert the missing code in the following code fragment. This fragment is intended to implement a method to set the value stored in an instance variable. Public class Employee
{
Private String empID;
Private boolean hourly;
) . .
_______
{
Hourly = isHourly;
}
}
A) public void setHourly(String isHourly)
B) public void getHourly()
C) public boolean getHourly()
D) public boolean setHourly(boolean isHourly)

Answers

Answer 1
Answer:

Answer:

A)

Explanation:

In this code example the missing piece of code would be...

public void setHourly(String isHourly)

This piece of code is creating a function called setHourly which takes in one String variable as it's parameter. Based on the rest of the code, the function takes that parameter variable and places it into an instance variable called Hourly which can be used when the function is called.


Related Questions

Which technology is suitable to cover the whole city for internet?​
What error can you identify? (Points : 4)A double quotation mark was incorrectly inserted.You cannot compare apples to oranges.Assumes indentation has a logical purposeNo error
Volume of Pyramid = A*h/3 where A is the area of the base of the pyramid and h is the height of the pyramid. Write a C++ program that asks the user to enter the necessary information about the pyramid (note that the user would not know the area of the base of the pyramid, you need to ask them for the length of one of the sides of the base and then calculate the area of the base). Using the information the user input, calculate the volume of the pyramid. Next display the results (rounded to two decimal places). Example Output (output will change depending on user input): The area of the base of the pyramid is: 25.00 The height of the pyramid is: 5.00 The volume of the pyramid is: 41.67 *Pseudocode IS required for this program and is worth 1 point. The program IS auto-graded.
Expressions Write a console program that prompts the user for 3 double precision floating point values input1, input2, input3. Have the program compute and display the following values. the sum of input1, input2, input3 the average of input1, input2, input3 the log2 of input1 To access the built-in function log2 -- log2(X) computes the base 2 logarithm of X, you need to include the header at the top of your code.
A retail company assigns a $5000 store bonus if monthly sales are $100,000 or more. Additionally, if their sales exceed 125% or more of their monthly goal of $90,000, then all employees will receive a message stating that they will get a day off. When your pseudocode is complete, test the following monthly sales and ensure that the output matches the following. If your output is different, then review your decision statements.Monthly Sales Expected Output monthlySales 102500 You earneda $5000 bonus! monthlySales = 90000 monthlySales 112500 You earned a $5000 bonus! All employees get one day off!

Define a function that takes two arguments: a string called strText and a number called intNumber. This function will use a repetition structure (a While or For loop) to print strText intNumber of times. Call this function.

Answers

Answer:

public class Main

{

   public static void printString(String strText, int intNumber) {

       for(int i=0; i<intNumber; i++){

           System.out.println(strText);

       }

   }

   

public static void main(String[] args) {

       

       printString("Brainly", 3);

}

}

Explanation:

- Define a function called printString that takes two parameters - a String and an int. Since the function will print out the given String, it's type will be void.

- Use for loop to iterate according to the given number and print the given string

- In the main, call the printString function with some parameters.

Answer:

// Class declaration

public class Printer {  

   // Define the function and call it printMany

   // The return type is void since it doesn't necessarily return any value.

   // It just prints to the console.

   // It takes two arguments strText of type String and

   // intNumber of type int.

  public static void printMany(String strText, int intNumber){          

       // Initialize the loop counter i to 1;

       int i = 1;

      //Create a while loop that goes

      // from i = 1 to  i = intNumber.

      // Where intNumber is the number of times the string strText

      // will be printed.

      while(i <= intNumber) {

           

           // At each of the cycle of the loop;

           // print out the string strText

           // and increment the value of the loop counter by 1

           System.out.println(strText);

           i++;

       }                 // End of while loop

   }               // End of method, printMany, declaration

// Write the main method to call the printMany function

public static void main(String[] args) {

       // Call the printMany function by supplying sample arguments;

       // In this case, strText has been given a value of "Omobowale"

       // And intNumber has been given a value of 4

       // Therefore, "Omobowale" will be printed 4 times.

       printMany("Omobowale", 4);

   }            //  End of main method

}          // End of class declaration

Sample Output:

When the program above is run, the following will be the output;

----------------------------------------------------

Omobowale

Omobowale

Omobowale

Omobowale

-------------------------------------------------------

Explanation:

Comments:

* The above code has been written in Java

* The code contains comments explaining every part of the code. Kindly go through the comments.

The whole code without comments is re-written as follows;

public class Printer {      

   public static void printMany(String strText, int intNumber){    

       int i = 1;

       while(i <= intNumber){

           System.out.println(strText);

           i++;

       }

   }      

   public static void main(String[] args) {

       printMany("Omobowale", 4);

   }

}

What effects convert colors in a picture to a wide variety of hues?

Answers

I believe it's color saturation.

In cell B13, create a formula without a function using absolute references that subtracts the values of cells B5 andB7 from cell B6 and then multiples the result by cell B8. please help with excel!! I'm so lost

Answers

Answer:

The formula in Excel is:

=($B$6 - $B$5 - $B$7)* $B$8

Explanation:

Required

Use of absolute reference

To reference a cell using absolute reference, we have to include that $ sign. i.e. cell B5 will be written as: $B$5; B6 as $B$6; B7 as $B$7; and B8 as $B$8;

Having explained that, the formula in cell B13 is:

=($B$6 - $B$5 - $B$7)* $B$8

Write structured pseudocode to show the following: when you are on time for work you have time to buy coffee

Answers

Answer:

If( on_time == True) {

     print("Coffee")

} else {

    print("No Coffee")

}

Explanation:

Step 1 evaluate with a boolean variable if you are on time

If( on_time == True) {

Step 2 if true you have coffee

print("Coffee")

Step 3 if false you have not coffee

print("No Coffee")

Before a structure can be used, it must beA.
declared

B.
deallocated

C.
initialized

D.
All of the above

Answers

Answer:

A. declared

Explanation:

Before a structure can be used, it must be  declared.

For example:

// Structure definition

struct s{

int a;

char b;

};

// Structure instantiation

struct s  mystruct;

// This is where a structure instance called mystruct is created whose

// datatype is struct s.

mystruct.a = 10;

mystruct.b = 'c';

As we can see from the example definition precedes use for the structure.

Use the STL class vector to write a C function that returns true if there are two elements of the vector for which their product is odd, and returns false otherwise. Provide a formula on the number of scalar multiplications in terms of n, the size of the vector, to solve the problem in the best and worst cases. Describe the situations of getting the best and worst cases, give the samples of the input at each case and check if your formula works. What is the classification of the algorithm in the best and worst cases in terms of the Big-O notation

Answers

Answer:

Code is provided in the attachment form

Explanation:

Vector Multiplication code:

Vector_multiplication.c file contains C code.

See attachment no 1 attached below

Classification of Algorithm: For creating elements in vector c of size n, number of scalar  multiplications is equal to n. The size of original two vectors scales directly with the number of  operations. Hence, it is classified as O(n).