Questions
Assume a project to install 200 Desktop with an approved budget of SR800 each and 200...

Assume a project to install 200 Desktop with an approved budget of SR800 each and 200 Laptop with an approved budget of SR 1200 each, in the period of 12 months. The total project budget is SR 400000. After six months, it is found that 80 Desktop & 80 Laptops have been installed, at a cost of SR176000. According to the plan, 100 Desktop & 100 Laptops should have installed in a period of six months. According to this progress how much extra cost and time need to complete the project.

1. BCWS :

2. BCWP :

3. ACWP :

4. Time :

5. Cost :

In: Computer Science

write a method in java for a binary search tree that receives a node as input...

write a method in java for a binary search tree that receives a node as input and returns the successor node.

In: Computer Science

In JAVA A. A Java applet is a stand-alone program that does not require a web...

In JAVA

A. A Java applet is a stand-alone program that does not require a web browser. True or False

B.Which of the following are valid identifiers in java? (will the identifier compile?)

  1.   Object#Count
  2.   $money
  3.   Late_Fee
  4.   __$__

C.What is the decimal (base 10) equivalent of 162 in octal?

D.Which of these identifiers obey the naming convention for object names?

  1. Isthisokay
  2. goodName
  3. C3PO
  4. ThisIsReallyOkay
  5. areallygreatname
  6. anotherBadOne

In: Computer Science

note (Please solve the questions in the language of operating systems) [1] Briefly, what is the...

note (Please solve the questions in the language of operating systems)

[1] Briefly, what is the difference between:

1- Buffering & Spooling.

2- Synchronous & Asynchronous I/O.

3- CPU-bound & I/O-bound jobs.

4- Multiprogramming & Timesharing.

5- Logical & Physical addresses.

6- User & Monitor modes in Operating System.

[2] (i) Define Timesharing.

    (ii) In a one processor system, there is an interrupt clock which is set to a “time slice Q”, that is, every Q an interrupt occurs to stop the process. There is only one I/O device in the system    which is interrupted when the process needs an I/O. There are 3 processes A, B, C.

    

     Process A executes an I/O interrupt every T units of time.

     Process B executes an I/O interrupt every 2T units of time.

     Process C executes an I/O interrupt every 3T units of time.

(a) Which of the above processes will benefit the most and which is not when Q = T.

      Explain your answer

(b) Which of the above processes will benefit the most and which is not when Q = 2T.

      Explain your answer

(a) Which of the above processes will benefit the most and which is not when Q = 3T.

      Explain your answer

What is the best value should Q takes for good performance ? explain your answer in full.

[3] (a) Define DMA (Direct Memory Access).

      (b) An input device can transmit 100 characters every 4 mils 10 , if the CPU needs 2 mics to service the

            Interrupt. How much time is left for asynchronous I/O. What if it can transmit 1000 characters

            every 4 mils and the CPU also needs 2 mics for the service routine.

            What do you think? Explain your answer in details.

[4] (a) What is the interrupt types? Give examples.

      

       (b) What type of interrupt the following pieces of code in C might generate. Explain your answer.

(i)

int n = 0;

while (n = 0)

  printf(“Hello”);

            (ii)

           

            int n = 1 , m = 0, x = 10;

            while (n/!x<0.001)

                 { m +=x;

                   n++;

                 }

           

           

       [5] Draw clearly explaining briefly what is happening the following:

           

  1. Interrupt Vector
  2. Instruction Cycle with instruction cash register.
  3. System Queues and Scheduling.

In: Computer Science

Describe the step-by-step protocol that PGP/GPG takes to simultaneously sign a message with the sender’s private...

Describe the step-by-step protocol that PGP/GPG takes to simultaneously sign a message with the sender’s private key and encrypt it with the receiver’s public key.

In: Computer Science

#include <stdio.h> void printDistinct(int arr[], int c) { int i, j; printf("\nArray:\n"); // Picking all elements...

#include <stdio.h>

void printDistinct(int arr[], int c)
{
int i, j;
printf("\nArray:\n");
// Picking all elements one by one
for (i = 0; i < c; i++)
{
// Checking if the picked element is already printed
for (j = 0; j <= i; j++)
{
// If current element is already there in the array, break from j loop
if (arr[i] == arr[j])
{
break;
}
}
// If it is not printed earlier and is within 10-100, then we print it
if (i == j && arr[i] > 10 && arr[i] < 100)
printf("%d ", arr[i]);
}

}

int main()
{
// to test above function
int arr[20], i;
printf("Enter 20 numbers between 10-100\n");
for (i = 0; i < 20; i++)
{
scanf("%d", &arr[i]);
}
int c = sizeof(arr) / sizeof(arr[0]);
printDistinct(arr, c);

int a[20], j, k, t, n = 20;
  
//-------------------------------------------------------------------------------------
for (i = 0; i < n; i++) //Sort array in ascending order
{
for (j = i + 1; j < n; j++)
{
if (a[j] < a[i]) //Check jth element smaller than ith element
{
t = a[i]; //if yes,assign the ith value to a temporary variable
a[i] = a[j]; //Assign the value of jth element to i.
a[j] = t; //Then assign value of temporary variable to j.
}
}
}
printf("\nSorted array is: "); //Finally print sorted array
for (i = 0; i < n; i++)
{
printf("%d ", a[i]);
}
return 0;
}

