Questions
How does the IT industry measure employers productivity in an agile shop? I'm looking for some...

How does the IT industry measure employers productivity in an agile shop?

I'm looking for some research and a synopsis of each metric.

In: Computer Science

Please use c# and write a console application Part 1) A small airline has just purchased...

Please use c# and write a console application

Part 1) A small airline has just purchased a computer for its newly automated reservations system. You have been asked to develop a new system. You are to write an application to assign seats on each flight of the airline’s only plane. The plane has ten rows and each row has 2 seats (total capacity: 20 seats). The first five rows are for first class passengers, while the remaining rows are for economy passengers. The application is used by an airline employee who is given the task of assigning all seats to passengers (one passenger at a time). Your application should display the following alternatives: Please type 1 for First Class and Please type 2 for Economy or type 3 to see the status of all seats. If the user types 1, your application should assign a seat in the first-class section (rows 1–5). If the user types 2, your application should assign a seat in the economy section (rows 6–10).
If the user types 3, the application will display the status of all seats (“A” for available and “X” for booked) as shown below. The application will continue to ask for the user’s input until the flight is full or the user suggests that they do not want to assign anymore seats.
Availability Status:
X   X
X   X
X   A
A   A
A   A

X   X
X   X
X   X
X   X
A   A

Your application should never assign a seat that has already been assigned. When the economy section is full, your application should ask the person if it is acceptable to be placed in the first-class section (and vice versa). If yes, make the appropriate seat assignment. If no, display the message "Next flight leaves in 3 hours." You will need to use a multi-dimensional array to solve this problem. 

Part 2) Use a one-dimensional array to solve the following problem: A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who grosses $5000 in sales in a week receives $200 plus 9% of $5000, or a total of $650. Write an application (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assume that each salesperson’s salary is truncated to an integer amount):
a) $200–299
b) $300–399
c) $400–499
d) $500–599
e) $600–699
f) $700–799
g) $800–899
h) $900–999
i) $1000 and over
The application will accept sales amount until the user enters -1 to end (as shown in figure 2.1 below). At this point, the application calculates the salary and updates the appropriate counter of the array. For instance, if the salesperson gets a total salary of $565, you will update the counter that is counting totals between the $500-$599 range.

Figure 2.1. Receiving input from user

Note that you do NOT need to store the individual salary of the salesperson. Summarize the results in tabular format Use only a for loop to display the output.


Final output showing all ranges and the number of agents that received commission in that range

In: Computer Science

Python The following dictionary contains the list of US states with their abbreviations as keys and...

Python

The following dictionary contains the list of US states with their abbreviations as keys and full names as values:

states = {
        'AK': 'Alaska',
        'AL': 'Alabama',
        'AR': 'Arkansas',
        'AS': 'American Samoa',
        'AZ': 'Arizona',
        'CA': 'California',
        'CO': 'Colorado',
        'CT': 'Connecticut',
        'DC': 'District of Columbia',
        'DE': 'Delaware',
        'FL': 'Florida',
        'GA': 'Georgia',
        'GU': 'Guam',
        'HI': 'Hawaii',
        'IA': 'Iowa',
        'ID': 'Idaho',
        'IL': 'Illinois',
        'IN': 'Indiana',
        'KS': 'Kansas',
        'KY': 'Kentucky',
        'LA': 'Louisiana',
        'MA': 'Massachusetts',
        'MD': 'Maryland',
        'ME': 'Maine',
        'MI': 'Michigan',
        'MN': 'Minnesota',
        'MO': 'Missouri',
        'MP': 'Northern Mariana Islands',
        'MS': 'Mississippi',
        'MT': 'Montana',
        'NA': 'National',
        'NC': 'North Carolina',
        'ND': 'North Dakota',
        'NE': 'Nebraska',
        'NH': 'New Hampshire',
        'NJ': 'New Jersey',
        'NM': 'New Mexico',
        'NV': 'Nevada',
        'NY': 'New York',
        'OH': 'Ohio',
        'OK': 'Oklahoma',
        'OR': 'Oregon',
        'PA': 'Pennsylvania',
        'PR': 'Puerto Rico',
        'RI': 'Rhode Island',
        'SC': 'South Carolina',
        'SD': 'South Dakota',
        'TN': 'Tennessee',
        'TX': 'Texas',
        'UT': 'Utah',
        'VA': 'Virginia',
        'VI': 'Virgin Islands',
        'VT': 'Vermont',
        'WA': 'Washington',
        'WI': 'Wisconsin',
        'WV': 'West Virginia',
        'WY': 'Wyoming'
}

