Questions
In the RMON hostTopN table (20.14.1.4 Host Top N), the agent does all the report-building work....

In the RMON hostTopN table (20.14.1.4 Host Top N), the agent does all the report-building work. Would it be possible for the manager to do this? If not, why not? If so, why do you think RMON provides this table?

In: Computer Science

4. Rewrite the following pseudocode segment using a loop structure in the specified languages: k =...

4. Rewrite the following pseudocode segment using a loop structure in the specified languages:

k = (j + 13) / 27
loop:
      if k > 10 then goto out
      k = k + 1
      i = 3 * k - 1
      goto loop
out: . . .

a. C++

b. Python

c. Ruby

Assume all variables are integer type. Discuss the relative merits of the use of these languages for this particular code.

In: Computer Science

2. Let the function fun be defined as int fun(int*k) {       *k += 4;       return...

2. Let the function fun be defined as

int fun(int*k) {
      *k += 4;
      return 3 * (*k) - 1;
}

Suppose fun is used in a program as follows:

void main() {
      int i = 10, j = 10, sum1, sum2;
      sum1 = (i / 2) + fun(&i);
      sum2 = fun(&j) + (j / 2);
}

What are the values of sum1 and sum2

a. operands in the expressions are evaluated left to right?

b. operands in the expressions are evaluated right to left?

In: Computer Science

This program extends the earlier "Online shopping cart" program. (Consider first saving your earlier program). (1)...

This program extends the earlier "Online shopping cart" program. (Consider first saving your earlier program).

(1) Extend the ItemToPurchase class to contain a new attribute. (2 pts)

  • item_description (string) - Set to "none" in default constructor

Implement the following method for the ItemToPurchase class.

  • print_item_description() - Prints item_description attribute for an ItemToPurchase object. Has an ItemToPurchase parameter.


Ex. of print_item_description() output:

Bottled Water: Deer Park, 12 oz.

(2) Build the ShoppingCart class with the following data attributes and related methods. Note: Some can be method stubs (empty methods) initially, to be completed in later steps.

  • Parameterized constructor which takes the customer name and date as parameters (2 pts)
  • Attributes
    • customer_name (string) - Initialized in default constructor to "none"
    • current_date (string) - Initialized in default constructor to "January 1, 2016"
    • cart_items (list)
  • Methods
    • add_item()
      • Adds an item to cart_items list. Has parameter ItemToPurchase. Does not return anything.
    • remove_item()
      • Removes item from cart_items list. Has a string (an item's name) parameter. Does not return anything.
      • If item name cannot be found, output this message: Item not found in cart. Nothing removed.
    • modify_item()
      • Modifies an item's quantity. Has parameter ItemToPurchase. Does not return anything.
      • If item can be found (by name) in cart, modify item in cart.
      • If item cannot be found (by name) in cart, output this message: Item not found in cart. Nothing modified.
    • get_num_items_in_cart() (2 pts)
      • Returns quantity of all items in cart. Has no parameters.
    • get_cost_of_cart() (2 pts)
      • Determines and returns the total cost of items in cart. Has no parameters.
    • print_total()
      • Outputs total of objects in cart.
      • If cart is empty, output this message: SHOPPING CART IS EMPTY
    • print_descriptions()
      • Outputs each item's description.

Ex. of print_total() output:

John Doe's Shopping Cart - February 1, 2016
Number of Items: 8

Nike Romaleos 2 @ $189 = $378
Chocolate Chips 5 @ $3 = $15
Powerbeats 2 Headphones 1 @ $128 = $128

Total: $521


Ex. of print_descriptions() output:

John Doe's Shopping Cart - February 1, 2016

Item Descriptions
Nike Romaleos: Volt color, Weightlifting shoes
Chocolate Chips: Semi-sweet
Powerbeats 2 Headphones: Bluetooth headphones


(3) In main section of your code, prompt the user for a customer's name and today's date. Output the name and date. Create an object of type ShoppingCart. (1 pt)

Ex.

Enter customer's name:
John Doe
Enter today's date:
February 1, 2016

Customer name: John Doe
Today's date: February 1, 2016


(4) In the main section of your code, implement the print_menu() function. print_menu() has a ShoppingCart parameter, and outputs a menu of options to manipulate the shopping cart. Each option is represented by a single character. Build and output the menu within the function.

If the an invalid character is entered, continue to prompt for a valid choice. Hint: Implement Quit before implementing other options. Call print_menu() in the main() function. Continue to execute the menu until the user enters q to Quit. (3 pts)

Ex:

MENU
a - Add item to cart
r - Remove item from cart
c - Change item quantity
i - Output items' descriptions
o - Output shopping cart
q - Quit

Choose an option:


(5) Implement Output shopping cart menu option. (3 pts)

Ex:

OUTPUT SHOPPING CART
John Doe's Shopping Cart - February 1, 2016
Number of Items: 8

Nike Romaleos 2 @ $189 = $378
Chocolate Chips 5 @ $3 = $15
Powerbeats 2 Headphones 1 @ $128 = $128

Total: $521


(6) Implement Output item's description menu option. (2 pts)

Ex.

OUTPUT ITEMS' DESCRIPTIONS
John Doe's Shopping Cart - February 1, 2016

Item Descriptions
Nike Romaleos: Volt color, Weightlifting shoes
Chocolate Chips: Semi-sweet
Powerbeats 2 Headphones: Bluetooth headphones


(7) Implement Add item to cart menu option. (3 pts)

Ex:

ADD ITEM TO CART
Enter the item name:
Nike Romaleos
Enter the item description:
Volt color, Weightlifting shoes
Enter the item price:
189
Enter the item quantity:
2


(8) Implement remove item menu option. (4 pts)

Ex:

REMOVE ITEM FROM CART
Enter name of item to remove:
Chocolate Chips


(9) Implement Change item quantity menu option. Hint: Make new ItemToPurchase object before using ModifyItem() method. (5 pts)

Ex:

CHANGE ITEM QUANTITY
Enter the item name:
Nike Romaleos
Enter the new quantity:
3.

Type in Python please.

In: Computer Science

. Consider QuickSort on the array A[1:n] and assume that the pivot element x (used to...

. Consider QuickSort on the array A[1:n] and assume that the pivot element x (used to split the array A[lo:hi] into two portions such that all elements in the left portion A[lo:m] are ≤x and all elements in the right portion A[m:hi] are ≥x) is the second element of the array to be split (i. e., A[lo+1]).

For a specific value of n at least 13 (your choice), construct an assignment of the numbers 1...n to the n array elements that causes QuickSort, with the stated choice of pivot, to

(a) execute optimally (that is A[lo:m] and A[m:hi] are always of equal size)

(b) execute in the slowest possible way.

In: Computer Science

c++ language for this assignment use real world example. Your application must be a unique project...

c++ language

for this assignment use real world example.

Your application must be a unique project and must incorporate the use of an STL container and/or iterator and at least 7 STL algorithms with an option to exit. Your application must contain at least 8 menu options. You will decide how to implement these menu selections.

In: Computer Science

Using Java 8. Write a program that reads an expression in postfix notation, builds the expression...

Using Java 8. Write a program that reads an expression in postfix notation, builds the expression tree and prints the expression in prefix and infix notation and evaluates the expression. (Hint use a stack)

In: Computer Science

Solve the below questions using your own words PLEASE!! Make sure to write by your own...

Solve the below questions using your own words

PLEASE!! Make sure to write by your own words or paraphrase

1. What is the difference between Windows and Linux server

2. Give some advantages and disadvantages Windows and Linux Operating System

In: Computer Science

Maryland Animal Sanctuary and Rescue is a small Pet adoption place right here in our area...

  1. Maryland Animal Sanctuary and Rescue is a small Pet adoption place right here in our area and has different animals up for adoption. Design an application for their pets, creating a class diagram and writing the pseudocode for both the class definition and the application. Be sure to follow the Style Criteria for naming conventions, class diagrams, pseudocode, keywords, and operators.
    1. Create the UML class diagram for the Pet class that contains the type of the pet, the breed of the pet, and the weight. Examples of valid values for the type of the pet are "dog" and "rabbit". Examples of valid values for the breed are "husky" and "checkered giant". Examples of valid values for the weight are 32 and 3 1/2. Be sure to choose the most appropriate data type for the attributes. Include the methods of the Pet class listed below as well as the application class. Add the correct relationship and multiplicity.
    2. Create a class definition
      • Create a Pet class that contains the attributes in the class diagram. Additionally, include the following:
        • A default constructor that initializes each attribute to some reasonable default value for the pets.
        • Another constructor method that has a parameter for each data member. This constructor initializes each attribute to the value provided when an object of this type is instantiated.
        • Accessor and mutator methods for each attribute.
        • A method that displays all the data about the pets.
    3. Create the main application
      • Write the pseudocode for the application program for the pet sanctuary with a main() module that instantiates two objects of the Pet class.
        • The first object should be named dog and use the default constructor.
        • The second object should be named cat and use the second constructor to initialize the type to "cat", the breed to "Siamese", and the weight to 3.  
      • Include the following instructions in the main() method, in the order specified below
        • A call to set the type of the dog to "Large Dog".
        • A call to set the breed of the dog to “German Shephard”.
        • A call to set the weight of the dog to 50.
        • A Statement that displays the breed of the cat, using the appropriate method call.
        • A call to change the weight of the dog to 45.
        • A statement that displays the weight of the dog, using the appropriate method call.
        • A call for the cat object to the method that displays all the information about the cat.
        • A call for the dog object to the method that displays all of the information about the dog.

In: Computer Science

(8 marks) Write a program to ask user to enter an integer that represents the number...

  1. Write a program to ask user to enter an integer that represents the number of elements, then generate an ArrayList containing elements which are all random integers in range [75, 144] , and finally display index and value of each element.

REQUIREMENTS

  • The user input is always correct (input verification is not required).
  • Your code must use ArrayList.
  • Your program must use only printf(…) statements to adjust the alignment of your output.
  • Your code must display the index in descending order.
  • Your output must be displayed with the same alignment as the example (the text in bold indicates the user input).

Example of the program output:

Example 1:

Enter the number of elements: 5

Index   Element

4       129   

3       138   

2       134   

1       98    

0       84

Example 2:

Enter the number of elements: 12

Index   Element

11      109   

10      80    

9       122   

8       84    

7       142   

6       114   

5       114   

4       111   

3       82    

2       91    

1       132   

0       113

In: Computer Science

Create the table users with four columns: user_id, email_address, first_name, and last_name. Make user_id as the...

Create the table users with four columns: user_id, email_address, first_name, and last_name. Make user_id as the primary key. For each column, use the data type specified in the schema.

In: Computer Science

Create a basic VI by using labVIEW software. Kindly share screenshot of basic VI

Create a basic VI by using labVIEW software.

Kindly share screenshot of basic VI

In: Computer Science

f_access = open("queries.json") query_string = f_access.read() p_object_queries = json.loads(query_string) f_access.close() What is the type of f_access?...

f_access = open("queries.json")
query_string = f_access.read()
p_object_queries = json.loads(query_string)
f_access.close()

What is the type of f_access?

What is the type of query_string?

What is the type of p_object_queries?

Thank you!!!!

In: Computer Science

Message passing is both time- and space-coupled – that is, messages are both directed towards a...

Message passing is both time- and space-coupled – that is, messages are both directed towards a particular entity and require the receiver to be present at the time of the message send. Consider the case of using the learning platform, where you connect using URL “learning rather than an IP address and this name is resolved using DNS. Does such a system exhibit the same level of indirection?

In: Computer Science

.

.

In: Computer Science