Questions
SOLVE IN C: Playing with encryption: Write a program that will read a four-digit integer entered...

SOLVE IN C: Playing with encryption:

Write a program that will read a four-digit integer entered by the user and encrypt it as follows: Replace each digit with the result of adding 7 to the digit and getting the remainder after dividing the new value by 10. Then swap the second digit with the fourth. Finally, print the original number and its encrypted one. Now reverse the process. Read an encrypted integer and decrypt it by reversing the algorithm to obtain the original number. Print out both the encrypted and decrypted integer.

need help finishing code on encryption in C I was assigned to encrypt and then decrypt a number by reversing the process to get it's original number. Here are the original instructions from my teacher:

I was able to encrypt, but now I am struggling with how to decrypt it back to it's original number. Here is my code:

You'll see my comment where I say I can't figure it out from a certain point and where the code needs to be fixed in bold.

#include
int main(){

int digit; // stores initial 4 digit integer value.
int digit1; // used to retrieve first digit.
int digit2; // retrieve second digit.
int digit3; // retrieve third digit.
int digit4; // retrieve fourth digit.
int swappedDigit; // the new encrypted digit value.

int decry; // stores initial 4 digit integer value.
int decry1; // first digit retrieval.
int decry2; // second digit retrieval.
int decry3; // third digit retrieval.
int decry4; // fourth digit retrieval.
int decrypt; // final decrypted digit.


printf("Enter a 4 digit number:\n");
scanf("%d", &digit);

/* the following 4 lines isolate each digit, as well as adding 7 to them and getting the remainder.
*/
digit1 = digit /1000 % 10;
digit1 = (digit1 + 7) % 10;


digit2 = digit /100 % 10;
digit2 = (digit2 + 7) %10;


digit3 = digit /10 % 10;
digit3 = (digit3 + 7) %10;


digit4 = digit % 10;
digit4 = (digit4 + 7) %10;

/* this formula below swaps the second and fourth numbers of the new decimal number from the formula above.
This gives us the new encrypted number. */

swappedDigit = (digit1 * 1000) + (digit2) + (digit3 * 10) + (digit4 * 100);

// printing the original number and the new encrypted number stored as "swappedDigit".
printf("The original digit is %d\n", digit);
printf("The encrypted digit is %d\n", swappedDigit);

// alerting the user to now input the same number to decrypt it by reversing the process.

printf("Now time to reverse the process.\n");
printf("Enter a 4 digit encrypted number:\n");
scanf("%d", &decry);


// this bottom part is all wrong. Not sure how to reverse it from here. Adding 3 only works for some numbers.

decry1 = decry /1000 % 10 + 3;
decry2 = decry /100 % 10 + 3;
decry3 = decry /10 % 10 + 3;
decry4 = decry % 10 + 3;

// swapping the second and fourth digits back to where they were originally.

decrypt = (decry1 * 1000) + (decry2) + (decry3 * 10) + (decry4 * 100);

// finally, printing the original decrypted number.

printf("The decrypted number is %d", decrypt);


   return 0;
}

In: Computer Science

Step me through an illustrated example (including all needed variables/arrows) of a Linked-List of size 5,...

Step me through an illustrated example (including all needed variables/arrows) of a Linked-List of size 5, where the positions of nodes 3 and 4 are swapped.

In: Computer Science

Hello, I need to divide my code in this different parts. Use a standard approach to...

Hello, I need to divide my code in this different parts.

Use a standard approach to source files in this assignment: a .cpp for each function (you have at least two – main and ageCalc) a header file for the student struct, properly guarded

Code:

#include <iostream>

#include <string>

#include <fstream>

#include <algorithm>

#include <vector>

#include <iomanip>

using namespace std;

#define nullptr NULL

#define MAX_SIZE 100

struct Student

{

    string firstName;

    char middleName;

    string lastName;

    char collegeCode;

    int locCode;

    int seqCode;

