Questions
Write a C program to create a series of processes, as shown below in the diagram....

Write a C program to create a series of processes, as shown below in the diagram.

P |------ ---- > c1 |------------>c2

                             |------- ------>c3 ---------->c4

                           

In other words, the parent process p creates process c1, c1 creates c2 and c3, and c3 creates c4.

A sample run of the program shows

Your program should output something similar to what is shown above. You could optionally use wait/waitpid/sleep/exit in your program.

Comment your code to show where you created p, c1, c2, c3, c4, etc.

In: Computer Science

1.For Python Which statement(s) are true regarding private class variables? private variables can be accessible inside...

1.For Python Which statement(s) are true regarding private class variables?

private variables can be accessible inside the class.

private variables can be accessible outside the class.

private variable values can be changed directly outside of the class

private variables can be changed outside the class through set methods.

2.

In the following code,

def A:
def __init__(self):
     __a = 1
     self.__b = 1
     self.c = 1
     __d__ = 1

# Other methods omitted

Which of the following is a private data field?

Group of answer choices

__a

__b

c

__d__

3.

Analyze the following code and choose the more accurate statement.

class A:
     def __init__(self, s):
         self.s = s

     def print(self):
         print(s)

a = A("Welcome")
a.print()

Group of answer choices

The program has an error because class A does not have a constructor.

The program has an error because class A should have a print method with signature print(self, s).

The program has an error because class A should have a print method with signature print(s).

The program would run if you change print(s) to print(self.s).

4.

Which of the following statement is most accurate?

Group of answer choices

A reference variable is an object.

An object is a reference type variable

An object may contain other objects.

An object may contain the references of other objects.

5.

Which special method returns a string representation of the object?

Group of answer choices

__init__ method

print method

__str__ method

constructor

6.

Class design should include ________

Group of answer choices

fields

constructor

accessor and mutator methods

other useful methods

All of the above

7.

What is max("Programming is fun")?

Group of answer choices

P

r

blank space character

u

8.

What is "Programming is fun"[1:3]?

Group of answer choices

Pr

Pro

ro

rog

In: Computer Science

Replace <missing value> and <missing code> with your answers. Your code should compute the factorial of...

Replace <missing value> and <missing code> with your answers. Your code should compute the factorial of n. For example, if n = 5, your code should compute the following 5 * 4 * 3 * 2 * 1 (which is 120).

