Questions
Make the following matlab function. D=inverses(A) It takes the input of an nxn matrixA. First, the...

Make the following matlab function.

D=inverses(A)

It takes the input of an nxn matrixA.

First, the function has to determine whether A is invertible (you may want to use the function rank to do that). If A is not invertible, the function has to return an empty matrix D=[ ]; and terminates with a message “Matrix A is not invertible”.

If A is invertible, then the function reduces the matrix [A eye(n)] into the reduced echelon form and returns the matrix D that is the inverse of the matrix A. You can use a MATLAB built-in function rref for this part.

In: Computer Science

Using Python Look at the following list of Spanish words and their meanings. Spanish English uno...

Using Python

Look at the following list of Spanish words and their meanings.

Spanish English

uno one

dos two

tres three

Write a GUI program that translates the Spanish words to English. The window should have three buttons, one for each Spanish word. When the user clicks a button, the program displays the English translation in a label.

In: Computer Science

Develop a construction to show that a system implementing the Chinese Wall model can support the...

Develop a construction to show that a system implementing the Chinese Wall model can support the Bell-LaPadula Model.

In: Computer Science

Show that the Clinical Information System model’s principles implement the Clark-Wilson enforcement and certification rules. Please...

Show that the Clinical Information System model’s principles implement the Clark-Wilson enforcement and certification rules.

Please keep your answer concise.

In: Computer Science

Write a program called popchg.py that enables DBVac to update the state populations for states in...

Write a program called popchg.py that enables DBVac to update the state populations for states in the databsae. Your program should: • Include a comment in the first line with your name. • Include comments describing each major section of code. • Connect to your personal version of the DBVac database. • Ask the user to input a two-letter state abbreviation. o 1 point Extra Credit: Validate that what the user entered was two characters long. If not, then have the user re-enter the abbreviation until it’s two characters long. • Ask the user to input the population of the new state. o 1 point Extra Credit: Validate that the value entered was an integer above 0. If not, keep asking the user to enter a value until they enter an integer above 0. • Update the database to change the population for the state entered to the new population value entered.

In: Computer Science

Computer Security Bell-LaPadula Model Given the access rights as follows: Nada can read and write to...

Computer Security

Bell-LaPadula Model

Given the access rights as follows:

Nada can read and write to file A, can append to file B, and can write to file C. Maha can read file A, can write to file B, and cannot access file C. Write the access control matrix M that specifies the described set of access rights for subjects Nada and Maha to objects file A, file B and file C.

Then the subject’s security levels are LNada= Confidential and LMaha = Secret, and the object’s security levels are Lfile A= Unclassified, Lfile B = Secret, Lfile C= Top Secret (Top Secret > Secret > Confidential > Unclassified).

  1. a) Draw a Bell-LaPadula model which visualizes the access rights defined in access control matrix M.

  2. b) Using the Bell-LaPadula model, which of the following actions are allowed?Explainand justify your answer.

    1. Nada reads file A

    2. Nada reads file B

    3. Maha appends to file A

    4. Maha appends to file C

In: Computer Science

Consider using mandatory access controls and compartments to implement an ORCON control. Assume that there are...

Consider using mandatory access controls and compartments to implement an ORCON control. Assume that there are k different organizations. Organization i will produce n(i, j) documents to be shared with organization j.

a. How many compartments are needed to allow any organization to share a document with any other organization?

b. Now assume that organization i will need to share nm(i, i1, ..., im) documents with organizations i1, ..., im. How many compartments will be needed?

In: Computer Science

1. Create a program that generates n values in range [low, high]. • Create a function...

1. Create a program that generates n values in range [low, high].

• Create a function generate_vals which takes as input an array of double values and three integers representing the size of the array, low value of range, and high value of range, respectively. The function should use rand() to generate the requested number of values.

• Prompt the user to enter the size of their array as shown below. It cannot exceed a maximum size of 128. If it does, set the size equal to 128 and continue with the program.

• Prompt the user to enter a low and high value as shown below. These values will be used to limit the range that each generated number can be.

• Print the generated values such that it matches the format below.

Example Run:

Enter size: 8

Enter low value: 9

Enter high value: 18

16.05, 16.19, 17.20, 10.78, 12.02, 15.91, 11.50, 13.99

In: Computer Science

1 -​Create the code to generate a default web page. The contents of this page should...

1 -​Create the code to generate a default web page. The contents of this page should be Your​​Name, right justified

In: Computer Science

Simulate a fast-food ordering scenario by defining four Python classes: a) Lunch: Main class b) Customer:...

Simulate a fast-food ordering scenario by defining four Python classes: a) Lunch: Main class

b) Customer: the person that buys food

c) Employee: the person that accepts a customer order

d) Food: what the customer buys

Create all the classes in one module and a separate test module where instances of the class are created, and the methods are tested with appropriate instances. To start, here are the classes and methods you should define and complete:

class Lunch: def __init__(self) # include Customer and Employee def order(self, foodName)# start a Customer order simulation def result(self) # Ask the Customer food preference class Customer: def __init__(self) # initialize my food to None def placeOrder(self, foodName, emp) # place order from Employee def printFood(self) # print the name of my food class Employee: def takeOrder(self, foodName) # return name of Food requested class Food: def __init__(self, name) # store food name The simulation works as follows: a. The Lunch class’s constructor should make and embed an instance of Customer and Employee, and export a method called order. When called, this order method should ask the Customer to place an order, by calling its placeOrder method. The Customer’s placeOrder method should in turn ask the Employee object for a new Food object, by calling the Employee’s takeOrder method. b. Food objects should store a food name string (e.g., "biryani"), passed down from objects of Lunch.order to Customer.placeOrder, to Employee.takeOrder, and finally to Food’s constructor. The top-level Lunch class should also export a method called result, which SWE 321 – OOP Lab. College of Technological Innovations (CTI) 21 asks the customer to print the name of the food it received from the Employee via the order (this can be used to test your simulation). c. Note that Lunch needs to either pass the Employee to the Customer, or pass itself to the Customer, in order to allow the Customer to call Employee methods d. Experiment with your classes interactively by importing the Lunch class, calling its order method to run an interaction, and then calling its result method to verify that the Customer got what he or she ordered.

Based on the following solve the question below

In this simulation, the Customer is the active agent; how would your classes change if Employee were the object that initiated customer/ employee interaction instead?

In: Computer Science

2 -​Create the code to generate a web page that contains a table. The table should...

2 -​Create the code to generate a web page that contains a table. The table should have 4 ​columns and 4 rows. Each cell should be 100 pixels wide by 100 pixels high. The border ​should be 2 ​pixels.

In: Computer Science

Write a complete C program that searches an element in array using pointers. Please use the...

Write a complete C program that searches an element in array using pointers. Please use the function called search to find the given number.

//Function Prototype void search (int * array, int num, int size)

In: Computer Science

(CODE IN PYTHON) Program Input: Your program will display a welcome message to the user and...

(CODE IN PYTHON)

Program Input:

Your program will display a welcome message to the user and a menu of options for the user to choose from.

Welcome to the Email Analyzer program. Please choose from the following options:

  1. Upload text data

  2. Find by Receiver

  3. Download statistics

  4. Exit the program

Program Options

Option 1: Upload Text Data

If the user chooses this option, the program will

  1. Prompt the user for the file that contains the data.

  2. Read in the records in an appropriate structure/class

Input File Format:

To_Email From_Email Time

Sample Input File:

[email protected] [email protected] 19:24

[email protected] [email protected] 12:17

[email protected] [email protected] 03:58

[email protected] [email protected] 05:45

Write a function called UploadTextData to do this task. Choose the appropriate parameters and return type.

Once done reading in the file, the main menu will be displayed again.

Option 2: Find by Receiver

If the user chooses this option, the program will ask the user for the receiver’s email. The program will list the time and sender of all emails this email received

Sample Output:

[email protected] received the following emails:

Write a function called PrintEmails to do this task. Choose the appropriate parameters and return type.

Once done printing, the main menu will be displayed again.

Option 3: Download Statistics

If the user chooses this option, the program will create a statistics file with the following data:

  1. A print out of all the emails received. Each line should have a To, From and Time. (Example: From [email protected] to [email protected] at 19:24)

  2. Email address that received the most emails

  3. Number of emails within the same domain/organization (same address after the @)

  4. A list of all domains that sent emails (From field) and the number of emails received from each of these domains.

The statistics file will have the same name as the input file but with _stats.txt appended to it.

For example, if the input file was named data.txt, the stats file will be named data_stats.txt.

Note: It will remove the .txt from data.txt, before adding the _stats.txt. It will NOT create a file with the name data.txt_stats.txt. You can use the string substr method to remove the last 4 characters from the file name.

Write a function called CreateStatsFile to do this task. Choose the appropriate parameters and return type.

Once done creating the statistics file, the main menu will be displayed again.

Option 4: Exit the Program

If the user chooses this option, the program will exit.

Note: If any other option (other than exit) is chosen, the task will be performed and then the menu will be displayed again.

(CODE IN PYTHON)

In: Computer Science

dd a new function that is similar to the counting function that you already have -...

  1. dd a new function that is similar to the counting function that you already have - but which uses a for loop to do the exact same thing (count from n//2 to n). Your solution must use a for loop with a range function.
  2. Instrument your code by adding print functions so that we can tell which function is doing the counting, as shown in the sample output below.
  3. Modify your program so that it alternates between using your for loop function and your while loop function each time a number is entered, as shown in the sample output.
  4. Make sure your output exactly matches what is shown below.

Sample session:

C:> python whileloop3.py

Enter a number: 2

Counting with 'while' ... 1 2

total = 2

Enter a number: 2

Counting with 'for' ... 1 2

total = 4

Enter a number: 3

Counting with 'while' ... 1 2 3

total = 7

Enter a number: 3

Counting with 'for' ... 1 2 3

total = 10

Enter a number: 1

Counting with 'while' ... 0 1

total = 11

Enter a number: 1

Counting with 'for' ... 0 1

total = 12

Enter a number: 3

total = 15, exiting

the code:

def look():
    p = int(input("Put a number: "))
    i = p//2-1

    while i < p:
        i = i+1
        print(i ,end=" ")



if __name__ == "__main__":
    look()

In: Computer Science

in C++ programing language Write a program that prompts the user for an integer, then prints...

in C++ programing language

Write a program that prompts the user for an integer, then prints all of the numbers from one to that integer, separated by spaces. Use a loop to print the numbers. But for multiples of three, print "Fizz" instead of the number, and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz". Drop to a new line after printing each 20 numbers. If the user typed 100, the output would be

In: Computer Science