and the output for sorted is this

-858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460 -858993460

what i need to do to make sure that the numbers are sorted properly.

In: Computer Science

Apply and elaborate by providing real-life examples on the below mentioned basic concepts that are associated...

Apply and elaborate by providing real-life examples on the below mentioned basic concepts that are associated with risk management as per NIST (National Institute of Standards and Technology).   

a. TRUST AND TRUSTWORTHINESS

b. ORGANIZATIONAL CULTURE

In: Computer Science

Programming in C (not C++) The high level goal of this project is to write a...

Programming in C (not C++)

The high level goal of this project is to write a program called "wordfreak" that takes "some files" as input, counts how many times each word occurs across them all (considering all letters to be lower case), and writes those words and associated counts to an output file in alphabetical order.

We provide you some example book text files to test your program on. For example, if you ran

$ ./wordfreak aladdin.txt

Then the contents of the output file would be:

$ cat output.txt

a : 49

aback : 1

able : 1

...

required : 1

respectfully : 1

retraced : 1

...

that : 11

the : 126

their : 2

...

you : 20

young : 1

your : 7

The words from all the input files will be counted together. If a word appears 3 times in one input file and 4 times in another, it will be counted 7 times between the two.

Input

wordfreak needs to be able to read input from 3 sources: standard input, files given in argv, and a file given as the environment variable. It should read words from all these that are applicable (always standard in, sometimes the other 2).

A working implementation must be able to accept input entered directly into the terminal, with the end of such input signified by the EOF character (^D (control+d)):

$ ./wordfreak

I can write words here,

and end the file with control plus d

$ cat output.txt

and : 1

can : 1

control : 1

d : 1

end : 1

file : 1

here : 1

i : 1

plus : 1

the : 1

with : 1

words : 1

write : 1

However, it should alternately be able to accept a file piped in to standard input via bash’s operator pipe:

$ cat aladdin.txt | ./wordfreak

It should be noted that your program has no real way to tell which of these two situations is occuring, it just sees information written to standard input. However, by just treating standard input like a file, you will get both of these behaviours.

A working implementation must also accept files as command line arguments:

$ ./wordfreak aladdin.txt iliad.txt odyssey.txt

Finally, a working implementation must also accept an environment variable called WORD_FREAK set to a single file from the command line to be analyzed:

$ WORD_FREAK=aladdin.txt ./wordfreak

And of course, it should be able to do all of these at once

$ cat newton.txt | WORD_FREAK=aladdin.txt ./wordfreak iliad.txt odyssey.txt

Words

Words should be comprised of only alpha characters, and all alpha characters should be taken to be lower case.

For example "POT4TO???" would give the words "pot" and "to". And the word "isn’t" would be read as "isn" and "t". While this isn't necessarily intuitively correct, this is what your code is expected to do:

$ echo "Isn’t that a POT4TO???" | ./wordfreak

$ cat output.txt

a : 1

isn : 1

pot : 1

t : 1

that : 1

to : 1

You are required to store the words in a specific data structure. You should have a binary search tree for each letter 'a' to 'z' that stores the words starting with that letter (and their counts). This can be thought of as a hash function from strings to binary search trees, where the hashing function is just first_letter - 'a'. Note that these BSTs will not likely be balanced; that is fine.

Output

The words should be written to the file alphabetically (the BSTs make this fairly trivial). Each word will give a line of the form "[word][additional space] : [additional space][number]\n". The caveat is that all the colons need to line up. The words are left-aligned and the longest will have a single space between its end and the colon (note "respectfully" in the example below); the numbers are right-aligned and the longest will have a single space between the colon and its beginning (note 126 in the example below).

$ ./wordfreak aladdin.txt

$ cat output.txt

a : 49

...

respectfully : 1

...

the : 126

...

your : 7

The output file should be named output.txt. Note that when opening the file to write to, you will either need to create the file or remove all existing contents, so make use of open()'s O_CREAT and O_TRUNC. Moreover, you will want the file’s permissions to be set so that it can be read. open()’s third argument determines permissions of created files, something like 0644 will make it readable.

restricted to only using the following system calls: open(), close(), read(), write(), and lseek() for performing I/O. You are allowed to use other C library calls (e.g., malloc(), free()). However, all I/O is restricted to the Linux kernel’s direct API support for I/O. You are also allowed to use sprintf() to make formatting easier.

In: Computer Science

Database: Our AD is Movie Theater. Create an ER diagram with the following entities: Staff, Ticket,...

Database:

Our AD is Movie Theater.
Create an ER diagram with the following entities: Staff, Ticket, Movie, Session, Hall, Seat, Director, Actor, Distributor, and Roles. AND also identify the type of relations between the entities with notations and explain why you used it.

**Read the question carefully before you answer**

In: Computer Science

Question 1 (25pts): Consider the string “data and program analytics”. Write a program to perform the...

Question 1 (25pts):

