(1) Explain program-data independence.
(2) Explain what advantages NoSQL approaches have over traditional DBMS solutions.
(3) One company has many departments. A department has many cars and many employees. An employee can loan his/her department’s car for a business trip. Every department needs to keep track the car rental history including “start date”, “return date”, “start mileage”, and “end mileage”. Design an ERD based on above requirements. Please identify (strong and weak) entities, attributes, and (identifying and non-identifying) relationships clearly.
In: Computer Science
You are to design a database for the upcoming Greater Wisconsin River Fishing Contest. Consider the following functional dependencies;
Please note the following;
Create an ERD in 3NF for these relations. Create appropriate table names for the ERD. Include all applicable fields based on information you have been given and underline the Primary or Composite Primary Key fields. Make sure to include the correct ERD diagram symbols between tables to show the proper relationship type (e.g. 1:1, 1:M, etc.)
In: Computer Science
1. Write a program array_compare.c that determines the number of elements are different between the two integer arrays (same size) when compared element by element (first element with first element, second with second, and so on). The program should include the following function. Do not modify the function prototype.
void count_diff(int *a1, int *a2, int n, int *num_diff);
The function takes two integer array parameter a1 and a2 of size n. The function stores the number of elements that are different to the variable pointed by the pointer variable num_diff.
The function should use pointer arithmetic – not subscripting – to visit array elements. In other words, eliminate the loop index variables and all use of the [] operator in the function. The main function should ask the user to enter the size of the arrays and then the elements of the arrays, and then declare the arrays. The main function calls the count_diff function. The main function displays the result.
Example input/output #1: Enter the length of the array: 5
Enter the elements of the first array: -12 0 4 2 36
Enter the elements of the second array: -12 0 4 2 36
Output: The arrays are identical
Example input/output #2:
Enter the length of the array: 4
Enter the elements of the first array: -12 0 4 36
Enter the elements of the second array: 12 0 41 36
Output: The arrays are different by 2 elements
In: Computer Science
Database Design
Give one example of a cardinality ratio for a relationship of degree five.
In: Computer Science
q1)
Critically analyse the problems you are likely to encounter in creating a cross-platform multimedia projects and list several ways to deal with these problems
In: Computer Science
. A simple way to encrypt a number is to replace each digit of the number with another digit. Write a C program that asks the user to enter a positive integer and replace each digit by adding 6 to the digit and calculate the remainder by 10. For example, if a digit is 6, then the digit is replaced by (6+6)%10, which is 2. After all the digits are replaced, the program then swap the first digit with the last digit. The main function reads in input and displays output.
A sample input/output:
Enter the number of digits of the input number: 3
Enter the number: 728
Output: 483
2) The user will enter the total number of digits before entering the number.
3) You can use format specifier "%1d" in scanf to read in a single digit into a variable (or an array element). For example, for input 101011, scanf("%1d", &num) will read in 1 to num.
4) As part of the solution, write and call the function encrypt() with the following prototype.
The function assumes that the digits are stored in the array a and computes the encrypted digits and store them in the array b. c represents the size of the arrays. void encrypt(int *a, int *b, int n); The function should use pointer arithmetic – not subscripting – to visit array elements. In other words, eliminate the loop index variables and all use of the [] operator in the function.
5) As part of the solution, write and call the function swap() with the following prototype. void swap(int *p, int *q);
When passed the addresses of two variables, the swap() function should exchange the values of the variables: swap(&i, &j); /* exchange values of i and j */
In: Computer Science
Design a Python program with a While loop that lets the user enter a number. The number should be multiplied by 10 and the result
stored in a variable named "product". The loop should repeat as long as the product variable < 10. Anything not completely obvious to a newbie should be commented on as in line comments. Should be modulated and repeatable as well as there should be an invocation of the main routine at the end of the program.
Grading Rubrick
| Program Compiles Cleanly | syntax errors |
| 25 pts | -5 per error |
| Program runs without runtime errors ( validation) | run-time errors |
| 25 pts | -5 per error |
| Program give correct answers | Logic errors |
| 30 pts | -5 per error |
| Program is repeatable | Not repeatable |
| 5 pts | -5 pts |
| Program is well modularized | Barely Modularized |
| 10 pts | - 5 pts |
| Documented Well | Documented Some |
| 5 pts | - 3 pts |
| Something Cool (but relevant) beyond strict requirements | Something extra |
| 5 pts | + 3 pts |
| Best possible grade : 105 |
In: Computer Science
What is the legal basis of the argument that privacy is a right?
In: Computer Science
hello! So I have this CIS assignment lab but when I try to make the code I don't really know where to start from. My professor is very hard and he likes to see the outcomes as they are shown in the problem. Please help me! the program should be a C++ PLS
Write a program that can be used as a math helper for an
elementary student. The program should display two random integer
numbers that are to be added, such as:
247
+ 129
-------
The program should wait for the students to enter the answer. If
the answer is correct, a message of congratulations should be
printed. If the answer is incorrect, a message should be printed
showing the correct answer.
The program displays a menu allowing the user to select an
addition, subtraction, multiplication, or division problem. The
final selection on the menu should let the user quit the program.
After the user has finished the math problem, the program should
display the menu again. This process is repeated until the user
chooses to quit the program.
Input Validation: If the user select an item not on the menu,
display an error message and display the menu again.
Requirements:
Addition
Generate two random numbers in the range 0 - 9.
Subtraction
Generate two random numbers in the range 0 - 9.
num1 = rand() % 10;
num2 = rand() % 10;
Make sure num2 <= num1...
while (num2 > num1)
num2 = rand() % 10;
Multiplication
Generate two random numbers. The first in the range 0 - 10, the
second in the range 0 - 9.
Division
Generate a single digit divisor
num2 = rand() % 9;
Generate a num1 that is a multiple of num2 so the division has no
remainder. The num1 is never zero.
num1 = num2 * (rand() % 10 + 1);
All constant values must be declare as a constant variable. Use
the constant variable in the calculation.
Validating the selection (1 to 5). If the selection is not in the
range between 1 and 5, the program keeps asking the input until the
correct selection is entered.
Comments in your program to explain the code logic and
calculation.
Output sample:
Menu
1. Addition problem
2. Subtraction problem
3. Multiplication problem
4. Division problem
5. Quit this program
Enter your choice (1-5): 1
1
+ 2
---
4
Sorry, the correct answer is 3.
Menu
1. Addition problem
2. Subtraction problem
3. Multiplication problem
4. Division problem
5. Quit this program
Enter your choice (1-5): 7
The valid choices are 1, 2, 3, 4, and 5. Please choose: 2
8
+ 6
---
2
Congratulations! That's right.
Menu
1. Addition problem
2. Subtraction problem
3. Multiplication problem
4. Division problem
5. Quit this program
Enter your choice (1-5): 3
9
* 4
---
36
Congratulations! That's right.
Menu
1. Addition problem
2. Subtraction problem
3. Multiplication problem
4. Division problem
5. Quit this program
Enter your choice (1-5): 4
8 / 2 = 4
Congratulations! That's right.
Menu
1. Addition problem
2. Subtraction problem
3. Multiplication problem
4. Division problem
5. Quit this program
Enter your choice (1-5): 4
6 / 2 = 3
Congratulations! That's right.
Menu
1. Addition problem
2. Subtraction problem
3. Multiplication problem
4. Division problem
5. Quit this program
Enter your choice (1-5): 5
"Thank you for using math helper!"
In: Computer Science
Consider a set of n boxes with their positions numbered from 1
to n. Initially all the boxes
are CLOSED. These n boxes are subject to modifications over n
iterations as follows. At the ith
iterations the boxes at the positions whose ids are multiples of i
are flipped, i.e. changed from
CLOSED to OPEN or vice-versa. For example, at iteration 1, boxes at
all positions are
flipped, at iteration 2, boxes at positions 2,4,6,etc. are flipped,
at iteration 3, boxes at positions 3,6,9, etc.
are flipped.
Propose an algorithm for find out, that after n such iterations how
many boxes will be OPEN.
Note that the answer requires only how many boxes, not their
positions. Describe the rationale
for the algorithm, give the pseudocode, and its
complexity. Grading scheme: (your grade will be
based on whichever class your algorithm falls in)
- For algorithms with complexity O(kn), where k is the
number of digits of n.
In: Computer Science
Grocery Store using Java Arraylist
Requirements:
1. Need Product Class and Stock Class
2. Use arraylist to store/ add product in stock
3. Product must have name, code number and quantity in stock
4. Print list of the products and their stock quantity
5. Search products based on their name 6. Remove product based on their code number
7. Sell product and deduct quantity from stock
8. Stock Class contains methods of search product, add product and check quantity of the product
9. Product Class contains method of get product details
In: Computer Science
Please write this program in C++
Write a program that
- a user-defined class Cuboid which has the following elements:
- default constructor (has no parameters)
- constructor that has 3 parameters (height, length, width)
- data members
- height, length, width
- member functions
- to set the value of each of the data members - 3 functions
- to get the value of each of the data members - 3 functions
- one that returns the volume
- one that returns the surface area
- one that increases each dimension by a specified factor
(Function definitions outside of the class!!!)
- in main()
- instantiate a Cuboid object and initialize at the time of definition
- make sure the constructor with parameters is called
- define an array of 2 Cuboid objects
- using a loop get information to populate the 2 objects in the array
-prompt for the height, length, and width
-prompt for a size by which to increase each dimension(one input)
-call a global function passing a Cuboid object and the increase factor as separate arguments; function will call the class member function to increase the dimensions; parameters of the function should be references
-display the dimensions, the volume, and the surface area for each of the three objects.
In: Computer Science
In python
import numpy as np
Given the array b = np.arange(-6, 4) compute and print
1.) The array formed by \(bi^2 - 1\), where the \(bi\) are the elements of the array b.
2.) The array formed by multiplying b with the scalar 100.
3.)The array formed by 2.0 b i in reverse order. (Note: the base 2.0 must be a floating point number; for integer values a ValueError: Integers to negative integer powers are not allowed. is raised.)
4.) The array delta of length len(b)-1 that contains the differences between subsequence entries of \(bi^3\), namely \(\deltai = b{i+1}^3 - bi^3 \) with 0 ≤ i < N − 1 where N is the length of b. Print both delta.shape and delta.
In: Computer Science
Modeling multiprogramming: (a) Assume the I/O fraction time of all processes is 20%, and assume processes are independent from each other, what’s the CPU utilization, if the number of processes, n = 1, 2, 4, and 8, respectively? (b) If the I/O fraction time is 50% for all processes, what’s the CPU utilization again, if the number of processes, n = 1, 2, 4, and 8, respectively?
In: Computer Science
1, Bitcoin and blockchain are the same thing.
true
false
2, Operational efficiency and operational effectiveness are the same thing.
true
false
3, Bill Gates was the sole founder of Microsoft.
true
false
In: Computer Science