Questions
Describe the status of the N, Z, C, and V flags of the CPSR after each...

Describe the status of the N, Z, C, and V flags of the CPSR after each of the following:
(a) ldr r1, =0xffffffff
ldr r2, =0x00000001
add r0, r1, r2
(b) ldr r1, =0xffffffff
ldr r2, =0x00000001
cmn r1, r2
(c) ldr r1, =0xffffffff
ldr r2, =0x00000001
adds r0, r1, r2
(d) ldr r1, =0xffffffff
ldr r2, =0x00000001
addeq r0, r1, r2
(e) ldr r1, =0x7fffffff
ldr r2, =0x7fffffff
adds r0, r1, r2

In: Computer Science

using python One measure of “unsortedness” in a sequence is the number of pairs of entries...

using python

One measure of “unsortedness” in a sequence is the number of pairs of entries that are out of order with respect to each other. For instance, in the letter sequence “DAABEC”, this measure is 5, since D is greater than four letters to its right and E is greater than one letter to its right. This measure is called the number of inversions in the sequence. The sequence “AACEDGG” has only one inversion (E and D)--it is nearly sorted--while the sequence “ZWQM” has 6 inversions. Formally speaking, two elements a[i] and a[j] form an inversion if a[i] > a[j] and i < j.

So in the sequence 2, 4, 1, 3, 5, there are three inversions (2, 1), (4, 1), (4, 3).

You are responsible for cataloguing a sequence of DNA strings (sequences containing only the four letters A, C, G, and T). However, you want to catalog them, not in alphabetical order, but rather in order of ``sortedness'', from ``most sorted'' (lowest inversions) to ``least sorted'’ (highest inversions). All the strings are of the same length.

Input: These are m character sequences given each of fixed length. If the input is “#”, stop the input.

Output: Output the list of input strings, arranged from ``most sorted'' to ``least sorted''. If two or more strings are equally sorted, list them in the same order they are in the input file.

Sample Input: AACATGAAGG TTTTGGCCAA TTTGGCCAAA GATCAGATTT CCCGGGGGGA ATCGATGCAT

Sample Output: CCCGGGGGGA AACATGAAGG GATCAGATTT ATCGATGCAT TTTTGGCCAA TTTGGCCAAA

In: Computer Science

Select one of the following three common computer science problems and describe how recursion can be...

Select one of the following three common computer science problems and describe how recursion can be used to solve this problem more efficiently (sorting, minimum cost spanning tree, knapsack problem). You must generally describe the algorithm that would be used to solve the problem and detail how recursion makes the algorithm more asymptotically efficient.

In: Computer Science

This is for Javascript programming language: A. Class and Constructor Creation Book Class Create a constructor...

This is for Javascript programming language:

A. Class and Constructor Creation Book Class Create a constructor function or ES6 class for a Book object.

The Book object should store the following data in attributes: title and author. Library Class Create a constructor function or ES6 class for a Library object that will be used with the Book class. The Library object should be able to internally keep an array of Book objects.

B. Methods to add Library Class

The class should have the following methods:

o A function named simulate. In this function create a while loop that runs 30 times to simulate 30 days. Each day, iterate over all the books and checkout the book if it is not checked out, check it in if it is. Book Class

o A method named is CheckedOut that returns true if the book is checked out and false if not. o A method named CheckOut that displays “Checking Out … ” Be sure to replace with the actual title of the book.

o A method named CheckIn that displays “Checking In …” Be sure to replace with the actual title of the book.

C. Test Program After you have created the classes.

Create three Book objects and store the following data in them:

Title

Author

Item #1 Code Complete Steve McConnell

Item #2 The Art of Unit Testing Roy Osherove

Item #3 Domain Driven Design Eric Evans Store all three Book objects in an array named “catalog” in the Library class.

Next, create a Library object.

Now, call the simulate function on the library object you just created.

In: Computer Science

Consider an ADT with the same operators as a stack (push(), pop(), size(), empty()), except that...

  1. Consider an ADT with the same operators as a stack (push(), pop(), size(), empty()), except that the pop() operator returns the largest element rather than the element most recently pushed. For this to make sense, the objects on the stack must be totally ordered (e.g. numbers). Describe array and linked list implementations of the ADT. Your implementations should be as time and space efficient as you can manage. Give the running times for the CRUD operators.

In: Computer Science

In class, we have studied the bisection method for finding a root of an equation. Another...