Write a program that randomly displays an abbreviation from this list, and then asks the user to enter the full name that matches that abbreviation. Once the user guesses, let the user know whether they are correct or incorrect. If they are incorrect, display the correct answer to the user.

In: Computer Science

Write a Python program to take as input 5 birthdays from 5 users (1 each) and...

Write a Python program to take as input 5 birthdays from 5 users (1 each) and output them in chronological order. Dates should include the month and day (not year) in the format “June 6” as a single input per user.

In: Computer Science

Create a class Pen to represent a pen according to the following requirements: A pen has...

  1. Create a class Pen to represent a pen according to the following requirements:
  1. A pen has two attributes: id and color.
  2. Add a constructer without parameters. In the initialization of the attributes, set the id to zero and the color to an empty string.
  3. Add a constructer with tow parameters to initialize the attributes id and color by a specific values.
  4. Add the method setId that set the id of a pen to a specific value.
  5. Add the method setColor that set the color of a pen to a specific value.
  6. Add the method getId that return the id of a pen.
  7. Add the method getColor that return the color of a pen.

  1. Create the class PenTester with the main method.
  1. Create tow pen P1 and P2 using the first constructor.
  2. Print the characteristics of P1 and P2.
  3. Create one pen P3 using the second constructor.
  4. Change the id of the pen P3.
  5. Print the id of P3.

In: Computer Science

Write a program in Java that asks a user for one integer between 1 and 10...

Write a program in Java that asks a user for one integer between 1 and 10 (inclusively). Write a switch statement writes out the number in english (i.e. 1 is “one”, etc).

In: Computer Science

Encode Diffie Hellamn exchange in software by writing a small program that accepts the values of...

Encode Diffie Hellamn exchange in software by writing a small program that accepts the values of p and g, and randomly generates the secret numbers SA and SB, and derives the Diffie Hellman secret.

Test it on the following examples:

p = 11, g = 13

p = 7, g = 17

p = 17, g = 13

In: Computer Science

Java 3. Describe the divide-and-conquer search algorithm and explain its efficiency. Consider two different Split functions:...

Java

3. Describe the divide-and-conquer search algorithm and explain its efficiency. Consider two different Split functions: Split = Lo, and Split = (Lo + Hi) / 2. Draw the trees of recursive calls. Assume that we are searching a large data base with 4 million items represented as an ordered array. How many probes into the list will the binary search require before finding the target or concluding that it cannot be found? Assume that it takes 1 microsecond to access an item, estimate the execution time of the binary search.

In: Computer Science

You have been approached by the Statistics Canada to create a C# program to calculate the...

You have been approached by the Statistics Canada to create a C# program to calculate the average salary of people with university degrees, college diplomas, and high school diplomas. Using a while loop, you are to process salary data until the user indicates that you should stop (there could be 0 or more data values). For each person processed, the program must first input an education type (char edType) (‘U’ or ‘u’ for university degrees, ‘C’ or ‘c’ for college diplomas, and ‘H’ or ‘h’ for high school) and then a salary (double salaryData). The program stops accepting input when the user enters a ‘Q’ or ‘q’ for quit (use a sentinel value while loop). Your main data processing loop should be conditioned on the fact that the user has not signalled quit. It might look something like:

while(char.ToUpper(edType) != ‘Q’)

This implies that like any sentinel value loop, you must seed the loop (input a value) PRIOR to entering the loop. Inside the loop the salary data is entered and processed. Once the main loop terminates, the average salary for each of the three education types should be printed out. Be sure to print an error message if the user enters an invalid education type or a negative salary.

In: Computer Science

C++ #include <iostream> using namespace std; struct Node {     int data;     Node* next;   ...

C++

#include <iostream>

using namespace std;

struct Node {
    int data;
    Node* next;
  
    Node(){
        data = 0;
        next = NULL;
    }
  
    Node(int x){
        data = x;
        next = NULL;
    }
};


struct LinkedList {
    Node* head;
  