Consider the string “data and program analytics”. Write a program to perform the following actions

  • Find the index of the character ‘p’ in the given string
  • Print the character which is present at index number seven
  • Find the length of the String
  • Split the string at every occurrence of a whitespace
  • Replace the word “data” in the original string with “information” using a standard string manipulation function. Your output after the manipulation should be “information and program analytics”

Question 2 (15 pts):

List1 = [3, 4, 5, 20, 5]

  • Find the index of the second 5
  • Find the last element of this list

Question 3 (15 pts):

Set1 = {1, 2, 3, 4}, Set2={4, 5, 6}

  • Print all elements that appear in both sets
  • Print those elements that appear in either set
  • Print all elements that appear in Set1 but not Set2

Question 4 (15 pts):

L = [('',), (), ('apple', 1), (), ("Paul", "Merage', 2020, "MSBA212"), ("d")]

Write a Python program to remove an empty tuple(s) from a list of tuples.

Expected outcome is:

[('',), ('apple', 1), ('Paul', 'Merage', 2020, 'MSBA212'), 'd']

Question 5 (15 pts):

  • Reverse words in the string "one apple a day keeps the doctors away" and print the new string
  • Sort the words in the string "one apple a day keeps the doctors away" alphabetically and then print the new string.

Question 6 (15 pts):

Two given lists [1,2,4,8,5,10] and [2,4,5,8,12,15], write a program to make a list whose elements are intersection of the above given lists.

In: Computer Science

Instructions Complete the lab using “for loop”. Do not write the code in multiple programs. All...

Instructions

  • Complete the lab using “for loop”.
  • Do not write the code in multiple programs. All the 3 methods should be written in 1 program.
  1. Write a java program calls the following methods:
    1. printStars(): Takes an int (n) as parameter and prints n stars (*) using for loop.
    2. Multiples(): Takes an int (n) as parameter and prints first 10 multiples n in a single line using for loop.
    3. hasAnEvenDigit: Takes an int (n) as parameter and returns whether n has at least one digit whose value is even. Return true if the number has at least one even digit else false if none of the digits are even. For example, the call hasAnEvenDigit(33267) should return true and hasAnEvenDigit(7591) should return false.

[Hint: n%10 returns the last digit and n/10 returns everything except the last digit]

In: Computer Science

Computer Science Question 1: DO NOT USE ANY NON-STANDARD LIBRARY. o All the required libraries have...

Computer Science Question 1:

DO NOT USE ANY NON-STANDARD LIBRARY. o All the required libraries have already been included. O DO NOT INCLUDE ANY OTHER LIBRARY INTO THE CODE. o DO NOT ALTER THE NAMES OF THE C FILES PROVIDED. o DO NOT ALTER THE NAMES AND PROTOTYPES OF THE FUNCTIONS.DO NOT ALTER ANY OF THE CODE! JUST ADD WHAT NEEDS TO BE ADDED FOR IT TO WORK! Please copy and paste the whole solution. Please read the code below and complete what it is asking.

This is the code:

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#define SIZE 20

// A regular function to check and return the maximum value between two integers
int max(int a, int b);

// A recursive function for recursively find and return the maximum value in an array of integers
int maximumValue(int a[], int size);

int main(void) {

        srand(time(NULL));

        int myArray[SIZE];

        // COMPLETE THIS PART
        // ******************
        // populate the array with positive random integers less than 100





        // COMPLETE THIS PART
        // ******************
        // Print out the elements of the array in one line





        // COMPLETE THIS PART
        // ******************
        // Find and print out the maximum value in the array by calling the recursive function maximumValue



}

int max(int a, int b) {

        // COMPLETE THIS PART
        // ******************
        // if a is greater than or equal to b, return a, otherwise return b


}

int maximumValue(int a[], int size) {

        // COMPLETE THIS PART
        // ******************
        // Base case and recursive part using an if-else statement.
        // Base case:
        //              If there is only one element in the current array, return it.
        // Recursive part:
        //              Call the max function with two parameters, the first element of the array and maximumValue of the rest of the array.

In: Computer Science

A transport logistics company (using trucks) is planning to purchase 30 laptops for its employees. (i)...

A transport logistics company (using trucks) is planning to purchase 30 laptops for its employees.

(i) Explain (in detail) what is meant by the term “total cost of ownership” in this acquisition?

(ii) For support purposes, you are asked to prepare a plan to prevent users from encountering problems (or even misusing) the new laptops. Select five different end user problem types and describe the common issues and preventative measures.

In: Computer Science

write an essay comparing and contrasting as mentioned below Radio vs newspapers. what are the similarities...

write an essay comparing and contrasting as mentioned below

Radio vs newspapers. what are the similarities and differences?

In: Computer Science

C# Write a program in C# that prompts the user for a name, Social Security number,...

C#

Write a program in C# that prompts the user for a name, Social Security number, hourly pay rate, and number of hours worked. In an attractive format, dis- play all the input data as well as the following: » Gross pay, defined as hourly pay rate times hours worked » Federal withholding tax, defined as 15% of the gross pay » State withholding tax, defined as 5% of the gross pay » Net pay, defined as gross pay minus taxes

In: Computer Science