Questions
Describe the networks that might be used to support a small manufacturing facility that supplies widgets...

Describe the networks that might be used to support a small manufacturing facility that supplies widgets to a large international manufacturing firm. The organization uses automation in their production, employs a small management staff (accounting, materials procurement, human resources, etc.), and receives their orders for widgets via electronic communications with the larger firm.

In: Computer Science

Conveniently Yours is a small family-owned neighborhood convenience store that sells products and Lottery tickets to...

Conveniently Yours is a small family-owned neighborhood convenience store that sells products and Lottery tickets to a very limited customer base. Their computing equipment is minimal with a point of sale (POS) computer, an office computer for inventory control, accounting, product acquisition, etc. Describe Conveniently Yours computing needs and their possible need for client/server, intranet, and/or cloud computing that would support his business operations.

In: Computer Science

Write a python program that asks the user to enter a student's name and 6 numeric...

Write a python program that asks the user to enter a student's name and 6 numeric tests scores (out of 100 for each test). The name will be a global variable. Create functions to calculate a letter grade for the student and calculate the average of the test scores for the student. The program should display a letter grade for each score, and the average test score, along with the student's name. Assume 6 students in the class.

Functions in the program:

the function should accept 6 test scores as arguments and return the average of the scores per student

the function should accept a test score average as an argument and return a letter grade for the score based on the following grading scale:

90-100        A

80-89          B

70-79          C

60-69          D

Below 60     F

Data for the program:

Jill Tree 70 66 87 82 75 73

Francis Ricks 90 93 87 84 91 93

Sally Smith 99 97 92 90 88 89

John Jones 72 86 59 69 72 78

Tommy Rimes    87 83 86 90 80 88

Erin Ames           66 69 72 61 73 71

In: Computer Science

Consider the following schema: Student(id, name) Registration(id, code) Course(code, instructor) A) Explain how we can violate...

Consider the following schema:
Student(id, name)
Registration(id, code)
Course(code, instructor)

A) Explain how we can violate the foreign key constraint from the id attribute of Registration to the Student relation.  
Ans.

B)Give the following queries in the relational algebra.

1)What are the names of students registered in IT244?   
Ans.


2 )What are the names of students registered in both IT244 and CS141?
Ans.                                

3)What are the names of students who are taking a subject not taught by Philips?
Ans.                            

C )For each of the following relational algebra queries, write in English what they mean.
1. Πinstructor (σcode=IT446 or code=IT230(Course))       
Ans.


2. Πname (σcode=IT446 (Student ⋈ Registration)) ⊔ Πname (σcode=IT441(Student ⋈ Registration))                      

Ans.

In: Computer Science

Design a complete JAVA program with the following methods:- In the main method : 3 variables...

Design a complete JAVA program with the following methods:-

In the main method : 3 variables are declared :- employee id, salary and status.

A method that will allow user to input employee id and salary.

A method that will assign status to “Taxable’ if employee’s salary is more than 2500RM or “Not Taxable” if salary is less and equal to 2500RM.

A method that will display the employee’s id , salary and its status.

Write the above Using Java.

In: Computer Science

Computer Networks Hi guys. Please can you assist me in answering these questions. I will greatly...

Computer Networks

Hi guys. Please can you assist me in answering these questions. I will greatly appreciate it.

1. Packets with sequence numbers 0, 1, 2, 3, 4 and 5 have all been sent to the receiver. The receiver has received packets with sequence numbers 0,1,3 and 4. In which protocol will packets with sequence numbers 2, 3 and 4 be resent?
a. Stop and wait
b. RDT3.0
c. Go-Back-N
d. Selective repeat
e. None of the above

2. A web server runs in Host A on port 80. The web server uses persistent connections. The web server receives requests form Host B and Host C. Which of the following is true regarding the socket or sockets through which data is received at Host A?
a. The segments will be directed to a socket that is identified by 4 properties or tuples
b. The segments from Host A and Host B will be directed to different sockets
c. Segments are directed to connection sockets which differ from the original socket used for TCP handshaking
d. A, B and C
e. None of the above

3. The TCP congestion protocol always attempts to use the most bandwidth, increases the amount of data transmitted until packet loss occurs. What term is used to describe this?
a. Congestion avoidance
b. Bandwidth probing
c. Available bit rate
d. Self-clocking
e. None of the above

4. Comparing the Go-Back-N (GBN) and Selective Repeat (SR) protocols. Assume a window size of 15. How many timers are needed for GBN?

5. With reference to explicit congestion notification congestion control, which bit notifies the sender that there is congestion on the network?
a. ECN
b. ECE
c. ACK
d. SEQ
e. None of the above

6. In which reliable data transfer protocol is the sequence number sent with the ACK as part of the arguments
a. RDT2.0
b. RDT2.1
c. RDT2.2
d. A, B & C
e. None of the above

7. Which of the following do the Go-Back-N and Selective Repeat protocols both make use of?
a. Sliding scale
b. Sliding window
c. Sliding sequences
d. Sliding packet
e. None of the above

In: Computer Science

How would you correct this function in C to prevent buffer overflow using the fgets() function...

How would you correct this function in C to prevent buffer overflow using the fgets() function and strncat() function

void nameBuilder()
{
   char fname[10];
   char lname[10];
   char fullname[20];

   printf("Enter your first name: ");
   scanf("%s", fname);

   printf("Enter your last name: ");
   scanf("%s", lname);

   strcat(fullname, fname);
   strcat(fullname, " ");
   strcat(fullname, lname);

   printf("Welcome. %s\n", fullname);
   return;
}

In: Computer Science

In C++, write a function to fill an array of size 13 with values 13 11...

In C++, write a function to fill an array of size 13 with values