In class, we have studied the bisection method for finding a root of an equation. Another method for finding a root, Newton’s method, usually converges to a solution even faster than the bisection method, if it converges at all. Newton’s method starts with an initial guess for a root, ?0 , and then generates successive approximate roots ?1 , ?2 , …. ?i , ?i+i, …. using the iterative formula?′(?௝) Where ?’(xi) is the derivative of function ? evaluated at ? = ?i . The formula generates a new guess, ?j+1, from a previous one, ?j . Sometimes Newton’s method will fail to converge to a root. In this case, the program should terminate after many trials, perhaps 100. The figure above shows the geometric interpolation of Newton’s method where ?0 , ?1 , and ?2 represent successive guesses for the root. At each point ?j , the derivative, ?’(xj), is the slope of the tangent to the curve, ?(?). The next guess for the root, ?j+1, is the point at which the tangent crosses the x-axis. Write a program that uses Newton’s method to approximate the nth root of a number to six decimal places. If ?n = ?, then ?n-? = 0. Finding a root of the second equation will give you n√?  . Test your program on √3, 3√10 , and 3√−2. Your program could use c/2 as its initial guess.

In: Computer Science

Program: Java (using eclipse) Write a program that asks the user to enter today’s sales for...

Program: Java (using eclipse)

Write a program that asks the user to enter today’s sales for five stores. The program should then display a bar chart comparing each store’s sales. Create each bar in the bar chart by displaying a row or asterisks. Each asterisk should represent $100 of sales. You must use a loop to print the bar chart!!!!

If the user enters a negative value for the sales amount, the program will keep asking the user to enter the sales amount until a positive amount is entered,

You must use methods, loops and arrays for this assignment!!!!!

In: Computer Science

Build the subnetting tables for the following data (Classful addressing): IP: 138.134.11.66 Mask:255.255.192.0

Build the subnetting tables for the following data (Classful addressing):

IP: 138.134.11.66 Mask:255.255.192.0

In: Computer Science

Is there any way to do this function //Recursive method to check if two numbers form...

Is there any way to do this function

//Recursive method to check if two numbers form a given number
private static boolean addition(int[] array, int start, int end, int n) {
if(start < end) {
if (array[start] + array[end] == n) {
return true;
}
if (array[start] + array[end] > n) {
return addition(array, start, end-1, n);
}
if (array[start] + array[end] < n) {
return addition(array, start+1, end, n);
}
}
return false;
}

In: Computer Science

Briefly explain the concept of policing with emphasis on the “leaky bucket” mechanism.

Briefly explain the concept of policing with emphasis on the “leaky bucket” mechanism.

In: Computer Science

Please describe this( Encryption technique -abstract and introduction) below Research paper in your Word ​Abstract In...

Please describe this( Encryption technique -abstract and introduction) below Research paper in your Word

​Abstract

In network communication system, exchange of data mostly occurs on networked computers and devices, mobile phones and other internet based smart electronic gadgets. Importance of network security is increasing day by day for various network and software applications in human life. Many of the human activities are automatic and in future more areas will come as part of networking system. So most of the end-devices will come to the internet and connect, it is important to ensure the security of data being transmitted. The data and network encryption algorithms play a huge role to ensure the security of data in transmission. In this paper, we provide a theoretical overview of various encryption techniques, namely those that range from changes in the position of a letter or word to word transformations and transposition. These not only provide security when sending messages, but also security for passwords that are used to decipher and to encrypt. The conclusions in this study examine the current theoretical framework,
and propose the usage of methods to prevent online security breaches

​ Introduction
Encryption simply means the translation of data blocks into a secret code which is considered the most effective way to ensure data security. To read a secret file one must have access to a secret key that enables to decrypt it. Unsecured data where no encryption algorithms were used travels through different networks are open to many types of attacks and can be read, changed or forged by any attacker who has access to that data or network. To prevent such attacks encryption and decryption techniques are employed. Encryption algorithms are used by many software and network applications, but most of them are not free from cyber-attacks. Now a days encryption techniques uses algorithms with a “key” to encrypt data into digital secret code and then decrypting it by restoring it to its original data. It is important to protect things like biometric information, email data, medical records, corporate information, personal data, legal documents, transactions details from unauthorized access. Encryption techniques uses a fixed length parameter or key for data transformation. There are mainly two types of algorithms used to encrypt data, asymmetric encryption and symmetric encryption. Many research and analysis of different encryption algorithms such as DES, 3DES, AES, Blowfish, Twofish, Serpent, RC2, RC5, are going on which helps to identify the pros and cons of algorithms in various platforms and application areas. Today's most widely used encryption algorithms fall into two categories: symmetric and asymmetric. Symmetric-key ciphers, also referred to as "secret key," use a single key, sometimes referred to as a shared secret because the system doing the encryption must share it with any entity it intends to be able to decrypt the encrypted data. The most widely used symmetric-key cipher is the ​Advanced Encryption Standard (AES​), which was designed to protect government classified information.
Symmetric-key ​encryption is usually much faster than asymmetric encryption, but the sender must exchange the key used to encrypt the data with the recipient before the recipient can perform decryption on the cipher text. The need to securely distribute and manage large numbers of keys means most cryptographic processes use a symmetric algorithm to efficiently encrypt data, but they use an asymmetric algorithm to securely exchange the secret key. All securely transmitted live traffic today is encrypted using symmetric encryption algorithms for example such as live telephone conversation, streaming video transmission, high speed data link. Blowfish, AES, RC4,DES, RC5, and RC6 are examples of symmetric encryption. The most widely used symmetric algorithm is AES-128, AES-192, and AES-256. In asymmetric​ key encryption, different keys are used for encrypting and decrypting a message. Asymmetric cryptography, also known as public key cryptography, uses two different but mathematically linked keys, one public and one private. The public key can be shared with everyone, whereas the private key must be kept secret. The RSA encryption algorithm is the most widely used public key algorithm, partly because both the public and the private keys can encrypt a message; the opposite key from the one used to encrypt a message is used to decrypt it. This Attribute provides a method of assuring not only confidentiality, but also the integrity, authenticity and non reputability of electronic communications and data at rest through the use of digital signatures. Diffie-Hellman, RSA, ECC, ElGamal, DSA. The following are the major asymmetric encryption algorithms used for encrypting or digitally signing data.

