Questions
What is a database? Why do today’s Internet Web applications and smartphone apps need databases? For...

  1. What is a database? Why do today’s Internet Web applications and smartphone apps need databases?
  2. For the tables given as: MEMBER (MemberNumber, MemberFirstName, MemberLastName, EmailAddress)

And PAYMENT (PaymentNumber, MemberNumber, PaymentDate, PaymentAmount)

what are the primary keys of each table? Do you think that any of these primary keys could be surrogate keys? Are any of these keys composite keys? Explain how the two tables are related. Which table contains the foreign key, and what it is the foreign key?

  1. Define the terms data and information.   Explain how the two terms differ.

In: Computer Science

1. MySQL can enforce referential integrity for a delete operation performed on a parent table record...

1. MySQL can enforce referential integrity for a delete operation performed on a parent table record by ____________________ .

A. returning an error instead of deleting any rows.

B. setting the foreign key values in the related child table rows to null.

C. deleting the related rows in the corresponding child table(s).

D. applying any one of the above, (a, b or c), depending on how the foreign key constraint is defined.

2. Third normal form (3NF) eliminates which of the following issues in a table?

A. Transitive dependencies

B. Functional dependencies

C. Partial dependencies

D. Repeating, or multi-valued columns

3. For a table to be in the second normal form (2NF), each non-primary key column in the table must __________________

A. depend on only one column that is part of the composite primary key of the given table.

B. depend on all columns that make up the composite primary key of the given table.

C. have a unique value.

D. have a non-NULL value.

In: Computer Science

In Perl: Create a dictionary of at least 5 key/value pairs. Add a new key/value pair...

In Perl:

  1. Create a dictionary of at least 5 key/value pairs.
  2. Add a new key/value pair to the dictionary.
  3. Change one of the values through reassignment.
  4. Access at least 3 values using the keys.
  5. Access at least 3 keys using the values.
  6. Delete an element.
  7. Test for key inclusion for 3 elements.
  8. Loop through the dictionary, printing out the key and value on the same line separated by a space.

Key1, value1

Key2, value2

…,     …

(Please if you can, provide screenshots)

Thank YOU!

In: Computer Science

This has to be in java and will be uploaded onto zybooks. Write a Java program...

This has to be in java and will be uploaded onto zybooks.

Write a Java program that asks the user for a date entered as 4 integers: dayNumber monthNumber date year. Where:

dayNumber

An integer from 1-7, where 1 = Sunday, 2 = Monday, ..., 7 = Saturday

monthNumber

An integer from 1-12, where 1 = January, 2 = February, ..., 12 = December

date

An integer from 1-31 representing the date.

year

An integer representing the year.

Your prompt to the user should be:

    Enter 4 integers representing dayNumber monthNumber date year:
  

You program will compute the proper dayName from the specified dayNumber and the proper monthName from the specified monthNumber. Your program will print out the specified date in the following format:

    dayNumber monthNumber date year is dayName monthName date, year
  

Please note your program will have to error check the input as follows:

Please note your program will have to error check the input as follows:

  1. First the dayNumber is checked for being in the range 1..7. If that is not the case, your program should print out the following message and terminate execution:
        Invalid day number: dayNumber, please enter a number from 1..7.
          
  2. Then the monthNumber is checked for being in the range 1..12. If that is not the case, your program should print out the following message and terminate execution:
        Invalid month number: monthNumber, please enter a number from 1..12.
          
  3. Then the date is checked for being in the range 1..31. If that is not the case, your program should print out the following message and terminate execution:
        Invalid date number: date, please enter a number from 1..31.
          
  4. Then the date must be checked for validity. For example, there is no February 30, February 31, April 31, June 31, September 31, November 31. If the date is invalid, your program should print out the following message and terminate execution:
        Invalid date: monthName, does not have date days, please enter a valid date.
          
  5. Lastly, if the monthNumber = 2, and date = 29 you must verify that the year entered is a leap year, which is the only time that February 29 exists. Please see Wikipidia's Page on Leap Year. If the year is not a leap year and the user entered a date = 29, your program should print out the following message and terminate execution:
        Invalid date: year is not a leap year, February does not have date days, please enter a valid date.
          

Please note that your class should be named DateConverter.

In: Computer Science

This is a multiple answer question. Meaning any number of the four could be true. This...

This is a multiple answer question. Meaning any number of the four could be true. This is from an O/S class

We discussed in class the ability to create new processes in a Linux environment by way of the fork() function. What is true about this function?

fork() takes a parameter which is the priority of the process that is going to be created

It spawns a new process that is a child of the calling process. The child process is its own, unique process and shares nothing with the parent. The two processes are seen as equal and have no interaction with each other.

The function has a return value.

-1 if the function failed to create a new process

0 if we are in the child process that was created

a positive integer if we are the in the parent. The positive integer reflects the process ID of the newly created process.

fork() allows you to create handlers for the new process during the creation

In: Computer Science