    int age;

};

struct sort_by_age

{

    inline bool operator()(const Student *s1, const Student *s2)

    {

        return (s1->age < s2->age);

    }

};

int ageCalc(Student *studs[], Student *&youngest);

int main()

{

    Student *students[MAX_SIZE] = {nullptr};

    ifstream Myfile;

    Myfile.open("a2data.txt");

    if (!Myfile.is_open())

    {

        cout << "Could not open the file!";

        return 1;

    }

    vector<string> words;

    string line;

    while (!Myfile.eof())

    {

        getline(Myfile, line);

        line.c_str();

        int i = 0;

        string word = "";

        while (line[i] != '\0')

        {

            if (line[i] != ' ')

            {

                word = word + line[i];

                i++;

            }

            else

            {

                if (word != "")

                    words.push_back(word);

                word = "";

                i++;

            }

        }

        words.push_back(word);

    }

    Myfile.close();

    int count = 0;

    string fname = words.at(count);

    count++;

    int n = 0;

    while (count < words.size() - 2)

    {

        Student *s = new Student;

        s->firstName = fname;

        string mname = words.at(count);

        s->middleName = mname[0];

        count++;

        s->lastName = words.at(count);

        if (words.at(count).size() >= 12)

        {

            if (words.at(count)[1] >= '0' && words.at(count)[1] <= '9')

            {

                count--;

                s->middleName = ' ';

                s->lastName = words.at(count);

            }

        }

        count++;

        string id = words.at(count);

        count++;

        s->collegeCode = id[0];

        string loc = "";

        loc = loc + id[1];

        loc = loc + id[2];

        s->locCode = stoi(loc);

        string seq = "";

        for (int j = 3; j < 9; j++)

        {

            seq = seq + id[j];

        }

        s->seqCode = stoi(seq);

        string age = "";

        age = age + id[9];

        age = age + id[10];

        age = age + id[11];

        s->age = stoi(age);

        fname = id.erase(0, 12);

        students[n] = s;

        n++;

    }

    words.clear();

    sort(students, students + n, sort_by_age());

    cout << setw(15) << left << "Last Name";

    cout << setw(15) << left << "Midlle Name";

    cout << setw(15) << left << "First Name";

    cout << setw(15) << left << "College Code";

    cout << setw(12) << left << "Location";

    cout << setw(12) << left << "Sequence";

    cout << setw(12) << left << "Age" << endl;

    cout << "=======================================================================================" << endl;

    for (int i = 0; i < n; i++)

    {

        cout << setw(15) << left << students[i]->lastName;

        cout << setw(15) << left << students[i]->middleName;

        cout << setw(20) << left << students[i]->firstName;

        cout << setw(13) << left << students[i]->collegeCode;

        cout << setw(10) << left << students[i]->locCode;

        cout << setw(12) << left << students[i]->seqCode;

        cout << students[i]->age << endl;

    }

    cout << endl;

    Student *youngest = NULL;

    int avg_age = ageCalc(students, youngest);

    cout << "Average age is: " << avg_age << endl;

    cout << "Youngest student is " << youngest->firstName << " " << youngest->middleName << " " << youngest->lastName << endl;

    return 0;

}

int ageCalc(Student *studs[], Student *&youngest)

{

    youngest = studs[0];

    int i = 0;

    int avg_age = 0;

    while (studs[i] != NULL)

    {

        avg_age += studs[i]->age;

        if (youngest->age > studs[i]->age)

            youngest = studs[i];

        i++;

    }

    return avg_age / i;

}

File needed:

https://drive.google.com/file/d/15_CxuGnFdnyIj6zhSC11oSgKEYrosHck/view?usp=sharing

In: Computer Science

Hello, I need to divide my code in this different parts. Use a standard approach to...

Hello, I need to divide my code in this different parts.

Use a standard approach to source files in this assignment: a .cpp for each function (you have at least two – main and ageCalc) a header file for the student struct, properly guarded

