Questions
Writing a caesar cipher in ARM assembly. INSTRUCTIONS: Step 1: The first thing you should do...

Writing a caesar cipher in ARM assembly.

INSTRUCTIONS:

Step 1:
    The first thing you should do is modify the case conversion program String.s (provided)
    Instead of subtracting 32 from all numbers you want to add a constant number which we will call the key.
    Assume that all input will be lowercase. 
    So it'll look like this,
        k = 2;
        letter = 'a';
        newletter = k+letter;
    Above is pseudocode and ABOVE NOT ASSEMBLY CODE DO NOT COPY.
    Use bl puts to show that everything is working correctly.
    You should hard code the plaintext in the assembly file.
Step 2:
    If the key + letter is bigger is 'z' then you have to subtract 26.
    If the key + letter is less than 'a' then you have to add 26.

STRING.S

.text
.global main

main:
    ldr r4,=string

get_another_byte:
    ldrb r5,[r4]

    cmp r5,#'a'
#    blt keep_going
#    cmp r5,#'z'
#    bgt keep_going

    subeq r5,#32
    strbge r5,[r4]

keep_going:
    add r4,#1
    cmp r5,#0
    bne get_another_byte

    ldr r0,=temp
    str lr,[r0]

    ldr r0,=string
    bl puts

    ldr r0,=temp
    ldr lr,[r0]

    bx lr

.data

string:
.asciz "This is a string |"


temp:
    .word 0

In: Computer Science

C# Programming using Windows Form 1. Define a variable named isTrue that stores a value of...

C# Programming using Windows Form


1. Define a variable named isTrue that stores a value of
whether something is true or false. Set this variable
   to the negative. Output this variable to the txtIsTrue textbox.

2. Define a variable named favoriteGame that could store
the name of a game. Set this variable's value to your favorite game. Output this variable to the txtFavoriteGame textbox.

3.. Define a variable named pi that can store real numbers. initialize it to a value of 3.14. Output the value to txtPi

4. Create a control structure that will print out "That's Right"
to a textbox named txtRightOrWrong if isTrue from the 1st problem is positive result and "Nope" if isTrue is not true.

5. Write a loop of your choosing to print out the following
numbers to txtLoop textbox: -1 -3 -5 -7 -9 -13 -15 -17
  

6. Write a nested loop to print out the following to txtNestedLoop:
0
0 1
0 2 4
0 3 6 9
0 4 8 16 32
  

7. Call the method from number 8 and output the result to xtMethodCall textbox.

8. Create a method called Foo that takes an integer from
txtForFoo and returns Bar the amount of times entered.
ex: txtForFoo is 2 the result is "Bar Bar".

9. Add a try catch block in the Foo method to catch the  generic exception and one other exception of your choosing
bonus 5 pts if it applies to the method.

10. Create an array of 2 DateTime objects. Set the first
to the current date and time. Set the second to the
current date. Output both dates with a space between
them to txtDates.