Identify what is the goal of `Requirement Engineering`. What are some common requirement elicitation activities; which...

  • Identify what is the goal of `Requirement Engineering`.
  • What are some common requirement elicitation activities; which activity do you think is more appropriate to use for your class project and why.
  • Discuss and contrast `User Requirements` vs `System Requirement` and `Functional requirement` vs `Non-functional requirement`; Which type of requirements more important for the success of a software project.
  • Discuss the two main method for capturing and modeling user requirement.
  • What is the purpose of the `User Goal Technique`; what is the purpose of `Event Decomposition Technique`.
  • Which technique would you use for your group project to identify and model user requirements , and why?

In: Computer Science

One of the basic motivations behind the Minimum Spanning Tree Problem is the goal of designing...

One of the basic motivations behind the Minimum Spanning Tree Problem is the goal of designing a spanning network for a set of nodes with minimum total cost. Here we explore another type of objective: designing a spanning network for which the most expensive edge is as cheap as possible.

Specifically, let G = (V, E) be a connected graph with n vertices, m edges, and positive edges costs that are all distinct. Let T = (V, E0 ) be a spanning tree of G; we define the bottleneck edge of T to be the edge of T with the greatest cost.

A spanning tree T of G is a minimum-bottleneck spanning tree if there is no spanning tree T 0 of G with a cheaper bottleneck edge.

(a) Is every minimum-bottleneck tree of G a minimum spanning tree of G? Prove or give a counterexample.

(b) Is every minimum spanning tree of G a minimum-bottleneck tree of G? Prove or give a counterexample.

In: Computer Science

This is a multiple answer question, meaning any of the 4 statements could be true. From...

This is a multiple answer question, meaning any of the 4 statements could be true. From O/S class