Code:

#include <iostream>

#include <string>

#include <fstream>

#include <algorithm>

#include <vector>

#include <iomanip>

using namespace std;

#define nullptr NULL

#define MAX_SIZE 100

struct Student

{

    string firstName;

    char middleName;

    string lastName;

    char collegeCode;

    int locCode;

    int seqCode;

    int age;

};

struct sort_by_age

{

    inline bool operator()(const Student *s1, const Student *s2)

    {

        return (s1->age < s2->age);

    }

};

int ageCalc(Student *studs[], Student *&youngest);

int main()

{

    Student *students[MAX_SIZE] = {nullptr};

    ifstream Myfile;

    Myfile.open("a2data.txt");

    if (!Myfile.is_open())

    {

        cout << "Could not open the file!";

        return 1;

    }

    vector<string> words;

    string line;

    while (!Myfile.eof())

    {

        getline(Myfile, line);

        line.c_str();

        int i = 0;

        string word = "";

        while (line[i] != '\0')

        {

            if (line[i] != ' ')

            {

                word = word + line[i];

                i++;

            }

            else

            {

                if (word != "")

                    words.push_back(word);

                word = "";

                i++;

            }

        }

        words.push_back(word);

    }

    Myfile.close();

    int count = 0;

    string fname = words.at(count);

    count++;

    int n = 0;

    while (count < words.size() - 2)

    {

        Student *s = new Student;

        s->firstName = fname;

        string mname = words.at(count);

        s->middleName = mname[0];

        count++;

        s->lastName = words.at(count);

        if (words.at(count).size() >= 12)

        {

            if (words.at(count)[1] >= '0' && words.at(count)[1] <= '9')

            {

                count--;

                s->middleName = ' ';

                s->lastName = words.at(count);

            }

        }

        count++;

        string id = words.at(count);

        count++;

        s->collegeCode = id[0];

        string loc = "";

        loc = loc + id[1];

        loc = loc + id[2];

        s->locCode = stoi(loc);

        string seq = "";

        for (int j = 3; j < 9; j++)

        {

            seq = seq + id[j];

        }

        s->seqCode = stoi(seq);

        string age = "";

        age = age + id[9];

        age = age + id[10];

        age = age + id[11];

        s->age = stoi(age);

        fname = id.erase(0, 12);

        students[n] = s;

        n++;

    }

    words.clear();

    sort(students, students + n, sort_by_age());

    cout << setw(15) << left << "Last Name";

    cout << setw(15) << left << "Midlle Name";

    cout << setw(15) << left << "First Name";

    cout << setw(15) << left << "College Code";

    cout << setw(12) << left << "Location";

    cout << setw(12) << left << "Sequence";

    cout << setw(12) << left << "Age" << endl;

    cout << "=======================================================================================" << endl;

    for (int i = 0; i < n; i++)

    {

        cout << setw(15) << left << students[i]->lastName;

        cout << setw(15) << left << students[i]->middleName;

        cout << setw(20) << left << students[i]->firstName;

        cout << setw(13) << left << students[i]->collegeCode;

        cout << setw(10) << left << students[i]->locCode;

        cout << setw(12) << left << students[i]->seqCode;

        cout << students[i]->age << endl;

    }

    cout << endl;

    Student *youngest = NULL;

    int avg_age = ageCalc(students, youngest);

    cout << "Average age is: " << avg_age << endl;

    cout << "Youngest student is " << youngest->firstName << " " << youngest->middleName << " " << youngest->lastName << endl;

    return 0;

}

int ageCalc(Student *studs[], Student *&youngest)

{

    youngest = studs[0];

    int i = 0;

    int avg_age = 0;

    while (studs[i] != NULL)

    {

        avg_age += studs[i]->age;

        if (youngest->age > studs[i]->age)

            youngest = studs[i];

        i++;

    }

    return avg_age / i;

}