    LinkedList(){
        head = NULL;
    }
  
    void append(int value){
      
        if (head == NULL){
            head = new Node(value);
        }
        else{
          
            Node* newNode = new Node(value);
          
            Node* temp = head;
            while(temp->next != NULL){
                temp = temp->next;
            }


            temp->next = newNode;
        }
    }
  
    void insertAt(int index, int value) {
        // Provide your code here
    }
  
    int getValue(int index){
        // Provide your code here
    }
  
    void setValue(int index, int value){
        // Provide your code here
    }
  
    void print (){
        Node* temp = head;
      
        while (temp != NULL) {
            cout << temp->data << endl;
            temp = temp->next;
        }
    }
  
    ~LinkedList(){
        Node* temp = head;
      
        while(temp != NULL){
            temp = temp->next;
            delete head;
            head = temp;
        }
    }
};


int main(int argc, const char * argv[]) {
  
    LinkedList myList;
  
  
    for (int i = 0; i < 6; i++) {
        myList.append(i);
    }
  
    myList.insertAt(2, 77);
  
    myList.insertAt(10, 89);
  
    myList.append(101);
  
    myList.setValue(0, 11);
  
    cout << myList.getValue(2) << endl << endl;
  
    myList.print();
  
    //    Expected output:
    //    77
    //
    //    11
    //    1
    //    77
    //    2
    //    3
    //    4
    //    5
    //    0
    //    0
    //    0
    //    89
    //    101
  
    return 0;
}

The first function you are being asked to implement is int getValueAt(int index) . This function simply returns the value that appears in the array position specified by index .

The second function is void setValueAt(int index, int value) . Its job is to store value in the array position corresponding to index .

The last function to implement is void insertAt(int index, int value) . As the name suggests, it needs to insert the value at the index. It should not overwrite anything. If there is already a something stored at index , it should be shifted to the right. If index is larger than the current size of the list, then it needs to be resized in order to accomodate. If there is a gap between the old size of the list, and the newly inserted value, that gap should be filled with 0s

In: Computer Science

C Programming Assignment 4 Cache Simulation Objective: To write a C program that simulates reading and...

C Programming Assignment 4

Cache Simulation

Objective:

To write a C program that simulates reading and writing to a custom-sized direct-mapped cache, involving a custom-sized main memory.

The program will read all values from the ZyLab as Test Bench inputs.

Main Menu Options:

The program simulates reading from and writing to a cache based on choosing from a menu of choices, where each choice calls the appropriate procedure, where the choices are:

  1. Enter Configuration Parameters
  2. Read from Cache
  3. Write to Cache
  4. Quit Program

Note that when you read from ZyLab, the input values are not displayed on the screen as they are in the sample run at the end of this document.

Inputs:

  • Enter Parameters
    • The total size of accessible main memory (in words)
    • The total size of the cache (in words)
    • The block size (words/block)
  • Read from Cache
    • The main memory address to read
  • Write to Cache
    • The main memory address to write
    • The contents of the address for writing to the cache

Input Value Checks:

  • All the parameter values must be powers of 2.
  • The block size must never be larger than the size of accessible main memory.
  • The total cache size must be some multiple of the block size.
  • Your program should verify that all input variables are within limits as they are entered.

Output Messages:

All messages should be display EXACTLY as shown in the sample run; that is, prefixed by three asterisks, a space and hyphen and one more space. The message should be followed by a blank line.   

  • Data Accepted Message is comprised of two sentences:

*** All Input Parameters Accepted.

     Starting to Process Write/Read Requests

  • Error Messages are preceded by “*** Error –“. A list of possible errors is given below.

Note that one message has been deleted from previous versions of this Specification and three new ones have been added.

*** Error - Main Memory Size is not a Power of 2

*** Error - Block Size is not a Power of 2

*** Error - Cache Size is not a Power of 2

*** Error – Block size is larger than cache size

  • Deleted Error Message

*** Error – Cache Size is not a multiple of Block Size

  • Newly Added Error Messages

*** Error – Read Address Exceeds Memory Address Space

*** Error – Write Address Exceeds Memory Address Space (The write value following the invalid address value should be read and then discarded)

*** Error – Invalid Menu Option Selected (Until configuration data has been accepted, the only valid menu options that can be entered are “1” or “4.”)

