Questions
Please I need answer for all four questions please. ONLY ANSWER IF YOU CAN BE ABLE...

Please I need answer for all four questions please. ONLY ANSWER IF YOU CAN BE ABLE TO ANSWER TO 4 QUESTIONS. I DONT REALLY NEED LONG ANSWERS.

1.Describe why your nested Virtual Machine has a different DHCP server from your HOST Virtual Machine.

2. Describe why you would set your VM up using the host-mode network.

3. What is the difference between physical core and logical processors

4. What is memory ballooning and how should it be used in virtualization?

THANKS

In: Computer Science

a) Explain the relationship between "programming to interfaces" and "loose coupling," why we care about these...

a) Explain the relationship between "programming to interfaces" and "loose coupling," why we care about these two things, and why it is not possible to create completely decoupled code.

b) Given the fact that we care about these two concepts, why might this imply that the new operator is problematic for creating flexible code?

In: Computer Science

This is the question about Verilog. the H/W question is "Explain about 'always syntax' in verilog...

This is the question about Verilog.

the H/W question is "Explain about 'always syntax' in verilog with the simple verilog example."

  

In: Computer Science

Learning Objectives Writing classes that represent objects Define object's state (Instance variables) Define objects constructors Write...

Learning Objectives

  • Writing classes that represent objects
  • Define object's state (Instance variables)
  • Define objects constructors
  • Write getter (accessor) and setter (mutator) methods.

As in previous labs, please write the Java code for each of the following exercises in BlueJ. For each exercise, write a comment before the code stating the exercise number.

Make sure you are using the appropriate indentation and styling conventions

Exercise 1 (15 Points)

  • In BlueJ, create a new project called Lab5
  • In the project create a class called DogDemo with a static method called makeDogs
  • Create a second class in the same project called Dog that will represent a single dog (just a class header and an empty body for now).
  • In the makeDogs method, create a Dog object called myDog. Note that the Dog and DogDemo classes are now connected by a dotted arrow in the project window to show that DogDemo depends on (uses) the Dog class.

Exercise 2 (20 Points)

  • In the Dog class, create a variable at the class level (also called instance data or a field) that will represent the dog's name (a String).
  • Declare this variable as private. This puts the Dog class in charge of how the name gets updated. This variable is not DIRECTLY accessible from outside the Dog class.
  • In the declaration of the variable, initialize it to "Lassie".
  • Create a toString method that returns the dog's name.
  • In the makeDogs method of the DogDemo class, print the Dog object you created. Run the makeDogs method.

Exercise 3 (15 Points)

  • This would be OK if all dogs were named Lassie!! Each instance of Dog (each Dog object) will have its own name variable, which contain different values. So create a constructor in the Dog class that accepts a parameter which is used to set the name variable.
  • In the makeDogs method, create a new dog and pass in the name "Lassie" to its constructor.
  • Create a second Dog object with a different name, "Rover" for example.
  • Print the two dog objects.

Exercise 4 (15 Points)

  • Add another field to the Dog class representing the dog's breed (a String) and one representing the dog's age (an int). Both fields should be private.
  • Modify the Dog constructor to set these values as well, based on parameters.
  • Define a new Dog objects in makeDogs and give them a name, breed and age.
  • Modify the toString method to return a string in the following form:

Fido is a 3-year-old German Sheppard

  • Test the updated makeDogs method. Think through what is happening at each step.

Exercise 5 (10 Points)

  • Add standard "getter" methods for all three fields. Remember that getter methods just returns the value of a private instance variable (field). This will make the value of a private variable accessible ONLY through this method.
  • In the makeDogs method, get and print just the breed of one of your created objects.
  • Then get and print just the name of another one of the created objects.

Exercise 6 (10 Points)

  • In Dog, add a "setter" method for the age field. Don't change the age if the parameter is less than 1.
  • In the makeDogs method, try to set the age of yourDog to 0, then print the Dog object to make sure the age did not change.
  • Then set the age of yourDog to 4 and print it again.

Exercise 7 (15 Points)

  • You may have heard the expression "That's 21 in dog years" or something similar. The idea is to come up with a number to make it easy to compare a dog's age to that of a human in terms of overall life span. The calculation used is real age multiplied by 7. So a dog that's 3 years old is "21 in dog years".
  • Add a method in Dog called getDogYears that returns the dog's age in dog-years. Do NOT create another field for this. Just return the dog's current age multiplied by 7.
  • In the makeDogs method, print each dog's age in dog-years:

Rover is 28 in dog-years.

In: Computer Science

Given the python code below, show output: class MyClass: i = ["1010"] def f(self, name): self.i.append(str("470570"))...

Given the python code below, show output:

class MyClass:

i = ["1010"]


def f(self, name):

self.i.append(str("470570"))

self.name = name

return 'CPS'

if __name__ == "__main__":

x = MyClass()   

print(x.f("U"))   
print(x.name)   
print(x.i)      

