Questions
List and explain five EIGRP commands that can be used at the command line to support...

List and explain five EIGRP commands that can be used at the command line to support EIGRP on a router. Include any relevant parameters of the command that can benefit the network engineer supporting the router

In: Computer Science

Create an Interface DiscountPolicy. It should have a single abstract method computeDiscount that will return the...

Create an Interface DiscountPolicy. It should have a single abstract method computeDiscount that will return the discount for the purchase of a given number of a single item. The method has two parameters, count (int type) and itemCost (double type). Create a class BulkDiscount that implements Interface DiscountPolicy. The BulkDiscount class has two proprieties: theMinimum (int type), and percent (double type). It should have a constructor that sets the parameters, minimum and percent to a given values. It should define the method computeDiscount so that if the quantity (count) purchased of an item is more than minimum, the discount is calculated as count*itemCost*percentOff/100.0, otherwise, discount will be equal=0.0; Write a test program that tests your method. Create at least three objects of BulkDiscount class and print out their discount values. (JAVA)

In: Computer Science

State True of False in each of the following: 9 | 20. Ceil( – 3.1 )...

  1. State True of False in each of the following:
    1. 9 | 20.
    2. Ceil( – 3.1 ) – Floor( – 4.9 ) = 2.
    3. A set and its subset cannot have the same size.
    4. It is feasible to use an algorithm with time complexity 3n for n=90.
    5. If a function is one-to-one and injective, the function is called bijective.     
    6. If × represents Cartesian product, then A×B=B×A.      
    7. In a function, we can have more than one preimage of an image.         
    8. In a function, we can have more than one image of a preimage.
    9. Finding the maximum element from a sorted array cannot be done in O(1) time.
    10. Exponential time algorithms are better than polynomial time algorithms.

           

  1. If ‘x’ and ‘y’ are the last and second-last digits of your PMU ID, find (x +5 y) and (x ∙5 y). Show the details of your work.
  1. Consider X= “last two digits of your PMU ID”. Find the following. Show details of your solution.   (X)16 = (?)2

  1. Using Caesar cipher with a key = last digit of your PMU ID, encrypt your ‘first name’.

  1. Exactly how many comparisons are needed to find ‘1’ in the following array using binary search algorithm. Explain in detail.

1 2 3 5 6 7 8 10 12 13 15 16 18 19 20 22 40

In: Computer Science

Write a program that asks the user for 10 integers, then prints all integers, followed by...

Write a program that asks the user for 10 integers, then prints all integers, followed by the largest integer.

CPP. ONLY!!

In: Computer Science

This is C++. I would like to know the TODO list comments. #include <cstdlib> #include <iostream>...

This is C++. I would like to know the TODO list comments.

#include <cstdlib>
#include <iostream>

// TODO: 2. (1 point) Declare your Acker function prototype below:
// When done, commit with the commit message that follows, being
// sure to delete all these TODO instructions before actuallly
// executing the git commit command.
//
// CSC232-HW02 - Added Aker function prototype.
//
// Don't forget to fully document the function prototype using
// all the appropriate doxygen elements.

/**
* @brief Entry point to this application.
* @remark You are encouraged to modify this file as you see fit to gain
* practice in using objects.
*
* @param argc the number of command line arguments
* @param argv an array of the command line arguments
* @return EXIT_SUCCESS upon successful completion
*/
int main(int argc, char **argv) {
    // TODO: 4. (0.5 points) Replace *** text *** with actual call to Acker
    // function. When done, commit with the commit message that follows,
    // being sure to delete all these TODO instructions before actuallly
    // executing the git commit command.
    //
    // CSC232-HW02 - Display calculated Acker value.
    //
    std::cout << "Acker(1, 2) = " << "*** replace me with call to Acker***"
             << std::endl;
    return EXIT_SUCCESS;
}

// TODO: 3. (2 points) Define the Acker recursive function below. When done,
// commit with the commit message that follows, being sure to delete
// all these TODO instructions before actually executing the git
// commit command.
//
// CSC232-HW02 - Implemented Acker function.