public static void main(String[] args)
{

Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();

int factorial = <missing value>;

<missing code>

System.out.println("factorial = " + factorial);

In: Computer Science

What is the minimum and maximum number of zeros in a 4-bit string? Use roster notation...

What is the minimum and maximum number of zeros in a 4-bit string? Use roster notation and find the range of f. (The first elements in the range is f(0,0,0,0) = 0)

In: Computer Science

The measured values of the eight performance metrics listed in Example 10.2 for a system are...

The measured values of the eight performance metrics listed in Example 10.2 for a system are 70, 10, 60, 20, 80, 30, 50, and 20%. Draw the Kiviat graph and compute its figure of merit. I just need the figure of merit. I have done the rest.

In: Computer Science

HOW TO: 1. Write the SQL statement to show workers with names that have the letter...

HOW TO:

1. Write the SQL statement to show workers with names that have the letter ? before the last character.
2. Write the SQL statement to show all staff where the 2nd letter of their last names is ′?′
3. Write the SQL statement to show all staff where the 1stletter of their first names is ′?′ and 3rd letter ′ℎ'

DROP TABLE IF EXISTS staff;
CREATE TABLE staff (
staffNo VARCHAR(4) UNIQUE,
fName VARCHAR(16),
lName VARCHAR(16),
position VARCHAR(16),
sex VARCHAR(1),
dob DATETIME,
salary DOUBLE DEFAULT 0,
branchNo VARCHAR(4),
CONSTRAINT pk_staff PRIMARY KEY (staffNo)
);
INSERT INTO staff (staffNo,fName,lName,position,sex,DOB,salary,branchNo)
VALUES
('SL21','John','White','Manager','M','1945-10-01',30000,'B005'),
('SG37','Ann','Beech','Assistant','F','1960-11-10',12000,'B003'),
('SG14','David','Ford','Supervisor','M','1958-03-24',18000,'B003'),
('SA9','Mary','Howe','Assistant','F','1970-02-19',9000,'B007'),
('SGS','Susan','Brand','Manager','F','1940-06-03',24000,'B003'),
('SL41','Julie','Lee','Assistant','F','1965-06-13',9000,'B005'),
('SB0', NULL, 'LN0', 'Manager', 'M', '2000-01-01 00:00:00', 9999,
'B000'),
('SB1', 'FN1', NULL, 'Manager', 'M', NULL, 9999, 'B000'),
('SB2', 'FN2', 'LN2', NULL, NULL, NULL, 9999, 'B000'),
('SB3', 'FN3', 'LN3', NULL, NULL, NULL, 9999, NULL),
('SB4', 'FN4', NULL, 'Manager', NULL, NULL, 9999, NULL),
('SB5', 'FN5', NULL, 'Supervisor', NULL, NULL, NULL, 'B001'),
('SB6', 'FN6', NULL, 'Assistant', NULL, NULL, 9999, 'B002'),
('SB7', 'FN7', NULL, 'Manager', NULL, NULL, NULL, 'B003'),
('SB8', 'FN8', NULL, 'Manager', NULL, NULL, 9999, 'B005'),
('SB9', 'FN9', NULL, 'Assistant', NULL, NULL, NULL, NULL);

In: Computer Science

1. Which of the following statements are true of snort? (select all that apply) Snort rules...

1. Which of the following statements are true of snort? (select all that apply)

Snort rules are free through community distribution

Snort rules can be written by users/administrators.

Snort rules allow the software to understand all unwanted traffic

Snort rules are free through subscription

In: Computer Science

For this assignment, you will develop working examples of a graphical user interface (GUI) and event...

For this assignment, you will develop working examples of a graphical user interface (GUI) and event handling and that demonstrate the following:


Working code with screenshots of a Python GUI application that includes 5 design widgets of your choosing


Working code with screenshots of event handling in Python based on 3 events of your choosing


Be sure to include a brief narrative of your code where you explain what the code is doing.

Documentation Guidelines:

Use good programming style (e.g., indentation for readability) and document each of your program parts with the following items (the items shown between the '<' and '>' angle brackets are only placeholders.  You should replace the placeholders and the comments between them with your specific information).  Your cover sheet should have some of the same information, but what follows should be at the top of each program's sheet of source code.  Some lines of code should have an explanation of what is to be accomplished, this will allow someone supporting your code years later to comprehend your purpose.  Be brief and to the point.  Start your design by writing comment lines of pseudocode.  Once that is complete, begin adding executable lines.  Finally run and test your program.

written in python code.

In: Computer Science

Assume that Employee class has method boolean isHighEarner() that returns true if employee's salary is above...

Assume that Employee class has method boolean isHighEarner() that returns true if employee's salary is above average and false otherwise. Write an iterative method highEarners that returns the ArrayList<Employee> of all high earners in the given list.

public ArrayList<Employee> highEarners( ArrayList<Employee> list)

{

}

  

In: Computer Science

Define the URL and why analyst should care about its importance. Explain the URL Parameters. Explain...

Define the URL and why analyst should care about its importance.

Explain the URL Parameters.

Explain cookies and why these matter.

In: Computer Science

Let A and B be two stations attempting to transmit on an Ethernet. Each has a...

Let A and B be two stations attempting to transmit on an Ethernet. Each has a steady queue of frames ready to send; A’s frames will be numbered ?1, ?2 and so on, and B’s similarly. Let ? = 51.2 ???? be the exponential backoff base unit. Suppose A and B simultaneously attempt to send frame 1, collide, and happen to choose backoff times of 0 × ? and 1 × ?, respectively. As a result, Station A transmits ?1 while Station B waits. At the end of this transmission, B will attempt to retransmit ?1 while A will attempt to transmit ?2. These first attempts will collide, but now A backs off for either 0 × ? or 1 × ? (with equal probability), while B backs off for time equal to one of 0 × ?, 1 × ?, 2 × ? and 3× ? (with equal probability).

What is the probability that A wins all the ? backoff races. (? is a given constant)

In: Computer Science

Correct the code to prints the following: 0 1 2 3 4 5 6 7 8...

Correct the code to prints the following:

0 1 2 3 4 5 6 7 8 9

int[] numbers = new int[10];

for(int i=0; i < numbers.length; ++i)

        numbers[i] = i * 3;

for(int i=0; i < numbers.length; ++i)

        System.out.print(numbers[i] / 2 + 1 + " ");

System.out.println();

In: Computer Science

The following shows the French translation for some colours: English French red rouge orange orange yellow...

The following shows the French translation for some colours: English French red rouge orange orange yellow jaune green vert blue bleu Create a program ColourTranslator that displays the French translation of the English colour obtained from the user. E.g.: System: Enter a colour in English: User: red System: The French word for red is rouge. Include a default case that handles input that is not on the list. e.g. System: Enter a colour in English User: purple System: Sorry, purple is not in the list.

In: Computer Science

Program 3: Give a baby $5,000! Did you know that, over the last century, the stock...

Program 3: 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

Sample run 2 (yeah, that’s $9.4MM):

Enter the principle: 5000

Enter the annual addition: 1000

Enter the number of years to grow: 67

Enter the interest rate as a percentage: 10

Year 0: $5000

Year 1: $6600

Year 2: $8360

Year 3: $10296

Year 4: $12425.6

Year 5: $14768.2

.

.

Year 59: $4.41782e+06

Year 60: $4.86071e+06

Year 61: $5.34788e+06

Year 62: $5.88376e+06

Year 63: $6.47324e+06

Year 64: $7.12167e+06

Year 65: $7.83493e+06

Year 66: $8.61952e+06

Year 67: $9.48258e+06

In: Computer Science

Computer Science, Website Design, Enhanced Business Technology Write three paragraphs (4-7 sentences each) with three website...

Computer Science, Website Design, Enhanced Business Technology

Write three paragraphs (4-7 sentences each) with three website references (i.e. quotes from websites) on Ajax technology and/or its business implications.

In: Computer Science