In: Computer Science

Question 1. Present the Use Case and Activity diagram which represents the admission process of a...

Question 1.

Present the Use Case and Activity diagram which represents the admission process of a student in a particular course in the B University.                      [20 Marks]

1 .Use case diagram                         

2.Activity diagram                           

Question.2

A Person who is seeking a job in a company about to apply through online mode. Draw the Class diagram and Sequence diagram for the said scenario.                                                      [20 Marks]

  1. Class diagram                                
  2. Sequence diagram                         

QUESTION 3

You have been appointed as Manager of a software company. Your organisation uses various models for developing a project. If the company gets a Big-scale project from a Client, Which specific model will you choose and why?                                                                      [15 Marks]

  1. Choosing of the Process model                            
  2. Reasons                                                                       

In: Computer Science

Please do this in PSEUDOCODE.Give a baby $5,000! Did you know that, over the last century,...

Please do this in PSEUDOCODE.Give a baby $5,000! Did you know that, over the last century, the stock market has returned an average of 10%? You may not care, but you’d better pay attention to this one. If you were to give a newborn baby $5000, put that money in the stock market and NOT add any additional money per year, that money would grow to over $2.9 million by the time that baby is ready for retirement (67 years)! Don’t believe us? Check out the compound interest calculator from MoneyChimp and plug in the numbers! To keep things simple, we’ll calculate interest in a simple way. You take the original amount (called the principle) and add back in a percentage rate of growth (called the interest rate) at the end of the year. For example, if we had $1,000 as our principle and had a 10% rate of growth, the next year we would have $1,100. The year after that, we would have $1,210 (or $1,100 plus 10% of $1,100). However, we usually add in additional money each year which, for simplicity, is included before calculating the interest. Your task is to design (pseudocode) and implement (source) for a program that 1) reads in the principle, additional annual money, years to grow, and interest rate from the user, and 2) print out how much money they have each year. Task 3: think about when you earn the most money! Lesson learned: whether it’s your code or your money, save early and save often… Sample run 1: Enter the principle: 2000 Enter the annual addition: 300 Enter the number of years to grow: 10 Enter the interest rate as a percentage: 10 Year 0: $2000 Year 1: $2530 Year 2: $3113 Year 3: $3754.3 Year 4: $4459.73 Year 5: $5235.7 Year 6: $6089.27 Year 7: $7028.2 Year 8: $8061.02 Year 9: $9197.12 Year 10: $10446.8

In: Computer Science

Part 2: An electric company charges to their customers based on Kilowatt-Hours (Kwh) used. The rules...

Part 2: An electric company charges to their customers based on Kilowatt-Hours (Kwh) used. The rules to compute the charge are: First 100 Kwh, 35 cents per Kwh Each of the next 100 Kwh (up to 200 Kwh), 45 cents per Kwh (the first 100 Kwh used is still charged at 35 cents each) Each of the next 300 Kwh (up to 500 Kwh) 65 cents per Kwh All Kwh over 500, 80 cents per KH Create a C# Form with a textbox to enter Kwh used, a read-only textbox to display the electricity charges, and a button to compute the charges. The Kwh used could be a number with decimals. Requirements: 1. Input validation: Use the KWH textbox validating event to ensure the KWH cannot exceed 2000. Test your program with (1) Kwh=4500, (2) Kwh = 350 2. Turn in the form’s screenshot and the code.