Whenever any one of these errors occurs, the program should loop back to the Main Menu.

  • Content Message resulting from reading/writing to the cache

*** Word WW of Cache Line LL with Tag TT contains Value VV

This message should appear after all successful reads or writes

WW is the word number in the cache line, LL is the line number in the cache, TT is the line’s tag value and VV is the content value in the cache.

All values are in decimal.

  • Read Messages (two possible messages)

*** Read Miss - First Load Block from Memory (followed on the next line by the Content Message above)

*** Cache Hit (followed on the next line by the Content Message above)

  • Write Messages

*** Write Miss - First Load Block from Memory (followed on the next line by the Content Message above)

*** Cache Hit (followed on the next line by the Content Message above)

  • Quit Program Message

*** Memory Freed Up – Program Terminated Normally

When option 4 is entered, the memory should be freed up and the message “Memory Freed Up – Program Terminated Normally”, followed by a blank line, should be displayed before exiting the program.

Program Requirements:

  • Use a structure (struct) to represent a cache line consisting of a tag (integer) and a block (integer pointer). Define the cache to be a pointer to the struct.
  • Upon entering the parameters, the main memory and cache are to be dynamically allocated (use malloc) based on their respective total sizes.

Each word i of main memory is initialized with the value Mi, where M is the size of main memory in words. So, memory location 0 will contain the address of the last memory location and the last memory location will contain the address of the first memory location (i.e. 0).

  • Reading/writing from/to a new block in the cache results in dynamically allocating a block for that instance, based on the previously entered block size.

Prologue & Comments:

At the very beginning of your source code (the very first lines), please include a prologue which looks like the following:

/*

Dr. George Lazik                      (use your full name not mine)

Programming Assignment 4: Cache Simulation

Comp 222 – Fall 2019

Meeting Time: 0800-0915       (your meeting time)

*/

  • Include simple (brief) comments strategically throughout your program so that someone else can readily follow what you are doing, but don’t overdo it. Examples might look like these:

// Reading input values from ZyLab

// Determining the contents of memory

ZyLab Test Benches:

  • You will be permitted unlimited submission attempts on ZyLab until the due date. Afterwards, the inputs will be changed, the point value of the assignment will be increased to 100 and only one submission will be permitted. This last submission will be on the day following the due date and should be the one with the highest score.

  • Hardcopy printed listing of your program. Please place this on the Professor’s desk at the beginning of class on day the assignment is due. It should be properly C formatted listing and not one from programs such as Word.

Make sure your full name appears on each page of the listing and that all pages are stapled together in their correct order BEFORE you come to class.

Failure to provide this listing will result in no grade for the assignment.

Sample Test Run

The following is a sample run of one of the tests in Assignment 4’s Test Bench on ZyBooks. Note: Some recently added error conditions are not included in this run.

1

65536

512

1024

1

65536

1027

16

1

65536

1024

15

1

65537

1026

4096

1

65536

1024

18

1

65536

1024

16

3

65535

14

2

65535

3

65534

512

2

1023

4

Your output

Programming Assignment 4: Cache Simulation

Comp 222 - Fall 2019

Main Menu - Main Memory to Cache Memory Mapping

------------------------------------------------

1) Enter Configuration Parameters

2) Read from Cache

3) Write to Cache

4) Quit Program

Enter selection:

Enter main memory size (words):

Enter cache size (words):

Enter block size (words/block):

*** Error - Block Size is Larger than Cache Size

Main Menu - Main Memory to Cache Memory Mapping

------------------------------------------------

1) Enter Configuration Parameters

2) Read from Cache

3) Write to Cache

4) Quit Program

Enter selection:

Enter main memory size (words):

Enter cache size (words):

Enter block size (words/block):

*** Error - Cache Size is not a Power of 2

Main Menu - Main Memory to Cache Memory Mapping

------------------------------------------------

1) Enter Configuration Parameters

2) Read from Cache

3) Write to Cache

4) Quit Program

Enter selection:

Enter main memory size (words):

Enter cache size (words):

Enter block size (words/block):

*** Error - Block Size is not a Power of 2

Main Menu - Main Memory to Cache Memory Mapping

------------------------------------------------

1) Enter Configuration Parameters

2) Read from Cache

3) Write to Cache