13 11 9 7 5 3 1 2 4 6 8 10 12

recursively, starting with the value 1 in the middle.

In: Computer Science

1. In c++, Class D is derived from class B. The class D does not contain...

1. In c++, Class D is derived from class B. The class D does not contain any data members of its own . Does the class D require constructor? If yes, why? Explain with the help of a code example.

2. State true or false, giving proper reasons[3,5]
(a) Virtual functions are used to create pointer to base class.
(b) A pointer to base class cannot be made to point to objects of derived class.
(c) Defining a derived class requires some changes in base class.
(d) Inheritance helps in making a general class into a more specific class.

3. When do we make a virtual function pure? What are the implications of making a pure virtual function?

In: Computer Science

PYTHON CODE - Write the body of a function second_instance(s, c) which consumes a string s...

PYTHON CODE

- Write the body of a function second_instance(s, c) which consumes a string s and a length 1 string c that is contained at least twice in s and returns the index of the second location of c.

second_instance: Str Str -> Nat
Requires:
len(c) == 1
c occurs at least twice in s
  
Examples:
second_instance("banana", "a") => 3
second_instance("bb", "b") => 1

- Write the body of a function make_list(n) which consumes a natural number n and returns a list of strings where in position , the number  is repeated as a string  times. You must use loops in your solution. Do not use recursion or abstract list functions.

Returns the list of strings formed by in position i,
repeating i a total of i times
  
make_list: Nat -> (listof Str)
  
Examples:
make_list(0) => ['']
make_list(3) => ['', '1', '22', '333']

- Write the body of a function niven(n) using recursion that consumes a natural number n and returns True if and only if n is a Niven number and False otherwise. A Niven number is a number which is divisible by the sum of its digits.

Returns True if and only if n is a Niven number.
  
niven: Nat -> Bool
  
Examples:
niven(0) => False
niven(1) => True
niven(132) => True
niven(143) => False

- Write the body of a function find_max(L) using loops that returns the maximum of a non-empty list of integers L. Do not use recursion, abstract list functions, or the command max.

Returns the maximum in a non-empty list of integers L
  
find_max: (listof Int) -> Int
  
Examples:
find_max([1]) => 1
find_max([-10,-1,-5]) => -1

In: Computer Science

Get values for min and max using assignment statements and the input function. Print min and...

  1. Get values for min and max using assignment statements and the input function.
    Print min and max.
    Run the script.
    fix any errors you find.
  2. Remove the print statements you wrote above.
    Print the labels "Kelvin" and "Fahrenheit".
    Print a line of dashes under the labels.
    Run the script.
    fix any errors you find.
  3. Write a for loop that will give the loop variable kelvin values between min and max.
    Inside the code block print the value of kelvin
    Run the script.
    fix any errors you find.
  4. Remove the print statement inside the for a loop.
    Write an assignment statement that calculates the value of the equivalent Fahrenheit temperature.
    Print the Fahrenheit and Kelvin temperatures.
    Run the script.
    fix any errors you find.
  5. Use escape characters to align the Fahrenheit values with their label.
    Run the script.
    fix any errors you find.

In: Computer Science

The main function creates 5 pixels with random red, green, and blue values. Complete the id_color...

The main function creates 5 pixels with random red, green, and blue values. Complete the id_color function to return “red” if the red value is greater than the green and blue, “green” if the green value is greater than the red and blue, and “blue” if the blue value is greater than the red and green. If there is no clear maximum value (for example, if the red and green values are the same) return None. Do not change the main function.

import image
import random

def id_color(p):
'''Returns the dominant color of pixel p'''
pass
#Your code here to determine the dominant color and return a string identifying it
#Hint: get the red, green & blue values and use an if statement to determine which has the highest value

def main():
'''Controls the program'''
for i in range(5): #Loop 5 times
r = random.randrange(0, 256)
g = random.randrange(0, 256)
b = random.randrange(0, 256)
print(r, g, b) #Show the pixel red, green & blue values
new_pixel = image.Pixel(r, g, b)
print(id_color(new_pixel))

main() #Run the program

In: Computer Science

First, launch NetBeans and close any previous projects that may be open (at the top menu...

First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects).

Then create a new Java application called "BackwardsStrings" (without the quotation marks) that:

  1. Prompts the user at the command line for one 3-character string.
  2. Then (after the user inputs that first 3-character string) prompts the user for another 3-character string.
  3. Then prints out the two input strings with a space between them.
  4. Finally prints on a separate line the two input strings 'in reverse' (see example below) with a space between them.

So, for example, if the first string is 'usr' and the second string is 'bin', your program would output something like the following:

The two strings you entered are: usr bin.
The two strings in reverse are: nib rsu.

Note that the reversed SECOND string comes FIRST when printing the strings in reverse.

This program must be completed without using loops and without using StringBuilder.

See Horstmann pp. 62-63 for some ideas. Make sure your program includes the command line prompts for the user and that it formats the output appropriately.

Be sure both input strings are three characters in length. If this data validation isn't passed, output "Invalid string length for one or both inputs." and do not proceed with further processing of the strings.

In: Computer Science

Write a program 'Rectangle-Area.c' that inputs the length and width of a rectangle and outputs its...

Write a program 'Rectangle-Area.c' that inputs the length and width of a rectangle and outputs its area. The program consists of two functions: the main function and a function that computes and returns the area of a rectangle. The output of the program should be in the main program, not in the function.

     Sample Input: 5 8   Sample Output: The area of a 5 by 8 rectangle is 40.

In: Computer Science

What is a network access point? I am trying to draw a network model for the...

What is a network access point?

I am trying to draw a network model for the company "Slack". What would be considered an access point to a big company like that. I have an example that says small businesses use LAN

In: Computer Science