y = MyClass()  

print(y.f("D"))   
print(y.name)  

print(y.i)

In: Computer Science

1. what mask in register F would cause the Simple Assembler instruction [and RA, RA, RF]...

1. what mask in register F would cause the Simple Assembler instruction [and RA, RA, RF] to put 0 in the most significant bit of register A without disturbing the other bits?

2. Suppose registers E and F contained AA and CC, respectively. What bit pattern would be in register D after executing the Simple Assembler instruction [xor RD,RE,RF]?

3. Suppose registers E and F contained AA and CC, respectively. What bit pattern would be in register D after executing the Simple Assembler instruction [and RD,RE,RF]?

4. If registers 0 and 1 contain the patterns B5 and F0, respectively, what will be in register 1 after executing the Simple Assembler instruction [move R0,R1]?

In: Computer Science

n = int(input("Enter any number: ")) sum1 = 0 for i in range(1, n): if(n %...

n = int(input("Enter any number: "))
sum1 = 0
for i in range(1, n):
    if(n % i == 0):
        sum1 = sum1 + i
if (sum1 == n):
    print("The number is a Perfect number!")
else:
    print("The number is not a Perfect number!")

taking the code above, how would i create a new function that calls the program above and finds all perfect numbers within a certain range? the function would accept two parameters, the two ranges, and use a for loop to call the function above and print out all perfect numbers within a certain range (Ex. 1,100)

In: Computer Science

Refactor the code below so that it isn't awful! Justify your design decisions! public class BrownBear...

Refactor the code below so that it isn't awful! Justify your design decisions!

public class BrownBear {
  public String roar(){
    return "bear";
  }
}

public class SilentBrownBear {
  public String roar(){
    return "";
  }
}

public class PolarBear {
  public String roar(){
    return "brrrr";
  }
}

public class SilentPolarBear {
  public String roar(){
    return "";
  }
}

In: Computer Science

Based on what you know about object oriented programming, inheritance, and polymorphism, why do you think...

Based on what you know about object oriented programming, inheritance, and polymorphism, why do you think it is not possible to write code like this in Java:

public class X extends Y, Z {
  // ...
}

...but can write code like this:

public class A implements B, C {
  //...
}

In: Computer Science

c program Identify type of library file that need to be used when the program needs...

c program

  1. Identify type of library file that need to be used
    1. when the program needs to returns the absolute value of its integer argument such as : if x is -5, abs(x) is 5.
    2. When the program needs to return a randomly chosen integer between 0 and the value associated with RAND_MAX,
    3. When the program needs to return the base-10 logarithm of x for x>0.0: example if x is 100.0, log 10(x) is 2.0

In: Computer Science

declare an integer array of n numbers //enter a value for n before the declaration enter...

declare an integer array of n numbers //enter a value for n before the declaration

enter values for the declared array, pass the array to the method that has the name "countNumbers"

let the function countNumber count how many elements of the array in the interval
[70 90] means between 70 and 90 inclusive, returns this count to the main, and prints it using format printing.

---------------
Please Solve As soon as
Solve quickly I get you thumbs up directly
Thank's
Rawan F

In: Computer Science

In C++ 1. Test Scores #1 Write a program that dynamically allocates a built-in array large...

In C++

1. Test Scores #1

Write a program that dynamically allocates a built-in array large enough to hold a user-defined number of test scores. (Ask the user how many grades will be entered and use a dynamic array to store the numbers.) Once all the scores are entered, the array should be passed to a function that calculates the average score. The program should display the scores and average. Use pointer notation rather than array notation whenever possible. (Input Validation: Do not accept negative numbers for test scores.) Make it a class, call it something like gradeholder. You will need a destructor because you are using dynamic arrays.

In: Computer Science

c program Evaluate the expression 1 && (30%10 >=0) && (30 %10<=3) Is either set of...

c program

  1. Evaluate the expression
    1. 1 && (30%10 >=0) && (30 %10<=3)
    2. Is either set of parentheses required?
    3. Write the complement of the expression two ways. First, add one operator and one set of parentheses. For the second version, use DeMorgan’s theorem.

In: Computer Science

what is the difference between capacity and size in COA, and what is the formula to...

what is the difference between capacity and size in COA, and what is the formula to calculate them?

In: Computer Science

Need urgently, please do it as soon as possible i have only 40 min for this...

Need urgently, please do it as soon as possible i have only 40 min for this task ( Doing in Java).

Question no 1: Solve completely.

a) Define the following concepts with proper syntax, where required. Also, write why we use these concepts (for last three bullets).

 Execution process of java program

 Copy constructor

 Instance and class variable

 Access specifiers

b) Write a program to print the area of a rectangle by creating a class named 'Area' having two methods. First method named as 'setDim' takes length and breadth of rectangle as parameters and the second method named as 'getArea' returns the area of the rectangle. Length and breadth of rectangle are passed through constructor.

In: Computer Science