4) Quit Program

Enter selection:

Enter main memory size (words):

Enter cache size (words):

Enter block size (words/block):

*** Error - Main Memory Size is not a Power of 2

Main Menu - Main Memory to Cache Memory Mapping

------------------------------------------------

1) Enter Configuration Parameters

2) Read from Cache

3) Write to Cache

4) Quit Program

Enter selection:

Enter main memory size (words):

Enter cache size (words):

Enter block size (words/block):

*** Error - Cache size is not a multiple of block size

Main Menu - Main Memory to Cache Memory Mapping

------------------------------------------------

1) Enter Configuration Parameters

2) Read from Cache

3) Write to Cache

4) Quit Program

Enter selection:

Enter main memory size (words):

Enter cache size (words):

Enter block size (words/block):

*** All Input Parameters Accepted. Starting to Process Write/Read Requests

Main Menu - Main Memory to Cache Memory Mapping

------------------------------------------------

1) Enter Configuration Parameters

2) Read from Cache

3) Write to Cache

4) Quit Program

Enter selection:

Enter Main Memory Address to Write:

Enter Value to Write:

*** Write Miss - First load block from memory

*** Word 15 of Cache Line 63 with Tag 63 contains the Value 14

Main Menu - Main Memory to Cache Memory Mapping

------------------------------------------------

1) Enter Configuration Parameters

2) Read from Cache

3) Write to Cache

4) Quit Program

Enter selection:

Enter Main Memory Address to Read:

*** Cache Hit

*** Word 15 of Cache Line 63 with Tag 63 contains the Value 14

Main Menu - Main Memory to Cache Memory Mapping

------------------------------------------------

1) Enter Configuration Parameters

2) Read from Cache

3) Write to Cache

4) Quit Program

Enter selection:

Enter Main Memory Address to Write:

Enter Value to Write:

*** Cache Hit

*** Word 14 of Cache Line 63 with Tag 63 contains the Value 512

Main Menu - Main Memory to Cache Memory Mapping

------------------------------------------------

1) Enter Configuration Parameters

2) Read from Cache

3) Write to Cache

4) Quit Program

Enter selection:

Enter Main Memory Address to Read:

Read Miss - First Load Block from Memory

*** Word 15 of Cache Line 63 with Tag 0 contains the Value 64513

Main Menu - Main Memory to Cache Memory Mapping

------------------------------------------------

1) Enter Configuration Parameters

2) Read from Cache

3) Write to Cache

4) Quit Program

Enter selection:

*** Memory Freed Up - Program Terminated Normally

In: Computer Science

Describe the differences between a legal duty and a moral duty. Define each in your own...

Describe the differences between a legal duty and a moral duty. Define each in your own words, and describe the differences between the two across relevant aspects, including how each is established and enforced, and consequences of not honouring the duty.

b) Give a specific, detailed example of an event where there were negative consequences for a person or group who didn’t honour a moral duty (Hint - loss of reputation is one possible negative consequence). Describe the event and explain how the consequences came about.

In: Computer Science

Create a program in java eclipse named “Forecast” and a method called “String getWeather(boolean raining, int...

Create a program in java eclipse named “Forecast” and a method called “String getWeather(boolean raining, int temperature)”. Depending on the parameters, return one of four outcomes:

If it’s not raining and under 30 degrees: return “The weather is chilly”

If it’s not raining and at/over 30 degrees: return “The weather is sunny”

If it’s raining and under 30 degrees: return “The weather is snowy”

If it’s raining and at/over 30 degrees: “The weather is rainy”

You must use nested if statements for this problem.

In: Computer Science

Consider a file system in which multiple users/clients can access the data from the disks over...

Consider a file system in which multiple users/clients can access the data from the disks
over storage network. Assume each user/client has its file system and considers its storage
disks (shared with other clients) as local.
(a) Explain how this file system is different as compared to NFS (Network File
Servers).
(b) What are the major advantages and disadvantages of this type of file systems (do
not repeat the points mentioned in answering the part-a)?

In: Computer Science

Problem 1: Define the following terms: Phishing Denial of service attack Distributed denial of service attack...

Problem 1: Define the following terms:

Phishing
Denial of service attack
Distributed denial of service attack
Cookie
Blockchain

In: Computer Science