Questions
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

I asked this question before, but I'm wondering if there are any other ways to do...

I asked this question before, but I'm wondering if there are any other ways to do this problem. My exam will be similar to this, so I'm looking for more examples to study with. Thank you!

For this Java program, you will write two classes: GradeCalculator and GradeCalculatorDriver.

In the GradeCalculator class, compute the final average and letter grade for a particular student.

The final average is calculated according to the following rules:

1) There are ten exams scored out of 100 points

2) The lowest exam score is not included in the calculation of the final average

3) The highest exam score is not included in the calculation of the final average

4) An average of 91-100 is an A

5) An average of 81-90 is a B

6) An average of 71-80 is a C

7) An average of 61-70 is a D

8) An average of 0-60 is an E

The GradeCalculator class must include the following methods:

1) A method to compute and return the highest score

2) A method to compute and return the lowest score

3) A method to compute the sum of all the scores

4) A method to compute the final average

5) A method to determine the letter grade

In the GradeCalculatorDriver class, include a main method that asks the user for the student’s name and their ten exam grades, reads the grades, calculates the letter grade and prints it. This process should be repeated until the user enters N.

For example, a run of the program might look something like this:

Welcome to Score Calculator

Want to compute a final average? Y

Please enter the student’s name: Sara Smith

Please enter test scores all on one line separated by one or more spaces.

The final score for Sara Smith is 100.

The letter grade for Sara Smith is A.

Want to compute another final average? N

In: Computer Science

Can you please Describe your actions as the Manager, and how you would manage the project...

Can you please Describe your actions as the Manager, and how you would manage the project team's stress levels? but meeting the required dates.

Can you please Describe in detail, how dealing with short deadlines??..... will need to be compensated in the teams focus ?as well as how you will ensure that this is accomplished?

***(G) Greenberg, Jerald and Baron, Robert, Behavior in Organizations, 10th Edition, Prentice Hall, Upper Saddle River, NJ 2008. ISBN 9780136090199.

***(H) Humphrey, Watts S., Managing Technical People, Addison-Wesley, Reading, MA 1997. ISBN 9780201545975

***Please use the book resource if you can ? and APA for another website resource,

*250 words response please!

In: Computer Science