Provide an example for each of the following types of data model:
-Conceptual data models
-Physical data models
-Representational data models
In: Computer Science
Create a class named Employee and its child class named Salesperson. Save each class in its
own file. Name your class and source code file containing the main method
homework.java.
Make sure each class follows these specifications:
1. An employee has a name (String), employee id number (integer), hourly pay rate
(double), a timesheet which holds the hours worked for the current week (double array)
and email address (String). A salesperson also has a commission rate, which is a
percentage stored as decimal value (double).
2. Override the toString method in each class to display all data (except the timesheet array)
available about each object.
3. Each class should have an appropriate constructor to set the values of all private data
members belonging to that class and its parent classes at the time of instantiation.
4. Each class should have get and set methods for their unique private data members.
5. For the timesheet array, it is an array which stores 1 week of hours worked since
employees are paid every week on Monday. Weeks start on Monday and run through
Sunday so Monday hours are stored in the first position of the array and Sunday hours are
stored in the last position of the array.
6. Design a calculatePay method for each type of employee as follows:
A regular employee gets paid their hourly rate for their first 40 hours of work in a
week and then gets 1.5 times their hourly rate for any hours worked over 40 in a
week.
A salesperson gets their pay calculated the same as the regular employee (aka regular
pay) with an addition of their sales commission earned. Their sales commission is
earned by multiplying the salesperson's commission rate by the weekly sales total,
which is supplied as an argument when the method is called. The sales commission
earned for the week is then added to the regular pay to calculate the salesperson's total
pay for the week.
This method uses hours worked in the timesheet array and the hourly rate to make its
calculations of the regular pay for all types of employees, even salespeople.
Salespeople just have the additional sales commission added to their pay.
All employees have 35% of their total pay withheld from their checks for taxes.
Page 2 of 2
This method should return a double representing the employee's total pay for the
week accounting for sales commission (if any) and taxes withheld.
After creating the two classes, write a program with a main method that uses the Employee and
Salesperson classes to create objects for an employee and a salesperson being sure to assign data
to all data members including those inherited from the parent class. You can use any data you
wish for the objects, but you must use the constructors you defined to set the data values at the
time of object instantiation.
After creating the two objects, your program should then do the following things in order:
Invoke the toString method for each object.
Print the timesheet for the current pay period for each object.
Change the email address of the salesperson.
Print the saleperson's name and changed email address
Change the commission rate for the salesperson increasing it by 5%.
Invoke the toString method for the salesperson to show the change in commission rate.
Print the paycheck amounts for the current pay period for both objects.
For this assignment, you should end up with different source code files for each of the 2 classes
(Employee and Salesperson). The main method should also be in a different source code file
named homework.java
In: Computer Science
PYTHON CODE:
def square_matrix_multiplication(matrix1,matrix2):
C=[[0 for i in range(len(matrix1))] for i in
range(len(matrix2))]
for i in range(len(matrix1)):
for j in range(len(matrix2[0])):
C[i][j]=0
for k in range(len(matrix2)):
C[i][j] += matrix1[i][k]*matrix2[k][j]
return C
I use that function in my code. When I type like "return C", It does not work. If I type print(C), then my code works. Why is it happening?
I created two user-entered matrices above the function, then I called the function.
In: Computer Science
Note: If the switch did not prompt you for a password, then you did not configure the login parameter in Step 2.
Step 4: Secure privileged mode access.
Set the enable password to c1$c0. This password protects access to privileged mode.
Note: The 0 in c1$c0 is a zero, not a capital O. This password will not grade as correct until after you encrypt it in Step 8.
S1> enable
S1# configure terminal
S1(config)# enable password c1$c0
S1(config)# exit
%SYS-5-CONFIG_I: Configured from console by console
S1#
Step 5: Verify that privileged mode access is secure.
a. Enter the exit command again to log out of the switch.
b. Press <Enter> and you will now be asked for a password:
User Access Verification
Password:
c. The first password is the console password you configured for line con 0. Enter this password to return to user EXEC mode.
d. Enter the command to access privileged mode.
e. Enter the second password you configured to protect privileged EXEC mode.
f. Verify your configurations by examining the contents of the running-configuration file:
S1# show running-config
Notice how the console and enable passwords are both in plain text. This could pose a security risk if someone is looking over your shoulder.
Step 6: Configure an encrypted password to secure access to privileged mode.
The enable password should be replaced with the newer encrypted secret password using the enable secret command. Set the enable secret password to itsasecret.
S1# config t
S1(config)# enable secret itsasecret
S1(config)# exit
S1#
Note: The enable secret password overrides the enable password. If both are configured on the switch, you must enter the enable secret password to enter privileged EXEC mode.
Step 7: Verify that the enable secret password is added to the configuration file.
a. Enter the show running-config command again to verify the new enable secret password is configured.
Note: You can abbreviate show running-config as
S1# show run
b. What is displayed for the enable secret password?
c. Why is the enable secret password displayed differently from what we configured?
Step 8: Encrypt the enable and console passwords.
As you noticed in Step 7, the enable secret password was encrypted, but theenable and console passwords were still in plain text. We will now encrypt these plain text passwords using the service password-encryptioncommand.
S1# config t
S1(config)# service password-encryption
S1(config)# exit
If you configure any more passwords on the switch, will they be displayed in the configuration file as plain text or in encrypted form? Explain.
Part 3: Configure a MOTD Banner
Step 1: Configure a message of the day (MOTD) banner.
The Cisco IOS command set includes a feature that allows you to configure messages that anyone logging onto the switch sees. These messages are called message of the day, or MOTD banners. Enclose the banner text in quotations or use a delimiter different from any character appearing in the MOTD string.
S1# config t
S1(config)# banner motd "This is a secure system.Authorized Access Only!"
S1(config)# exit
%SYS-5-CONFIG_I: Configured from console by console
S1#
1) When will this banner be displayed?
2) Why should every switch have a MOTD banner?
Part 4: Save Configuration Files to NVRAM
Step 1: Verify that the configuration is accurate using the show run command.
Step 2: Save the configuration file.
You have completed the basic configuration of the switch. Now back up the running configuration file to NVRAM to ensure that the changes made are not lost if the system is rebooted or loses power.
S1# copy running-config startup-config
Destination filename [startup-config]?[Enter]
Building configuration...
[OK]
What is the shortest, abbreviated version of the copy running-config startup-config command?
Step 3: Examine the startup configuration file.
Which command will display the contents of NVRAM?
Are all the changes that were entered recorded in the file?
Part 5: Configure S2
You have completed the configuration on S1. You will now configure S2. If you cannot remember the commands, refer to Parts 1 to 4 for assistance.
Configure S2 with the following parameters:
a. Name device: S2
b. Protect access to the console using the letmein password.
c. Configure an enable password of c1$c0 and an enable secret password of itsasecret.
d. Configure a message to those logging into the switch with the following message:
Authorized access only. Unauthorized access is prohibited and violators will be prosecuted to the full extent of the law.
e. Encrypt all plain text passwords.
f. Ensure that the configuration is correct.
g. Save the configuration file to avoid loss if the switch is powered down.
Suggested Scoring Rubric
|
Activity Section |
Question Location |
Possible Points |
Earned Points |
|
Part 1: Verify the Default Switch Configuration |
Step 2b, q1 |
2 |
|
|
Step 2b, q2 |
2 |
||
|
Step 2b, q3 |
2 |
||
|
Step 2b, q4 |
2 |
||
|
Step 2b, q5 |
2 |
||
|
Part 1 Total |
10 |
||
|
Part 2: Create a Basic Switch Configuration |
Step 2 |
2 |
|
|
Step 7b |
2 |
||
|
Step 7c |
2 |
||
|
Step 8 |
2 |
||
|
Part 2 Total |
8 |
||
|
Part 3: Configure a MOTD Banner |
Step 1, q1 |
2 |
|
|
Step 1, q2 |
2 |
||
|
Part 3 Total |
4 |
||
|
Part 4: Save Configuration Files to NVRAM |
Step 2 |
2 |
|
|
Step 3, q1 |
2 |
||
|
Step 3, q2 |
2 |
||
|
Part 4 Total |
6 |
||
|
Packet Tracer Score |
72 |
||
|
Total Score |
100 |
||
In: Computer Science
PYTHON: Describe a recursive algorithm that counts the number of nodes in a singly linked list.
In: Computer Science
In python:
implement a singly linked list with following functions:
- add_head(e)
- add_tail(e)
- find_3rd_to_last() - returns element located at third-to-last in the list
- reverse() - reveres the linked list, note, this is not just printing elements in reverse order, this is actually reversing the list
In: Computer Science
Develop a python program that will determine if a department store customer has exceeded the credit limit on a charge account. For each customer, the following facts are available: Account number, Balance at the beginning of the month, Total of all items charged by this customer this month, Total of all credits applied to this customer’s account this month and Allowed credit limit. The program should input each of the facts, calculate the new balance (=beginning balance + charges – credits), and determine if the new balance exceeds the customer’s credit limit. For those customers who credit limit is exceeded, the program should display the customer’s account number, credit limit, new balance and the message “Credit limit exceeded”. Here is a sample input/output dialogue: Enter account number (-1 to end): 100 Enter beginning balance: 5394.78 Enter total charges: 1000.00 Enter total credits: 500.00 Enter credit limit: 5500.00 Account: 100 Credit limit: 5500.00 Balance: 5894.78 Credit Limit Exceeded. Enter account number (-1 to end): 200 Enter beginning balance: 1000.00 Enter total charges: 123.45 Enter total credits: 321.00 Enter credit limit: 1500.00 Enter account number (-1 to end): -1 # -1 is terminating condition
In: Computer Science
Chapter #4
Question #12. What is IVR? How is it used to query a database?
Question #14. What is master data management? What is data steward? What is the role of master data management in an organization’s integration strategy?
Question #16. What are examples of internal sources of data for a data warehouse? What are examples of external sources of data for a data warehouse?
Question #18. What is big data? What are the defining features of big data?
In: Computer Science
For your first project, write a C program (not a C++ program!)that will read in a given list of non-negative integers and a target integer and checks if there exist two integers in the list that sum up to the target integer.
Example:List: 31, 5, 8, 28, 15, 21, 11, 2
Target: 26 Yes!, 44 No!
your C program will contain the following:
•Write a function that will make a copy of the values from one array to another array.
Suggested prototype: void makeArrayCopy (int fromArray[], int toArray[], int size);
•Write your own function that will sort an array in ascending order. You may use whatever sorting algorithm you wish. Suggested prototype: void myFavoriteSort (int arr[], int size);
•Write your own function that will find whether there exist two integers that sum to the target integer. The function is to “return” three values. First, return “1” if the integers were found, return “-1” if your search was not successful. If you find two integers which add up to the target value, you should return their respective index position inside the array. Suggested prototype:int TwoSumFunction(int arr[], int size, int target, int*index1, int* index2);
inside TwoSumFunction:
•Pass the sorted array to the function. Set two pointers at the beginning and the end of the array, then start moving the pointers inward while checking their sum. If it’s exactly the “target”, then we are done, and you can return 1. If it exceeds the “target” value, then any sum using the larger element is too large, so move the pointer corresponding to that element inward. If the sum is less than “target” value, then any sum using the lower element is too small, so move the pointer corresponding to that element inwards. If you are done with scanning the array and cannot find any two elements that sum up to “target” value, return -1.
Inside of main:
•Read in integer input from standard input and store these values into a dynamic array. This array is to grow in size if the array is full. The values will have a “terminal value” of -999. So, you read in these values in a loop that stops when the value of -999 is read in. The use of informative prompts is required for full credit. You may not assume how many numeric values are given on each line, nor the total number of values contained in the input. The use of a scanf() with the following form is expected to read in the values:scanf (“%d”,&val);
•make a copy of the integer array using the array copy() function described above
•sort the copy array(using the myFavoriteSort() function described above)
•read in integer input from standard input (again, the use of scanf() is expected) and for each of the values read in perform the TwoSum evaluation. Using the information returned/sent back from the search functions, print out from main():
1.The target value,
2.Whether the Two Sum evaluation was successful or not
3.Locations of the elements in the array which make up the sum.
The above information MAY NOT be printed out in TwoSum Function. The function MUST RETURN/SEND BACK the information to be printed by the main function. Not doing this will SEVERELY LOWER your score on this project. Repeat reading in integer values and searching the array until the terminal value of -999 is read in. The use of informative prompts AND descriptive result output is required for full credit. Again, scanf() is expected to read the input.
You may not assume the input will be less than any set size. Thus you will need to dynamically allocate space for the array.
Dynamic Array Allocation:
Dynamic Array Allocation allows the space in an array to change during the course of the execution of a program. In C, this requires the use of the malloc() function. To dynamically allocate space for 100 integers,the malloc() code would be as follows:
int *darr;
int allocated= 100;
darr = (int *) malloc (allocated* sizeof(int) );
This array can only hold 100 integers and is not really dynamic. To make it truly dynamic, we need to grow the array when we try to put more values into it than can be held by its current size. The following code will double the size of the array.
int *temp= darr;
darr= (int *) malloc ( allocated* 2 * sizeof(int) );
int i;
for ( i = 0 ; i < allocated; i++)
darr[i] = temp[i];
free (temp);
allocated = allocated* 2;
Make sure your program runs properly when compiled using gcc on the bert.cs.uic.edu machine!(Do not use g++ or any other C++ compiler with this program.)
project base:
#include <stdio.h>
int main (int argc, char** argv)
{
int val;
/* prompt the user for input */
printf ("Enter in a list of numbers ito be stored in a dynamic array.\n");
printf ("End the list with the terminal value of -999\n");
/* loop until the user enters -999 */
scanf ("%d", &val);
while (val != -999)
{
/* store the value into an array */
/* get next value */
scanf("%d", &val);
}
/* call function to make a copy of the array of values */
/* call function to sort one of the arrays */
/* loop until the user enters -999 */
printf ("Enter in a list of numbers to use for searching. \n");
printf ("End the list with a terminal value of -999\n");
scanf ("%d", &val);
while (val != -999)
{
/* call function to perform target sum operation */
/* print out info about the target sum results */
/* get next value */
scanf("%d", &val);
}
printf ("Good bye\n");
return 0;
} In: Computer Science
|
Variables |
|
boolean gameLoss = false; |
|
int points = 15; |
|
boolean championship = false; |
|
Conditions: Evaluate then Indicate the truth value produced by the relational conditions and the joins. NOTE: Change in variable values do not carry over to next evaluation. |
Truth Value of Complex Conditions |
|
gameLoss && championship || points > 15 gameLoss && championship || points > 15 |
FALSE FALSE |
|
gameLoss && (championship == false) && (points >= 15) |
|
|
!(championship && gameLoss && (points > 30)) |
|
|
gameLoss = true; gameLoss & !(championship & (points != 15)) |
|
|
gameLoss ^ championship || (points == 15) |
|
|
points = 35; (gameLoss || championship) && (points > 29)) |
|
|
gameLoss & championship | (points == 43) |
|
|
!gameLoss | (championship ^ (points >= 15)) |
|
Variables |
|
int bowlGames = 9; |
|
double avgPrice = 3890.00; |
|
int maxQBWins = 6; |
|
Conditions: Evaluate then Indicate the truth value produced by the relational conditions and the joins. NOTE: Change in variable values do not carry over to next evaluation. |
Truth Value of Complex Conditions |
|
(maxQBWins > 2) && (avgPrice > 3000.00) | (++bowlGames >= 2) |
|
|
(bowlGames > 4) || (avgPrice >= 3890.00) && !(maxQBWins < 9) |
|
|
maxQBWins = 8 (bowlGames >= 4) & (avgPrice != 3890.00) || !(maxQBWins < 8) |
In: Computer Science
Question Objectives: The objectives of this lab exercise are to: Demonstrate an understanding of the concept of operator precedence in Python expressions and statements. Take simple problem descriptions and produce small but complete Python programs that solve these problems. Give you some practice in using simple Python interactive input and output capabilities. Give you some practice in the simplest Python decision statement (if). Give you some practice in the simplest Python loop statement (while). Specifications: This is a four-part exercise. For the three assignment statements listed below, label the operators according to the order they will be evaluated, i.e., label the first evaluated operator with a 1, the second with a 2, and so on. Then fill in the blank with the result assigned to variable x in each part. i. x = 7 + 3 * 6 / 2 – 1 x = ________ ii. x = 2 % 2 + 2 * 2 – 2 / 2 x = ________ iii. x = ( 3 * 9 * ( 3 + ( 9 * 3 / 3 ) ) ) x = ________ Write a Python program that inputs three (3) integers to IDLE from the keyboard and prints the sum, average, product, smallest and largest of these numbers. For this exercise you may assume the user does NOT enter any duplicate values. The interactive screen dialogue should look something like this (user input is shown in bold): Input three different integers separated by : 13 27 14 Sum is 54 Average is 18 Product is 4914 Smallest is 13 Largest is 27 Write a Python program in IDLE that asks for the radius of a circle and prints the circle’s diameter, circumference, and area. Import the math library for p. Do the calculations for diameter, circumference and area in the output statements. You do NOT need variables for holding your calculated values of diameter, circumference, or area. Just place the appropriate expression as an argument to the print() function. Write a Python program in IDLE that asks for an integer and determines and prints whether it is odd or even. (Hint: Use the modulus operator (%). An even number is a multiple of 2 and any multiple of 2 leaves a remainder of zero (0) when divided by 2). Discussion: In addition to the documentation requirements specified in lab 1, first write the entire program in pseudocode as comments. When necessary place a comment to the right of complicated lines to clarify your code to the reader. Further, comments should not merely repeat what is obvious from a program statement. For example, avoid what follows. This statement below adds nothing to understanding what the statement does or what its purpose is within the program: Sum = Sum + 1 # Add 1 to Sum ß A totally worthless comment! Deliverable(s): Your deliverable should be a Word document with screenshots showing the sample code you have created, and discuss the issues that you had for this project related to AWS and/or Python IDE and how you solved them. Turn in your source code listings for the programs developed above. Include screen shots of the results from running the programs you developed for three (3) sets of test data (for each program). Choose your test cases carefully so they reflect good values to test all aspects of your solutions.
In: Computer Science
5) For each type of cables/media below, advise under what situation you would use it and brief your reason.
- straight through cable
- cross-over cable
- rollover cable
- coaxial cable
- fiber
- wifi
In: Computer Science
In this assignment, you must use the MySQL Command Line Client Window.
Perform all the following steps in order. Some steps are repeated on purpose.
Open the MySQL Command Line Client.
1. The first query you must do, before creating the database is:
SELECT NOW();
2. Create a database named 'school'.
student (student_id, first_name, last_name, dob, home_street, home_city, home_state, home_zip) faculty (employee_id, first_name, last_name, dept_id) department (dept_id, dept_name, building_code)
You do not need to specify primary or foreign keys yet.
Choose appropriate data types and sizes for the fields.
3. Create the above tables.
4. Load fictitious data into your tables:
The faculty table should have at least 5 records.
The department table should have at least 3 records. The field building_code is a 3 letter code that identifies the location of the department, such as ENB, CPR...
You should make up your own data (do not use data from another student).
5. Write (and run) SQL queries to:
Show all existing databases in your RDBMS.
Show the tables in the 'school' database.
Show the structure of each table in the 'school' database.
Show all the data in each of the three tables in the 'school' database.
Show only the first name, last name and home city of all the students who live in Tampa.
6. The last query you must do, after everything is done is:
SELECT NOW();
In: Computer Science
Build an interactive calculator.
Using an Arduino Uno, the OLED Display and matrix keypad to build a simple calculator application. The user presses the operands and operators using the keypad. The calculation output should be displayed on the OLED display. You may make the following simplifying assumptions.
a)Assume 1 digit numbers
b) Assume only two operators ‘+’ and ‘-’
Upload the breadboard diagram and the code
In: Computer Science
1. Build a circuit in Logisim with the following characteristics:
2. Change your circuit from problem 1 so that it only uses decoders, OR gates, input pins, output pins, and wires.
3. Draw your circuit from problem 1 as a PLA.
In: Computer Science