// TODO: 5. (1 point) Do a box trace of Acker(1, 2) using pen and paper.
// Hand this in at the beginning of class on Friday, 17 February 2017.
// Your solution MUST be legible; no points are assigned to illegible
// papers.

This is testRunner.

#include <cppunit/BriefTestProgressListener.h>
#include <cppunit/CompilerOutputter.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestRunner.h>

#include <cppunit/Test.h>
#include <cppunit/TestFailure.h>
#include <cppunit/portability/Stream.h>

/**
* @brief Main test driver for CPPUNIT test suite.
* @remark DO NOT MODIFY THE SPECIFICATION OR IMPLEMENTATION OF THIS CLASS! ANY
* MODIFICATION TO THIS CLASS WILL RESULT IN A GRADE OF 0 FOR THIS LAB!
*/
class ProgressListener : public CPPUNIT_NS::TestListener {
public:

    ProgressListener()
    : m_lastTestFailed(false) {
    }

    ~ProgressListener() {
    }

    void startTest(CPPUNIT_NS::Test *test) {
        CPPUNIT_NS::stdCOut()<< test->getName();
        CPPUNIT_NS::stdCOut()<< "\n";
        CPPUNIT_NS::stdCOut().flush();

        m_lastTestFailed = false;
    }

    void addFailure(const CPPUNIT_NS::TestFailure& failure) {
        CPPUNIT_NS::stdCOut()<< " : " << (failure.isError() ? "error" : "assertion");
        m_lastTestFailed = true;
    }

    void endTest(CPPUNIT_NS::Test *test) {
        if (!m_lastTestFailed)
            CPPUNIT_NS::stdCOut() << " : OK";
        CPPUNIT_NS::stdCOut()<< "\n";
    }

private:
    /// Prevents the use of the copy constructor.
    ProgressListener(const ProgressListener& copy);

    /// Prevents the use of the copy operator.
    void operator=(const ProgressListener& copy);

private:
    bool m_lastTestFailed;
};

int main() {
    // Create the event manager and test controller
    CPPUNIT_NS::TestResult controller;

    // Add a listener that colllects test result
    CPPUNIT_NS::TestResultCollector result;
    controller.addListener(&result);

    // Add a listener that print dots as test run.
    ProgressListener progress;
    controller.addListener(&progress);

    // Add the top suite to the test runner
    CPPUNIT_NS::TestRunner runner;
    runner.addTest(CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest());
    runner.run(controller);

    // Print test in a compiler compatible format.
    CPPUNIT_NS::CompilerOutputter outputter(&result, CPPUNIT_NS::stdCOut());
    outputter.write();

    return result.wasSuccessful() ? 0 : 1;
}

In: Computer Science

What kinds of systems might be valuable targets in information warfare? Create a prioritized list of...

What kinds of systems might be valuable targets in information warfare? Create a prioritized list of targets and describe the kinds of damage that could result if these systems were attacked. Provide a minimum of 3 paragraphs.

In: Computer Science

pseudocode display "Please enter first name: " input fName display "Please enter middle initial (Enter space...

pseudocode

display "Please enter first name: "
input fName

display "Please enter middle initial (Enter space if none): "
input mName

display "Please enter last name: "
input lName

display "Enter hours worked: "
input hours

display "Enter hourly rate: "
input perHourRate

weeklySalary = hours * perHourRate

output "fName mName. lName"
output weeklySalary

