1. write SQL statements to create the following two
tables:
a) Department table that contains the following
columns(dept_no,deptname,location) set the deptno to be the primary
key.
b) Employee table contains the following
columns(emp_no,empname,deptno,salary)set the emp_no to be the
primary key and dept_no to be the foreign key.
2. Write SQL statements to Insert the following 3 rows in Employee
table:
(101,’Sami’,’D-101’,5000)
(102,’Yousef’,’D-101’,4000)
(103,’Sami’,’D-102’,7000)
3. Write SQL statements to Insert the following 3 rows in
Department table:
(‘D-101’,’Marketing’,’loc1’)
(‘D-102’,’Sales’,’loc2’)
(‘D-103’,’Finance’,’loc3’)
4. Create a view for employee at marketing department.
In: Computer Science
Designing A New Arena :
You work for a company that has been tasked with designing a
proposed seating plan for an NHL team’s new arena. Currently the
NHL team plays in a rink similar to the one shown here:
Parameters of the Plan
PART A – SEATS AND ROWS
Using the parameters above, and your understanding of sequences and series:
Be sure to explain in detail any assumptions you
make.
PART B – TICKET PRICES
The team’s current arena charges:
The team has suggested modifying their current plan to use a geometric sequence, and decrease the price for a seat in each subsequent row by the same factor based on the price of a seat in the row in front of it.
Using the team’s current arena charges, your work from PART A, and your understanding of sequences and series:
In: Computer Science
Write a program that allows the user to enter two integers and a character If the character is A, add the two integers If it is S, subtract the second integer from the first else multiply the integers Display the results of the arithmetic
In: Computer Science
In this programming assignment, you will write C code that performs recursion. For the purpose of this assignment, you will keep all functions in a single source file main.c. Your main job is to write a recursive function that generates and prints all possible password combinations using characters in an array.
Following is an example output 1, when the program execution is ./a.out 3 a b c 2
a b c aa ab ac ba bb bc ca cb cc
Following is an example output 2, when the program execution is ./a.out 2 a b 3
a b aa ab ba bb aaa aab aba abb baa bab bba bbb
In: Computer Science
To demonstrate the practical implementation of the public\private encryption, you have been asked to compete the following task.
i. Type the following message in a .txt file: “My student ID is : >
ii. Download the public key given in this assignment folder and encrypt your message with the same key using openssl. iii. Using openssl, generate RSA key pair (2048bits) in your computer.
my student id is 40926
In: Computer Science
Consider the following hypothetical microprocessor. Assume this processor uses 32-bit instructions. Assume the 32 bits are composed of an opcode of 7 bits and an address of 25 bits. Answer the questions below.
In: Computer Science
C Programing
How would i edit this code to have it return the cipher text.
void vigenereCipher(char* plainText, char* k){
int i;
char cipher;
int cipherValue;
int len = strlen(k);
//Loop through the length of the plain text string
for(i=0; i<strlen(plainText); i++){
//if the character is lowercase, where range is [97 -122]
if(islower(plainText[i]))
{
cipherValue = ( (int)plainText[i]-97 + (int)tolower(k[i % len])-97 ) % 26 +97;
cipher = (char)cipherValue;
}
else // Else it's upper case, where letter range is [65 - 90]
{
cipherValue = ( (int)plainText[i]-65 + (int)toupper(k[i % len])-65 ) % 26 +65;
cipher = (char)cipherValue;
}
//Print the ciphered character if it is alphanumeric (a letter)
if(isalpha(plainText[i]))
{
printf("%c", cipher);
}
else //if the character is not a letter then print the character (e.g. space)
{
printf("%c", plainText[i]);
}
}
}
In: Computer Science
MATLAB
Create a 2 × 3 matrix variable mat. Pass this matrix variable to each of the following functions and make sure you understand the result: flip, fliplr, flipud, and rot90. In how many different ways can you reshape it?
Note: (in addition to the functions listed, rotate the matrix 180 degrees clockwise)
In: Computer Science
C++
C++
Write a definition for a structure type for records for CDs. The record contains price and total number of songs, . Part of the problem is appropriate choices of type and member names.Then declare two variables of this structure. Write a function called GetData use the structure as function argument to ask the user to input the value from the keyboard for structure variables.
In: Computer Science
Write a method speedingTicket() that decides whether a driver should be given a ticket from a police officer. The method accepts three parameters: speed (i.e., car speed) as integer; limit (i.e., speed limit) as integer and a boolean named donut indicating whether or not the police officer has eaten a donut today. A police officer that has eaten a donut is happy, so he/she is less likely to give the driver a ticket.
Your method should display either “Give Ticket” or “No Ticket!” based on the following:
• TICKET: Driver’s speed is more than 20 over the speed limit, regardless of donut status.
• TICKET: Driver's speed is 5-20 over the speed limit and officer has not eaten a donut.
• NO TICKET: Driver's speed is 5-20 over the speed limit and officer has eaten a donut.
• NO TICKET: Driver’s speed is < 5 over the speed limit, regardless of donut status.
Sample Calls Output speedingTicket(58, 55, false) No Ticket!
speedingTicket(45, 30, false) Give Ticket
speedingTicket(100, 75, true) Give Ticket
speedingTicket(42, 35, true) No Ticket!
speedingTicket(30, 35, false) No Ticket! //write your method below including the method header
In: Computer Science
7. In order to improve the network performance and security, ACLs is recommended. Please explain what is the ACL ?
8. How can ACLs help with the required tasks?
9. What are the principles of applying ACLs?
10. How to block VLAN 10 to visit ISP? Please write down the ACL statement(s) accordingly
In: Computer Science
Develop a Java program that determines the gross pay for an employee. The company pays hourly rate for the first 40 hours worked by the employee and time and a half (1.5x hourly rate) for all hours worked in excess of 40. The user of your application will enter an employee name, shift (day or night) ,the number of hours worked for the week and their hourly rate. Your program should then calculate and display the employee’s name, regular pay, overtime pay, total gross pay and payperiod. PayPeriod is "Friday" for "day" shift and "Saturday" for "night" shift. Use class Scanner to input the data. Be sure to format output, so it is professionally displayed to your users.
Here is an example of pseudocode:
Start
Enter employee name
Enter employee shift (day/night)
Enter hours worked
Enter hourly pay rate
Calculate reg pay
if hours worked > 40 then
Calculate overtime pay
else
overtime = 0
Calculate total pay
Output employee name, reguldar pay, overtime pay, total pay
If day shift
output “Friday payperiod”
Else
output “Saturday payperiod”.
End.
In: Computer Science
this should be written in Java- Problem: Min/Max Search by Index Develop a program that, given a sequence S of integers as input, produces as output two sequences of positive integers, the first of which indicates all those positions in S at which S's minimum value occurs and the second of which indicates all those positions at which S's maximum value occurs. Positions are numbered starting at zero (0).
Facts ● Scanner has a method that returns a boolean indicating whether a next integer exists in its input stream ( hasNextInt() ) ● Scanner objects can be initialized to to scan String data as input.
Sample input
3
3 6 -1 4 6 5 3
0 0 0 0
-4 45 2 0 3 5 11 -7 854 25 3 -7 4 -3
Sample output
3 6 -1 4 6 5 3
2
1 4
0 0 0 0
0 1 2 3
0 1 2 3
-4 45 2 0 3 5 11 -7 854 25 3 -7 4 -3
7 11
8
Input The input will begin with a single line containing T , the number of test cases to follow. The remaining lines contain the T sequences, one line per sequence. Each of these lines contains the values in the sequence. Each such value is separated from the next by at least one space.
Output For each sequence given as input, there should be four lines of output. The first line echos the given sequence. The second line indicates the positions at which the minimum value occurs. The third line indicates the positions at which the maximum value occurs. The fourth line is blank.
In: Computer Science
Write a javascript program that computes the total cost for a five year car lease. The program starts with a monthly leasing amount and a yearly increase in percent. The program then outputs the total amount paid for each year and the total overall cost of the lease.
In: Computer Science
What is your opinion on the use of AI technology? Is it necessary or is it a step in a wrong/different direction?
In: Computer Science