File needed:

https://drive.google.com/file/d/15_CxuGnFdnyIj6zhSC11oSgKEYrosHck/view?usp=sharing

In: Computer Science

Using PHP Provide and the ability for the user to determine their userid and to change...

Using PHP

Provide and the ability for the user to determine their userid and to change their password if they forget either.

Also, provide the ability for the user to change the password whenever they chose. If they are changing their password (when they know the password), they must be required to enter the old password, and then the new password (twice).

Anytime the password is changed it must verify the correct format of the password as previously mentioned in other assignments.

Make sure that your program works properly.

In: Computer Science

ASSIGNMENT 5 REQUIREMENTS The distance a vehicle travels can be calculated as follows: distance = speed...

ASSIGNMENT 5 REQUIREMENTS

The distance a vehicle travels can be calculated as follows:

distance = speed * time

For example, if a train travels 40 miles per hour for 3 hours,

the distance traveled is 120 miles.

Write a program that asks the user for the speed of a vehicle

(in miles per hour) and how many hours it has traveled.

The program should then use a loop to display the distance the

vehicle has traveled for each hour of that time period.

Here is an example of the output:

What is the speed of the vehicle in mph? 40

How many hours has it traveled? 3

Hour Distance Traveled

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

1. 40

2. 80

3. 120

Input Validation:

Do not accept a negative number for speed and

do not accept any value less than 1 for time traveled.

=================================================================

TEST SET

============================

TEST CASE SPEED HOURS

1. 55 12

2. 65 10

3. 75 8

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

In: Computer Science

Queues are often used to represent lists of things that are being processed according to the...

Queues are often used to represent lists of things that are being processed according to the order in which they arrived -- i.e. "first come, first served".  

Assignment

Write a program that simulates the minute-by-minute operation of a checkout line, such as one you might find in a retail store. Use the following parameters:

1) Customers arrive at the checkout line and stand in line until the cashier is free.

2) When they reach the front of the line, they occupy the cashier for some period of time (referred to as ServiceTime) measured in minutes.

3) After the cashier is free, the next customer is served immediately.

4) Customers arrive at the checkout line at ArrivalRate per minute. Use the function included below (randomChance()) to return the number of customers arriving in a given minute, determined randomly.

5) The line can only hold so many people, MaxLineSize, until new arriving customers get frustrated and leave the store without purchasing anything.

6) ServiceTime is determined at the point the customer reaches the cashier, and should be taken from the random interval MinServiceTime and MaxServiceTime -- use the function randomInt() provided.

7) The overall time of the simulation is SimulationTime, measured in minutes.

The program should take 6 inputs (to be read from a text file named simulation.txt, as numbers only, one per line, in this order):

- SimulationTime - total number of minutes to run the simulation (whole number).

- ArrivalRate - per-minute arrival rate of customers (a floating point number greater than 0 and less than 1). This number is the "percent chance" that a customer will arrive in a given minute. For example, if it is 0.4, there is a 40% chance a customer will arrive in that minute.

- MinServiceTime - the minimum expected service time, in minutes (whole number).

- MaxServiceTime - the maximum expected service time, in minutes (whole number).

- MaxLineSize - the maximum size of the line. If a new customer arrives and the line has this many customers waiting, the new customer leaves the store unserviced.

- IrateCustomerThreshold - nobody enjoys standing in line, right? This represents the number of minutes after which a customer becomes angry waiting in line (a whole number, at least 1). These customers do not leave, they only need to be counted.

At the end of each simulation, the program should output:

- The total number of customers serviced

- The total number of customers who found the line too long and left the store.

- The average time per customer spent in line

- The average number of customers in line

- The number of irate customers (those that had to wait at least IrateCustomerThreshold minutes)

You are free to use any STL templates as needed (queue or vector, for example).

An example input file is posted in this week's Module here.

Example Run

The output should look similar to this:

Simulation Results
------------------
Overall simulation time:     2000
Arrival rate:                 0.1
Minimum service time:           5
Maximum service time:          15
Maximum line size:              5

Customers serviced:           183
Customers leaving:             25
Average time spent in line: 33.86
Average line length:         3.15
Irate customers                10

What to Submit

Submit your .cpp file (source code for your solution) in Canvas.

Random Functions

Use these provided functions for generating your random chance (for a customer arrival) and interval for service times.

bool randomChance(double prob) { 
    double rv = rand() / (double(RAND_MAX) + 1); 
    return (rv < prob); 
} 

int randomInt(int min, int max) { 
    return (rand() % (max - min) + min); 
} 

Before calling these functions be sure to seed the random number generator (you can do this in main()):

srand(time(0));

Outline:

#include <iostream>
#include <queue>

using namespace std;

int main()
{
queue<int> myQ;

// For each test case, do a loop like this:
for (int i = 0; i < SIMULATION_TIME; i++) {
if (randomChance(ARRIVAL_RATE)) {

// Did a customer arrive in this minute?
// If so, put them on the queue
// - Is the queue full? If so, they left.
// If not, continue with rest of the loop

// Checking on the checkout line:
// - Is the current person done?
// - If so, take the next person
// - Get
// - Record how long they waited
// - Generate a random for how long
// they will take at the checkout

// Record various metrics:
// - Average wait time
// - Is the customer irate?
// - Average queue length
// - Increment number of customers serviced
// - How many left because the line was full?

}

// Print a report here

return 0;
}

Test input:

2000
0.10
5
15
5
20
10000
0.05
5
15
5
18
2000
0.20
5
20
10
10
2000
0.20
1
5
10
25
20000
0.50
1
2
50
10

In: Computer Science

3.3 Briefly define the following ciphers: -Caesar cipher -Monoalphabetic cipher -Playfair cipher 3.4 What is steganography?

3.3 Briefly define the following ciphers:

-Caesar cipher

-Monoalphabetic cipher

-Playfair cipher

3.4 What is steganography?

In: Computer Science

Declare a Python list named famfri with the first names of five friends or family members....

Declare a Python list named famfri with the first names of five friends or family members.

Lists and tuples are examples of what kind of Python construct?

Write a Python for loop that prints the names of the friends or family, one per line, without referencing a range or any literal numeric values.


Write Python code examples of statements to remove the name at position 2 from the list in the first problem, and to remove one of the remaining names by referencing that name.

In: Computer Science

A company would like to implement its inventory of smartphones as a doubly linked list, called...

A company would like to implement its inventory of smartphones as a doubly linked list, called

MobileList.

1. Write a Mobile node node class, called MobileNode, to hold the following information about a

smartphone:

• code (as a String)

• brand (as a String)

• model (as a String)

• price (as int)

MobileNode should have constructors and methods (getters, setters, and toString()) to manage

the above information as well as the link to next and previous nodes in the list.

2. Write the MobileList class to hold objects of the class MobileNode. This class should define:

• Two instance variables first and last to keep the reference (address) of the first and last

nodes of the list.

• The MobileList class should implement the following interface:

public interface MList {

public boolean isEmpty();

// returns true if the list is empty, false otherwise

public int size();

// returns the number of items in the list

public MobileNode getNodeAt(int index);

//returns the MobileNode object at the specified index

public void addFirst(MobileNode item);

// adds a Mobile node at the front of the list

public void addLast(MobileNode item);

// adds a Mobile node at the end of the list

public void addAt(int index, MobileNode item);

// adds a Mobile node to the list at the given index

public String removeAt(int index);

// removes the Mobile node from the list that has the given

// index

public String remove(MobileNode item);

// removes the first item in the list whose data equals

// the given item data

public MobileNode[] searchPriceGreaterThan(int p);

//search and return an array of the set of MobileNode items

//having a price greater than p

public double averagePrice();

// return the average price of the mobile nodes in the list

public double averageBrandPrice(String brand);

// return the average price of the mobile nodes in the list

// from the brand given as a parameter (e.g., “Samsung” or

// “samsung”)

@Override

public String toString();

// implement a toString() method that prints the list in the

// format:

//[ size: the_size_of_the_list

// Mobile node1,

// Mobile node2,

//.... ]

}

3. Write a TestMobileList class to test the class MobileList. This class should have a main method

in which you perform the following actions:

• Create a MobileList object,

• Insert 10 MobileNode objects into the created list (from some brands like “Apple”,

“Samsung”, “Huwaei”, “Sony”),

• Print the content of your list,

• Find out in the list the items that have a price greater than 3000. Print them out.

• Remove the first element of the list

• Remove the item at index 3

• Print again the content of your ist,

• Print out the average price of all mobiles in the list

• Print out the average price of all mobiles in the list from “Apple”.

For each operation above, print a small message that describes the operation you are doing.

For example:

System.out.println(“Insertion of 10 Mobile nodes in the list”);

In: Computer Science

Valid or Invalid Password Deliverables • Complete one document that shows your planning (IPO Chart). Include...

Valid or Invalid Password Deliverables

• Complete one document that shows your planning (IPO Chart). Include in it Input, Processing, Output, Variables, Algorithm, Testing Conditions

• Complete the code for your method and test it then upload for grading

Requirements: Write a Java method to check whether a string is a valid password.

Password rules: A password must have at least ten characters.

A password consists of only letters and digits.

A password must contain at least two digits.

Expected Output:

1. A password must have at least eight characters.

2. A password consists of only letters and digits.

3. A password must contain at least two digits Input a password (You are agreeing to the above Terms and Conditions.): abcd1234 Password is valid: abcd1234

In: Computer Science

Language Javascript and HTML Google Treemap Chart is not displaying information and I don't know why....

Language Javascript and HTML

Google Treemap Chart is not displaying information and I don't know why.

Index.html

<html>

<head>

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>

<script type="text/javascript">

google.charts.load('current', {'packages':['treemap']});

google.charts.setOnLoadCallback(drawChart);

function drawChart() {

var data = google.visualization.arrayToDataTable([

['State', 'Region', 'Housing', 'Utilities'],

['Global', null, 0, 0],

['AK', 'Southeast', 150, 167],

['AL', 'Southeast', 79, 99],

['AR', 'Southeast', 83, 92],

['AZ', 'Southwest', 110, 95],

['CA', 'West', 184, 107],

['CO)', 'West', 103, 94],

['CT', 'Northeast', 161, 122],

['DC', 'Northeast', 248, 103],

['DE', 'Northeast', 101, 122],

['FL', 'Southeast', 92, 99],

['GA', 'Southeast', 80, 98],

['HI', 'West', 236, 167],

['IA', 'Midwest', 92, 90],

['ID', 'West', 79, 93],

['IL', 'Midwest', 89, 102],

['IN', 'Midwest', 82, 87],

['KS', 'Midwest', 85, 87],

['KY', 'Southeast', 78, 95],

['LA', 'Southeast', 91, 84],

['MA', 'Northeast', 130, 120],

['MD', 'Northeast', 175, 109],

['ME', 'Northeast', 133, 109],

['MI', 'Midwest', 86, 103],

['MN', 'Midwest', 96, 101],

['MO', 'Midwest', 80, 103],

['MS', 'Southeast', 83, 108],

['MT', 'West', 97, 88],

['NC', 'Southeast', 83, 98],

['ND', 'Midwest', 100, 82]

['NE', 'Midwest', 82, 99]

['NH', 'Northeast', 128, 125]

['NJ', 'Northeast', 166, 135]

['NM', 'Southwest', 97, 92]

['NV', 'West', 87, 84]

['NY', 'Northeast', 188, 117]

['OH', 'Midwest', 83, 97]

['OK', 'Southwest', 80, 93]

['OR', 'West', 117, 99]

['PA', 'Northeast', 98, 109]

['RI', 'Northeast', 132, 124]

['SC', 'Southeast', 83, 107]

['SD', 'Midwest', 98, 94]

['TN', 'Southeast', 78, 89]

['TX', 'Southwest', 83, 96]

['UT', 'West', 82, 85]

['VA', 'Southeast', 93, 97]

['VT', 'Northeast', 138, 128]

['WA', 'West', 102, 85]

['WI', 'Midwest', 91, 104]

['WV', 'Southeast', 86, 100]

['WY', 'West', 117, 95]

]);

tree = new google.visualization.TreeMap(document.getElementById('chart_div'));

tree.draw(data, {

minColor: '#f00',

midColor: '#ddd',

maxColor: '#0d0',

headerHeight: 15,

fontColor: 'black',

showScale: true

});

}

</script>

</head>

<body>

<div id="chart_div" style="width: 900px; height: 500px;"></div>

</body>

</html>

In: Computer Science

Write a function in python that accepts a sentence as the argument and converts each word...

Write a function in python that accepts a sentence as the argument and converts each word to “Pig Latin.” In one version, to convert a word to Pig Latin, you remove the first letter and place that letter at the end of the word. Then you append the string “ay” to the word. Here is an example: English: I SLEPT MOST OF THE NIGHTPIG LATIN: IAY LEPTSAY OSTMAY FOAY HETAY IGHTNAY. Please, I want the coding indented and then the results screen shot.

In: Computer Science

Below is an invoice sent out by MegaCorp. Order ID Order Customer Customer Customer Product Product...

Below is an invoice sent out by MegaCorp.

Order ID

Order

Customer

Customer

Customer

Product

Product

Product

Product

Ordered

Date

Num

Name

Address

ID

Description

Finish

Standard Price

Quantity

1006

10/24/2018

2

HugeCorp

Chicago, IL

7

Widgets

Platinum

800

2

8

Widgets

Chrome

790

4

5

Wadgets

Cherry

325

2

4

Scaffolding

Silver

650

1

1007

10/25/2018

6

LittleCorp

Edwardsville, IL

7

Widgets

Platinum

800

1

11

Ladder

Silver

275

3

1008

10/26/2018

2

Huge Corp

Chicago, IL

5

Wadgets

Cherry

325

2

4

Scaffolding

Silver

650

1

STEP 1:

Convert the above to 1NF

  1. Provide a relation of the above INVOICE, underlining the primary keys.

STEP 2:

Consider the following functional dependencies of the invoice data:

OrderID à OrderDate, CustomerNum, CustomerName, CustomerAddress

ProductID à ProductDescription, ProductFinish, ProductStandardPrice

STEP 3:

Convert your 1NF table to 2NF. (i.e., look only at non-key attributes that are dependent on a single PK)

A relation is in 2NF if it contains no partial functional dependencies.

  1. Provide me 2NF relations based on the dependencies above. BE CAREFUL:   I am NOT asking you to do 3NF yet!!

STEP 4:

Now, you’ve realized there are some additional functional dependencies:

CustomerNum à CustomerName, CustomerAddress

Convert your 2NF relations to 3NF based on the dependencies you just received.

In: Computer Science

Explain attacking mechanisms (e.g., step by step procedures or phase by phase: Preparation, Initial Intrusion, Expansion,...

Explain attacking mechanisms (e.g., step by step procedures or phase by phase: Preparation, Initial Intrusion, Expansion, Persistence, Search and Exfiltration, Cleanup) of GhostNet in detail for a given real case (identified by yourself)

(Hints: You should focus on the procedures of the attacking mechanism. Explain the following steps in detail: Preparation, Initial Intrusion, Expansion, Persistence, Search and Exfiltration, Cleanup)

In: Computer Science