Question 1. Move your algorithm/pseudocode/outline into Code:Blocks and create a "shell" program. (The shell program shouldn't do any of the final work, but it should have comments where the final code will go and should compile and run.)

In: Computer Science

If you were designing sound for a game, in what instances would you create your own...

If you were designing sound for a game, in what instances would you create your own sounds using foley (or by recording sounds from the environment) versus utilizing pre-existing material from a library? Similarly, when would you create (or hire someone to create) original music versus licensing pre-existing material from a library or label?

In: Computer Science

In C Sharp with the use of the Try and Catch method create an application that...

In C Sharp with the use of the Try and Catch method create an application that displays the contents of the Teams.txt file in a ListBox control. When the user selects a team in the ListBox, the application should display the number of times the team has won the World Series in the time period from 1903 through 2012.

Teams.txt--This file contains a list of several Major League baseball teams in alphabetical order. Each team listed in the file has won the World Series at least once.

WorldSeriesWinners.txt - This file contains a chronological list of the World Series' winning teams from 1903 through 2012. (The first line in the file is the name of the team that won in 1903, and the last line is the name of the team that won in 2012. Note that the World Series was not played in 1904 or 1994.)

Hint: Read the contents of the WorldSeriesWinners.text file into a List. When the user selects a team in the ListBox, the application should display the number of times the selected team appears.

In: Computer Science

Java program code: InventoryManager For this assignment, you will be creating an inventory manager for a...

Java program code: InventoryManager

For this assignment, you will be creating an inventory manager for a store that sells vegetables. The inventory will be managed using arrays.

The required name for the project is InventoryManager.
The required name for the Java file is InventoryManager.java.
The required main class name is InventoryManager.

Part 1: Planning the store

Decide the name of your store. Place this name in a constant called STORE_NAME.
As soon as the program starts, display a greeting to the user to let them that they have begun using the inventory management app for this store.
Then, perform the following:

  1. Create an array called items for a maximum of 5 items in your store. The items in the array should be onion, broccoli, carrot, zucchini, and cucumber.
  2. Create a second array called quantities to store the quantity of each of the five items.
    Using a loop, have the user enter the quantity of each of the five items, and make sure each value of quantity is inserted into quantities array at the appropriate index (the same index as the item in the items array).
    For this step, we will assume the user will only enter an integer, but you should validate their input to make sure they enter a value greater than or equal to zero. If they do not enter an integer greater than or equal to zero, then you must prompt them to enter the value again (until they get it right).
    HINT: Consider using another loop to have them enter the quantities.
  3. Create a third array called prices to store the price of each of the five items. Using a similar process to Step 2, have the user enter the price of each of the five items and make sure they are stored in the prices array at the appropriate index. Just like Step 2, you should make sure the user-entered prices are greater than or equal to 0. Otherwise, they should repeat entering the value until they get it correct.

The following table is just one example of the values that might populate the three arrays. Each index represents one single item.

INDEX 0 1 2 3 4
items array onion broccoli carrot zucchini cucumber
quantities array 12 4 3 56 30
prices array 1.52 0.53 1.25 1.34 2.32


NOTE: Apart from the items array, these are just example values. Because the user is required to enter these values, values in quantities and prices could be anything.

If we were to determine the quantity of our carrots, we would first find that "carrot" is located at index 2 in items, so we would retrieve the value in quantities at index 2, which is a quantity of 3. To find the price, we would retrieve the value at index 2 of prices, which is 1.25.

Make sure you use the appropriate datatype for each array (int? double? String?)

All of the previous directions take place only at the beginning of the program. You can think of it as the set up for the main part of the program. Once done, the user will be taken into Part 2 of this assignment.

Part 2: Operating the InventoryManager

Display to the user the possible operations on the inventory and prompt him/her to choose one. The user should select the option by entering its number. Every time the user completes one of the operations (except for Exit), the user should be taken back to this screen where they can choose from this list again. If Exit is selected, the user should be given a message thanking them for using the program, and then the program should be properly closed. Do not use System.exit() to close the program. You must exit the program by exiting the loop itself.

There are 5 possible operations:

1. Print inventory
2. Check for low inventory
3. Highest and lowest inventory value items
4. Total inventory value
5. Exit

1. Print inventory

This operation prints all the inventory items, with each item shown in the following format:

Item: ITEM-NAME
Quantity: ITEM-QUANTITY
Price: ITEM-PRICE
Total value: TOTAL-VALUE

ITEM-NAME should be replaced by the name of the item.
ITEM-PRICE should be replaced by the price of the item.
TOTAL-VALUE should be replaced by the total price if someone were to purchase the entire stock of items.

Make sure your output appears exactly like the format above. You should print the information for all five items in an efficient way (using a loop).

Once this is done, the user should be allowed to select one of the five options from the original menu.

2. Check for low inventory

This operation checks for items that have a quantity of less than 5, then prints them in the same format as in option 1.

If there is no such item whose quantity is less than 5, then display a message that explains that to the user.

Once this is done, the user should be allowed to select one of the five options from the original menu.

3. Highest and lowest inventory value items

This operation finds the following two items:

  • The item with the highest inventory value.
  • The item with the lowest inventory value.

Remember that the total inventory value is the value of the whole stock of the inventory item combined, which would be equal to the quantity multiplied by the price.

If two or more items have a matching inventory value and they are either the highest or lowest, then you only need to display one of them.

Display the highest and lowest inventory value items in the same way as option 1.

Once this is done, the user should be allowed to select one of the five options from the original menu.

4. Total inventory value

This is the total value of ALL items in the store, taking into account the quantity of each item. Display this value to the user.

Once this is done, the user should be allowed to select one of the five options from the original menu.

5. Exit

If selected, the user should be given a message thanking them for using the program, and then the program should exit. Do not use System.exit() to exit the program. You must exit the program by logically ending the loop.

Requirements

When this program runs, it should be obvious to the user the values they are seeing. Include all units when displaying values. For example, when displaying dollar values, make sure you include a dollar sign ($). You do not need to worry about making two decimal digits show when displaying dollar values. For example, it's okay to display $4.5 instead of $4.50.

In: Computer Science

I need to answer all 16 questions. Please do as many as you can. Please answer...

I need to answer all 16 questions. Please do as many as you can.

Please answer the following question of database management.
1. Describe the process of creating a table in SQL and the different data types you can use for fields.

2. What is the purpose of the WHERE clause in SQL? Which comparison operators can you use in a WHERE clause?
3. How do you write a compound condition in an SQL query? When is a compound condition true?

4. What is a computed field? How can you use one in an SQL query? How do you assign a name to a computed field?

6. How do you use the IN operator in an SQL query?

7. How do you sort data in SQL? When there is more than one sort key, how do you indicate which one is the major sort key? How do you sort data in descending order?


8. What are the SQL built-in functions? How do you use them in an SQL query?

9. What is a subquery? When is a subquery executed?


10. How do you group data in SQL? When you group data in SQL, are there any restrictions on the items that you can include in the SELECT clause? Explain.


11. How do you join tables in SQL?

12. In a complex join, how is the number of tables you wish to join related to the number of WHERE conditions?

13. How do you qualify the name of a field in an SQL query? When is it necessary to do so?

14. How do you take the union of two tables in SQL? What criteria must the tables meet to make a union possible?

15. Describe the three update commands in SQL.

16. How do you save the results of an SQL query as a table?

In: Computer Science

"Write a function named "firstLast2" that takes as input a vector of integers. The function should...

"Write a function named "firstLast2" that takes as input a vector of integers. The function should return true if the vector starts and ends with the digit 2. Otherwise, it should return false. Test your function with vectors of different length and with the digit 2 at the beginning of the vector, end of the vector, middle of the vector, and missing from the vector."

Additional Requirements:

>Must use a loop allowing the user to continue until he/she quits.

>Read the full name, middle (if there is any) and last name separately.

>Must work even if there is no middle name.

In: Computer Science

prove A(A+B) = A using truth table

prove A(A+B) = A using truth table

In: Computer Science

Write a MARIE program that asks the user for a beginning and an ending address of...

Write a MARIE program that asks the user for a beginning and an ending address of an array in the memory and checks whether the sequence of integers in between these memory locations is a palindrome. Output 1 on the screen if you conclude it is a palindrome. Add comments to your program.

In: Computer Science

2. a. Choose all of the following that apply to DynamoDB: (a) DynamoDB is part of...

2.

a. Choose all of the following that apply to DynamoDB:

(a) DynamoDB is part of RDS

(b) Is stored in 3 different locations

(c) Does not support joins, foreign keys and complex queries

(d) Supports Local and Global secondary indexes

(e) Users can manage DynamoDB in the backend (add CPU, memory, etc)

(f) Utilizes partition key to spread data across partitions for scalability

b. Which of the following standard is used by MongoDB to store documents internally?

(a) BSON

(b) JSON

(c) Extended JSON

(d) SQL

In: Computer Science