In C# using Visual Studios 2017 Windows form app

In: Computer Science

public class Account{ public int bal; // this store the balance amount in the account public...

public class Account{

public int bal; // this store the balance amount in the account

public Account(int initialBalance)

{

bal = initialBalance;

}

public static void swap_1(int num1, int num2)

{

int temp = num1;

num1 = num2;

num2 = temp;

}

public static void swap_2(Account acc1, Account acc2)

{

int temp = acc1.bal;

acc1.bal = acc2.bal;

acc2.bal = temp;

}

public static void swap_3(Account acc1, Account acc2)

{

Account temp = acc1;

acc1 = acc2;

acc2 = temp;

}

}

Now, different students tried to use different swap_*() methods to swap the balances in their friends’ bank accounts. Predict the output of each of the following code snippets [1 pts each]

(a) Account tom = new Account(100);

Account jim = new Account(2000);

System.out.println(“1.Tom has $” + tom.bal + “Jim has $” + jim.bal);

swap_1(tom.bal, jim.bal);

System.out.println(“2.Tom has $” + tom.bal + “Jim has $” + jim.bal);



(b) Account tom = new Account(100);

Account jim = new Account(2000);

System.out.println(“1.Tom has $” + tom.bal + “Jim has $” + jim.bal);

swap_2(tom, jim);

System.out.println(“2.Tom has $” + tom.bal + “Jim has $” + jim.bal);



(c) Account tom = new Account(100);

Account jim = new Account(2000);

System.out.println(“1.Tom has $” + tom.bal + “Jim has $” + jim.bal);

swap_3(tom, jim);

System.out.println(“2.Tom has $” + tom.bal + “Jim has $” + jim.bal);




Section B: Fun with stacks [2 pts each question]

Consider a generic Stack class implemented using linked list with the following methods:

  • public boolean isEmpty(), which returns true if and only if the stack is empty;

  • public T pop() throws StackUnderflowException, which removes and returns the top element of the stack (if the stack is empty, it throws StackUnderflowException);

  • public T peek() throws StackUnderflowException, which returns the top element of the stack (but does not remove it; it throws exception if stack is empty);

  • public void push(T element), which pushes an element onto the stack

Predict the output of each of the following code snippets

(a) Stack<Integer> s = new Stack<Integer>();

try{

s.push(5);

s.push(10);

System.out.println(s.peek());

System.out.println(s.pop());

s.push(20);

System.out.println(s.pop());

}
catch(Exception e) { System.out.print(“An exception was thrown”); }





(b) Stack<Integer> s = new Stack<Integer>();

try{

s.push(5);

s.push(50);

System.out.println(s.pop());

System.out.println(s.pop());

System.out.println(s.peek());

s.push(30);

}
catch(Exception e) { System.out.println(“An exception was thrown”); }





(c) Stack<Integer> s = new Stack<Integer>();

try{

s.push(5);

System.out.println(s.pop());

System.out.println(s.isEmpty());

s.push(10);

s.push(43);

s.push(s.pop());

System.out.println(s.peek());

} catch(Exception e) {

System.out.println(“An exception was thrown”);

}





(d) Stack<Integer> s = new Stack<Integer>();

try {

s.push(5);

s.push(10);

while(!s.isEmpty())

{

System.out.println(s.peek());

}

}
catch(Exception e) { System.out.println(“An exception was thrown”); }






Section C: Implementing Stack using Linked List

In this section, you will implement a generic Stack class implemented using linked list. Assume the linked list node class is already defined as below:
public class LLNode<T> {
public LLNode<T> link;

public T info;

public LLNode(T in) { info = in; link = null; }

}

Note that both class variables are public so any outside class can access them directly. Also assume that class StackUnderflowException has been defined that inherits Java’s Exception class. Your task is to implement four methods in the generic class LinkedListStack<T>.

public class LinkedListStack<T> {

private LLNode<T> head; // head of linked list, also stack top pointer

public LinkedListStack() { head = null; } // constructor

public boolean isEmpty() { // [1 pts]

// TODO: return true if stack is empty, false otherwise

// NO MORE THAN 1 LINE OF CODE!

}

public void push(T element) { // [2 pts]

// TODO: push an element to the stack

// NO MORE THAN 3 LINES of CODE!

}

public T peek() throws StackUnderflowException { // [2 pts]

// TODO: return the top element of the stack (but do NOT
// remove it). NO MORE THAN 4 LINES of CODE!

}

public T pop() throws StackUnderflowException { // [3 pts]

// TODO: remove and return the top element of the stack

// It throws StackUnderflowException if stack is empty

// NO MORE THAN 6 LINES of CODE!

}

In: Computer Science