/* ***BONUS***
Time how long it takes from the loading of the program
until the run button finishes running the first time it
is clicked.

In: Computer Science

I have a question that I would like an explanation on how an ethical hacker uses...

I have a question that I would like an explanation on how an ethical hacker uses the information derived by use of Nslookup and Whois to mitigate network connectivity issues. If you could explain in a paragraph it would help me tremendously.


In: Computer Science

Consider the following sorted int array: 1 3 4 5 7 9 10 12 If we...

Consider the following sorted int array:

1 3 4 5 7 9 10 12

If we search for the key value 10 in the array using the binary search algorithm, what is the sequence of indices that will be accessed in the array?

(Hint: For a sublist between index values low and high, the middle index is calculated using: (low + high) / 2. So you need to show the sequence of indices of the middle index in each pass.)

Question 40 options:

In: Computer Science

Q2. Write an 8051 C program that uses 3 temperature sensors (TS1, TS2, TS3),   3 LEDs...

Q2. Write an 8051 C program that uses 3 temperature sensors (TS1, TS2, TS3),   3 LEDs (GreenLED, BlueLED and RedLED) and 1 buzzer (BUZZ). Monitor the temperature sensors such that whenever any of the sensor goes high, the buzzer will produce a sound and at the same time, its corresponding LED blinks 3 times. You may use any of the I/O Port Pins.    
SOLUTION:
C PROGRAM

In: Computer Science

Active Directory Domain Services Installation Wizard

Active Directory Domain Services Installation Wizard

In: Computer Science

write a c# console application app that reads all the services in the task manager and...

write a c# console application app that reads all the services in the task manager and automatically saves what was read in a Notepad txt file.  Please make sure that this program runs, also add some comments

In: Computer Science

Personal Use of Technology:- Create a list of at least 4 examples of technologies used by...

Personal Use of Technology:-

Create a list of at least 4 examples of technologies used by you within the last 2 months.  

For each:

Classify them by IT Component types


Research and identify approximately what year each technology was introduced, and when your specific version was introduced.


Indicate how you have used the technology.  


Indicate what your next-best alternate would have been if you did not have the technology. Estimate the associated impact to you if you did not have the technology (additional time, cost to you per day/week etc.)


Indicate 1 example of something you currently do manually (and that there currently is not a technology solution available yet). Investigate if anyone in the world is already innovating and working on it, and if so, provide a reference (name and link) and some details.

Response should be in table form, 1-3 pages max.

In: Computer Science

Assume that 40% of a program is parallelizable. In 15% of the parallel portion, 200x speed...

Assume that 40% of a program is parallelizable. In 15% of the parallel portion, 200x speed up has achieved. And in the 25% of the parallel portion 300x speed up has achieved

What is the overall speed up for that program?
What is the overall speed up if we could achieve infinite speed up for 40% of the program?

In: Computer Science

Create a new file name condition_quiz.py. Add a comment with your name and the date. Prompt...

  1. Create a new file name condition_quiz.py.

  2. Add a comment with your name and the date.

  3. Prompt the user to enter the cost. Convert the input to a float.

  4. Prompt the user for a status. Convert the status to an integer

  5. Compute the special_fee based on the status.

If the status is 0, the special_fee will be 0.03 of the cost.

Else if the status is 1, the special_fee will be 0.04 of the cost.

Else if the status is 2, the special_fee will be 0.06 of the cost.

Else if the status is 3 or 4, the special_fee, the special_fee will be 0.07 of the cost.

Otherwise, the special_fee will be 0.10 of the cost.

  1. Compute the total_cost as the cost plus the special_fee. Print out the total_cost with two decimal places of precision.

In: Computer Science

Please use java language in an easy way and comment as much as you can! Thanks...

Please use java language in an easy way and comment as much as you can! Thanks

  1. (Write a code question) Write a generic method called "findMin" that takes an array of Comparable objects as a parameter. (Use proper syntax, so that no type checking warnings are generated by the compiler.) The method should search the array and return the index of the smallest value.

  2. (Analysis of Algorithms question) Determine the growth function and time complexity (in Big-Oh notation) of the findMin method from the previous problem. Please show your work by annotating the code.

In: Computer Science

ENCODE THE FOLLOWING STREAM OF BITS USING 4B/5B encoding :- 1101011011101111 what is the ratio of...

ENCODE THE FOLLOWING STREAM OF BITS USING 4B/5B encoding :-

1101011011101111

what is the ratio of redundant bits in 4B/5B?

In: Computer Science

1. Write a python program to create a list of integers using random function. Use map...

1. Write a python program to create a list of integers using random function. Use map function to process the list on the expression: 3x2+4x+5 and store the mapped elements in another list. Now use filter to do sum of all the elements in another list.

2. Write a function that takes n as input and creates a list of n lists such that ith list contains first 10 multiples of i.

3. Write a function that takes a number as input parameter and returns the corresponding text in word. For example, on input 458, the function should return ‘Four Five Eight’. Use dictionary for mapping digits to their string representation.

4. Write a program to create two sets of integer type using random function. Perform following operations on these two sets:

a) Union

b) Intersection

c) Difference

d) Symmetric difference

In: Computer Science

can someome investigate my program that utilizes semaphores that can result in deadlock due to programming...

can someome investigate my program that utilizes semaphores that can result in deadlock due to programming errors and help in finding out if the solution meet all criteria for the critical section
  • If yes, then comment code identifying the parts of code that do
  • If no, could you help in fixing the code wherever given solution fails criteria in the code below

#include <pthread.h>
#include <semaphore.h>
#include <stdio.h>
#include <unistd.h>

#define N 5
#define THINKING 2
#define HUNGRY 1
#define EATING 0
#define LEFT (phnum + 4) % N
#define RIGHT (phnum + 1) % N

int state[N];
int phil[N] = { 0, 1, 2, 3, 4 };

sem_t mutex;
sem_t S[N];

void test(int phnum)
{
if (state[phnum] == HUNGRY
&& state[LEFT] != EATING
&& state[RIGHT] != EATING) {
// state that eating
state[phnum] = EATING;

sleep(2);

printf("Philosopher %d takes fork %d and %d\n",
phnum + 1, LEFT + 1, phnum + 1);

printf("Philosopher %d is Eating\n", phnum + 1);

// sem_post(&S[phnum]) has no effect
// during takefork
// used to wake up hungry philosophers
// during putfork
sem_post(&S[phnum]);
}
}

// take up chopsticks
void take_fork(int phnum)
{

sem_wait(&mutex);

// state that hungry
state[phnum] = HUNGRY;

printf("Philosopher %d is Hungry\n", phnum + 1);

// eat if neighbours are not eating
test(phnum);

sem_post(&mutex);

// if unable to eat wait to be signalled
sem_wait(&S[phnum]);

sleep(1);
}

// put down chopsticks
void put_fork(int phnum)
{

sem_wait(&mutex);

// state that thinking
state[phnum] = THINKING;

printf("Philosopher %d putting fork %d and %d down\n",
phnum + 1, LEFT + 1, phnum + 1);
printf("Philosopher %d is thinking\n", phnum + 1);

test(LEFT);
test(RIGHT);

sem_post(&mutex);
}

void* philospher(void* num)
{

while (1) {

int* i = num;

sleep(1);

take_fork(*i);

sleep(0);

put_fork(*i);
}
}

int main()
{

int i;
pthread_t thread_id[N];

// initialize the semaphores
sem_init(&mutex, 0, 1);

for (i = 0; i < N; i++)

sem_init(&S[i], 0, 0);

for (i = 0; i < N; i++) {

// create philosopher processes
pthread_create(&thread_id[i], NULL,
philospher, &phil[i]);

printf("Philosopher %d is thinking\n", i + 1);
}

for (i = 0; i < N; i++)

pthread_join(thread_id[i], NULL);
}

In: Computer Science

There are at least five (probably more) places in the attached C# program code that could...

There are at least five (probably more) places in the attached C# program code that could be optimized. Find at least five things in the Program.cs file that can be changed to make the program as efficient as possible.

  1. List five problems you found with the code (Put your list either in comments within the code or in a separate Word or text document), and then optimize the code in the attached code below to make it as efficient as possible. The program output must not be affected by your changes. To the user it should still do everything it did before your changes provided the user enters valid data.

using System;

namespace COMS_340_L4A
{
class Program
{
static void Main(string[] args)
{
Console.Write("How many doughnuts do you need for the first convention? ");
int.TryParse(Console.ReadLine(), out int total1);

Console.Write("How many doughnuts do you need for the second convention? ");
int.TryParse(Console.ReadLine(), out int total2);

int totalDonuts = Calculator.CalculateSum(new int[] { total1, total2 });

Console.WriteLine($"{ totalDonuts } doughnuts is { Calculator.ConvertToDozen(totalDonuts)} dozen.");
Console.WriteLine("Press Enter to quit...");
Console.ReadLine();
}
}

static class Calculator
{
static int DOZEN = 12;

public static int CalculateSum(int[] args)
{
int return_value = 0;
foreach (int i in args)
{
return_value += i;
}
return return_value;
}

public static int ConvertToDozen(int total)
{
int dozen = DOZEN;
return total / dozen;
}
}
}

In: Computer Science