A semaphore, in its purest form (like the one we used in the Dining Philosopher's solution), is what

A busy waiting lock.

An atomic integer that has two functions it can use - one that increments it by 1 and one that decrements it by 1.

A Monitor

An atomic integer that can be changed to any value from any other value directly.

In: Computer Science

In Python: Create a dictionary of at least 5 key/value pairs. Add a new key/value pair...

In Python:

  1. Create a dictionary of at least 5 key/value pairs.
  2. Add a new key/value pair to the dictionary.
  3. Change one of the values through reassignment.
  4. Access at least 3 values using the keys.
  5. Access at least 3 keys using the values.
  6. Delete an element.
  7. Test for key inclusion for 3 elements.
  8. Loop through the dictionary, printing out the key and value on the same line separated by a space.

Key1, value1

Key2, value2

…,     …

(Please if you can, provide screenshots)

Thank YOU!

In: Computer Science

A graph G = (V, E) is a near-tree if it is connected and has at...

A graph G = (V, E) is a near-tree if it is connected and has at most n+ 8 edges, where n = |V |. Give an algorithm with running time O(n) that takes a near-tree G with costs on its edges, and returns a minimum spanning tree of G. Assume all the edge costs are distinct.

In: Computer Science

Given the information below, create the fully labeled Crow's Foot ERD using a specialization hierarchy where...

Given the information below, create the fully labeled Crow's Foot ERD using a specialization hierarchy where appropriate (use Visio). The ERD must contain all primary keys, foreign keys, and main attributes. Business rules are defined as follows:

At a hospital, each patient is classified as either a resident patient or an outpatient. All patients have common attributes - ID, first and last name, and diagnosis - and unique attributes that are specific to their groups. The list of such attributes includes but is not limited to the following: a summary of the treatment received in the hospital (resident patients) and the checkback date (outpatients). In addition, resident patients are classified as patients who need a routine check up, patients who need a surgery, patients who need both a check up and a surgery. Each group is characterized by unique attributes (for instance, a surgery date, etc.). Each patient creates a record in the HOURS table that keeps track of the total number of hours a patient spent in the hospital. The table also includes the “COMMENT” field where any additional information may be recorded. One record is related to one patient only.

Thank you!

In: Computer Science

Design a program that uses an array to store 10 randomly generated integer numbers in the...

Design a program that uses an array to store 10 randomly generated integer numbers in the range from 1 to 50. The program should first generate random numbers and save these numbers into the array. It will then provide the following menu options to the user: 1. Display 10 random numbers stored in the array 2. Compute and display the largest number in the array 3. Compute and display the average value of all numbers 4. Exit The options 2 and 3 should call an appropriate user-defined function and pass the array to the function to compute the largest and the average value respectively. Design and call these two user-defined functions. The average value should be calculated and displayed with a precision of two decimal places. The program should loop back to the main menu until the user selects the option to exit the program. Use the register storage class for two the most frequently used variables in your program. Submit your program's source code (i.e., .c file) and a file with screen captures

In: Computer Science

Describe the different types of firewalls that are on the market today and how they differ...

Describe the different types of firewalls that are on the market today and how they differ from one another. Please write two paragraphs on the matter and please explain properly.

In: Computer Science

Start NetBeans. Create a new project called Lab7. Create a Java main class file using the...

  1. Start NetBeans.
  2. Create a new project called Lab7.
  3. Create a Java main class file using the class name YourlastnameLab7 with your actual last name.
  4. Create a Java class file for a Polygon class.
  5. Implement the Polygon class.
    1. Add a private instance variable representing the number of sides in the polygon.
    1. Add a constructor that takes a single argument and uses it to initialize the number of sides. If the value of the argument is less than three, display an error message and exit the program.
    1. Add an accessor method for the number of sides.
    1. Override the toString method of the Object class to return a String containing the number of sides.

6. Add code to the main method of your main class to do the following:

    1. Create a Polygon object.
    1. Pass the object to System.out.println() to display it.

Run the program to make sure it works. The output should look something like this:

Testing Polygon constructor

Number of sides: 5

7. Create a Java class file for a RegularPolygon class.

8. Implement the RegularPolygon class.

    1. Modify the class header to make RegularPolygon a subclass of Polygon.
    1. Add a private instance variable to represent the length of a side (a double).
    1. Add a constructor that takes an int and a double and uses them to initialize the private instance variables. If the length of the side is less than or equal to zero, display an error message, and exit the program.
    1. Add an accessor method and a mutator method for the length of a side.
    1. Move the code from the constructor that does the input validation and initialization of the length of a side to the mutator method. Replace the constructor code you just moved with a call to the mutator.
    1. Add a method called getPerimeter that calculates the perimeter of the polygon. Remember that all of the sides of a regular polygon have the same length.
    1. Override the toString method from the Polygon class to include the side length and perimeter along with the number of sides. Use the toString method from the base class to construct the first part of the string.

9. Add code to the main method of your main class to do the following:

    1. Create a RegularPolygon object and display it.
    1. Call the side length mutator, and display the object again.

Run the program to make sure it works. The output should look something like this:

Testing Polygon constructor

Number of sides: 4

Testing RegularPolygon constructor

Number of sides: 5

Side length: 1.0

Perimeter: 5.0

Testing side length mutator

Number of sides: 5

Side length: 2.0

Perimeter: 10.0

10. Create a Java class file for a RegularTriangle class.

11. Implement the RegularTriangle class.

  1. Modify the class header to make RegularTriangle a subclass of

RegularPolygon.

    1. Add a private instance variable for the height of the triangle (a double).
    1. Add a constructor that takes a double representing the length of a side and uses the RegularPolygon constructor to initialize the number of sides and the side length. You do not need to initialize the height (you will see why in the next step.)
    1. Override the side length mutator so it calls the RegularPolygon mutator to initialize the side length, then sets the height to √3 × /2. This will take care of initializing the height since the constructor calls the RegularPolygon constructor, which calls this version of the side length mutator.
    1. Write an accessor method and a mutator method for the height. The mutator should display an error message and exit the program if the value provided is less than or equal to zero. It should also set the side length to 2 × ℎ      ℎ /√3.
    1. Write a method called getArea that calculates the area of the triangle using the formula = 1/2 × × ℎ      ℎ and returns it.
    1. Override the toString method to add information about the height and area.

12. Add code to the main method of your main class to do the following:

    1. Create a RegularTriangle object and display it.
    1. Call the height mutator, and display the object.
    1. Call the side length mutator, and display the object.

Run the program to make sure it works. The output should look something like this:

Testing Polygon constructor

Number of sides: 4

Testing RegularPolygon constructor

Number of sides: 5

Side length: 1.0

Perimeter: 5.0

Testing side length mutator

Number of sides: 5

Side length: 2.0

Perimeter: 10.0

Testing RegularTriangle constructor

Number of sides: 3

Side length: 4.0

Perimeter: 12.0

Height: 3.4641016151377544

Area: 6.928203230275509

Testing height mutator

Number of sides: 3

Side length: 3.464101615137755

Perimeter: 10.392304845413264

Height: 3.0

Area: 5.196152422706632

Testing side length mutator

Number of sides: 3

Side length: 4.0

Perimeter: 12.0

Height: 3.4641016151377544

Area: 6.928203230275509

In: Computer Science

Write a C++ program that will make changes in the list of strings by modifying its...

Write a C++ program that will make changes in the list of strings by modifying its last element.

Your program should have two functions:

1. To change the last element in the list in place. That means, without taking the last element from the list and inserting a new element with the new value.

2. To compare, you need also to write a second function that will change the last element in the list by removing it first, and inserting a new element with the new value.

The main creates the list, creates the string variables, populates few elements in the list (couple is enough) and calls the functions to modify the list. After each call to the functions, the main should print out the value of the last element in the list, so the changes are visible. Again, you print the last element not from within the functions, but from the main.

Note 1: You will need to use references to implement the in-place requirement.

Note 2: However difficult that assignment may look like, all information you need on how to work with the list is given to you in the lecture and both your functions implementation are just very few short statements (hint: If you find yourself writing 5 or more lines of codes for each function, you probably do it wrong).

Please Describe all variables and important sections of code.

Need a screenshot of the out put.

In: Computer Science