Questions
Research Operating systems, and report on what resources you could use to get authoritative information about...

  • Research Operating systems, and report on what resources you could use to get authoritative information about mainstream modern Operating Systems.
  • Write a 1-2 page paper explaining your experience and reasons why OS analysis could benefit or has benefitted your forensic experience.

In: Computer Science

1. Write a program in C++ to find the factorial of a number. Prompt the user...

1. Write a program in C++ to find the factorial of a number. Prompt the user for a number and compute the factorial by using the following expression. Use for loops to write your solution code.
Factorial of n = n! = 1×2×3×...×n; where n is the user input.
Sample Output:
Find the factorial of a number:
------------------------------------
Input a number to find the factorial: 5
The factorial of the given number is: 120

2. Code problem 1 using While loop.

3. Write the code for a C++ program testMath.cpp that reads in two integer numbers from user input. Write the following functions in addition to the main() function for computing and returning the following to the main( ) function. 1. Function sum( ) computes and returns the sum of the two numbers, 2. Function diff( ) computes and returns the difference of the two numbers (always positive), 3. Function avg( ) computes and returns the average, 4. Function max( ) computes and returns the maximum of the two numbers 5. Function min( ) computes and returns the minimum of the two numbers   
The main( ) function performs the unit testing and tests all the functions.
Sample Output
This program reads in two integer numbers from user input
and returns their sum, difference, average, maximum and minimum.
Please enter the two numbers: 17 5
The numbers entered are 17 and 5.
The sum of 17 and 5 is: 22
The difference of 17 and 5 is: 12
The average of 17 and 5 is: 11
Fall 2019
The maximum of 17 and 5 is: 17
The minimum of 17 and 5 is: 5

In: Computer Science

Explain Ethics in research.

Explain Ethics in research.

In: Computer Science

Read in the names of several grocery items from the keyboard and create a shopping list...

Read in the names of several grocery items from the keyboard and create a shopping list using the Java ArrayList abstract data type.

Flow of Program:

1) Create a new empty ArrayList

2) Ask the user for 5 items to add to a shopping list and add them to the ArrayList (get from user via the keyboard).

3) Prompt the user for an item to search for in the list. Output a message to the user letting them know whether the item exists in the shopping list. Use a method that is part of the ArrayList class to do the search.

4) Prompt the user for an item to delete from the shopping list and remove it. (be sure to handle the case where they don’t want to delete anything). Use a method that is part of the ArrayList class to do the delete.

5) Prompt the user for an item to insert into the list. Ask them what they want to insert and where they want to insert it (after which item). Use a method that is part of the ArrayList class to do the insertion.

6) Output the final list to the user.

In: Computer Science

Task #1 – Software Sales A software company sells a package that retails for $99. Quantity...

Task #1 – Software Sales
A software company sells a package that retails for $99. Quantity discounts are given according to the following:
Quantity Discount
1 - 9 NO DISCOUNT
10 – 19 20%
20 – 49 30%
50 – 99 40%
100 or more 50%
Your program calculates the final purchase price of the software packages based on the quantity purchased. If a value of 0 or less (a negative number) is entered, display the message “Invalid Quantity” and end the program.
Input:
Ask the user to enter the quantity of packages purchased.
Process:
Calculate the subtotal (quantity * $99)
Apply the discount based on the discount schedule shown above.
Output:
Display the number of products purchased, the amount of the discount (if any) and the total amount of the purchase after the discount. Correctly format your output as currency ($xx.xx).
Sample User Input:
Enter the number of products purchased > 15
Sample User Output:
Your purchase of 15 products provides a quantity discount is 20%
Your total purchase price is $1198.00

Task #2 – The Bookseller
As a bookseller, you have a book club that awards points to its customers based on the number of books published each month.
The points awarded are as follows:
If the customer purchases 0 books, he/she earns 0 points
If the customer purchases 1 book, he/she earns 5 points
If the customer purchases 2 books, he/she earns 15 points
If the customer purchases 3 books, he/she earns 30 points
If the customer purchases 4 or more books, he/she earns 60 points
Write a program that asks the user to enter the number of books that he or she has purchased and then displays the number of points awarded. Use the SWITCH statement for this problem.
Input:
Prompt the user for the number of books purchased
Process:
Determine the number of points awarded based on the point schedule shown above
Output:
Display the number of points earned
Sample User Input:
Enter the number of books purchased > 1
Sample User Output:
You have earned 5 points

Task #3 – How much would you weigh on Mars
This task allows the user to determine how much they would weigh on any one of the planets in our Solar System.
How much you weigh depends on your mass, the mass of the planet, and the distance you are from the center of the planet. Since the various planets in our Solar System are different sizes, you will weigh less or more depending on the planet you are on. I will spare you some of the calculations and simplify it to: Weight = Mass x Surface Gravity
So, if you know your weight on Earth and the surface gravity on Earth, you can calculate your mass. You can then calculate your weight on any other planet by using the surface gravity of that planet in the same equation.

Process:
Read the Planet Name
Read your body mass
Using the Table of Mass shown below, calculate and display your weight using the equation:
Weight = Mass x Surface Gravity
Table of Surface Gravity for various planets
Mercury: 0.055
Venus: 0.82
Earth: 1.0
Mars: 0.11
Jupiter: 318
Saturn: 95.2
To simplify even further, I’m not giving you all of the planets in our Solar System.
In order to perform this task, you need some form of selection flow. The choice is up to you!
You will need to validate that a correct planet name was entered. Consider a mixed case entry of the planet – this is acceptable. However, misspellings are NOT acceptable.
If not, display a message indicating that the name entered was invalid and then exit the program!
Case 1:
Sample User Input for valid user input:
Enter the planet name> EArth
Enter your body mass (in pounds) > 100
Sample User Output:
Based on your body mass of 100, on the planet Earth, you would weigh 100 pounds

Case 2:
Sample User Input for invalid user input:
Enter the planet name> Earttttth
Enter your body mass (in pounds) > 100
Sample User Output:
You have entered an invalid planet name

Need this code in Java!

In: Computer Science

Provide an example for each of the following types of data model: -Conceptual data models -Physical...

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...

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...

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...

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.

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()...

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...

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...

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...

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

Evaluate the truth values of the following conditions given the values of the declared variables. NOTE:...

  1. Evaluate the truth values of the following conditions given the values of the declared variables. NOTE: Conditions formed using relational or equality operators (>, <, >=, <=, ==, !=) are relational conditions. Conditions formed using logical operators [&& (AND), || (OR), & (boolean AND), | (boolean inclusive OR), ^ (boolean exclusive OR) are complex conditions.

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