Questions
Host A and B are communicating over a TCP connection, and Host B has already received...

Host A and B are communicating over a TCP connection, and Host B has already received from A all bytes up through byte 99. Suppose Host A then sends two segments to Host B back-to-back. The first and second segments contain 30 and 70 bytes of data, respectively. In the first segment, the sequence number is 100, the source port number is 4321, and the destination port number is 80. Host B sends an ACK whenever it receives a segment from Host A, i.e., no delayed ACK.

  1. In the second segment sent from Host A to B, what is the sequence number?
  2. If the first segment arrives before the second segment, in the ACKs of two arriving segments, what are the acknowledgment numbers of the first and second arriving segment, respectively? What are the source port number and the destination port number in ACK?
  3. If the second segment arrives before the first segment, in the ACKs of two arriving segments, what are the acknowledgment numbers of the first and second arriving segment, respectively?
  4. Suppose the two segments sent by A arrive in order at B. The first ACK is lost and the second ACK arrives before the first timeout interval. What will happen at Host A? If Host A needs to retransmit some segment, what are the sequence number and the number of bytes of the data? Now assume the first ACK is lost and the second ACK arrives after the first timeout interval. What will happen at Host A? If Host A needs to retransmit some segment, what are the sequence number and the number of bytes of the data?

In: Computer Science

Your friend has a company leading textile enterprise in your city and needs to develop a...

Your friend has a company leading textile enterprise in your city and needs to develop a next generation (information system) strategic plan. Select the most powerful technique of strategic planning which can be used to help him achieve his goals

In: Computer Science

CREATE TABLE Hotel ( roomNumber     INTEGER         PRIMARY KEY, type                  CHAR(1

CREATE TABLE Hotel

(

roomNumber     INTEGER         PRIMARY KEY,

type                  CHAR(10)         NOT NULL,

rate                   INTEGER         NOT NULL,

--

CONSTRAINT IC1 CHECK (type IN ('suite', 'king', 'queen')),

CONSTRAINT IC2 CHECK (type <> 'suite' OR rate > 200),

CONSTRAINT IC3 CHECK (NOT (type = 'king' AND (rate < 80 OR rate > 220))),

CONSTRAINT IC4 CHECK (NOT (type = 'queen' AND rate >= 100))

);

which 8 of these inserts will be rejected only 8 are rejected

1.

INSERT INTO Hotel VALUES (21, 'king', 90);

2.

INSERT INTO Hotel VALUES (42, 'suite', 230);

3.

INSERT INTO Hotel VALUES (52, 'suite', 200);

4.

INSERT INTO Hotel VALUES (40, 'queen', 230);

5.

INSERT INTO Hotel VALUES (31, 'king', 50);

6.

INSERT INTO Hotel VALUES (30, 'queen', 50);

7.

INSERT INTO Hotel VALUES (22, 'suite', 90);

8.

INSERT INTO Hotel VALUES (10, 'queen', 210);

9.

INSERT INTO Hotel VALUES (20, 'queen', 90);

10.

INSERT INTO Hotel VALUES (51, 'king', 220);

11.

INSERT INTO Hotel VALUES (41, 'king', 230);

12.

INSERT INTO Hotel VALUES (32, 'suite', 50);

13.

INSERT INTO Hotel VALUES (11, 'king', 210);

14.

INSERT INTO Hotel VALUES (12, 'suite', 210);

15.

INSERT INTO Hotel VALUES (50, 'queen', 100);

In: Computer Science

Create a List Create a class that holds an ordered list of items. This list should...

Create a List

Create a class that holds an ordered list of items. This list should have a variable size, most importantly this class should implement the interface SimpleArrayList. Feel free to add as many other functions and methods as needed to your class to accomplish this task. In other words, you have to write the code for each of the functions specified in the SimpleArrayList interface.

You are not allowed to use any 3rd party data structures or libraries such as Java.Utils.ArrayList or Java.awt.ArrayList

Please use the class SimpleArrayListUnitTest.java to test your code, it is a JUnit test that contains 49 different tests that test all the functions of your class.

(using Eclipse.. I don't have any idea :()

In: Computer Science

IN JAVA PLEASE The Palindrome class will have a single constructor that accepts a String argument...

IN JAVA PLEASE

The Palindrome class will have a single constructor that accepts a String argument and checks to see if the String is a palindrome.

If it is a palindrome it will store the palindrome and the original String as state values. If is not a palindrome it will throw a “NotPalindromeError” and not finish the creation of the new Palindrome object.

The constructor will use a single stack to evaluate if the String is a palindrome.

You must use a bounded stack to do the evaluation. You may use the ArrayBoundedStack from the book.

The bounded stack may only hold one half of the target String.

The Strings to be checked will consist of alphanumeric characters, spaces, and punctuation. The spaces and punctuation are to be ignored for the purpose of determining if the Strings are palindromes. Capitalization should not affect the identification of a palindrome.

In: Computer Science

- Part 2 – 4 Desk Checking Exercises – these are 3 programs (pseudocode) that are...

- Part 2 – 4 Desk Checking Exercises – these are 3 programs (pseudocode) that are working and 1 program (Python). Explainthe intent of the pseudocode / program. If you use test data, note the test data.  .  You are NOT trying to find mistakes.

What does this do? Desk Checking #1:  Explain the intent of this pseudocode. List the data you use as the example data.

start

                  Declarations

         num balance

Use this textbox to explain the pseudocode/ code intent. Include any test data used:

         num month

         num loanAmt

         num paymentAmt

         string PROMPT = “Enter the loan amount and payment amount >> ”

housekeeping()

detail()

finishUp()

stop

housekeeping()

         output PROMPT

         input loanAmt, paymentAmt

return

detail()

                  month = 1

                  balance = loanAmt

                  while balance > 0

                           balance = balance – paymentAmt

                           output month, balance

                           month = month + 1

                  endwhile

return

finishUp()

         output “End of program”

return

In: Computer Science

1: Identify how managerial levers can be used by decision makers to effect changes in their...

1: Identify how managerial levers can be used by decision makers to effect changes in their organizations



2: Examine a potential strategy which can be used to prepare for competitors in the industry and potential new entrants



3: Examine the impact of the value system in information source



4: Evaluate the role of the working outward strategy to improve the relationship between the business and the customer.



5: Explain the best way for an organisation to gain an advantage via the internet



6: Explain loose, close, and tight relationships


In: Computer Science

strcpy strcat strcmp strstr strchr fgets Specification The program should repeatedly prompt the user to enter...

  • strcpy
  • strcat
  • strcmp
  • strstr
  • strchr
  • fgets

Specification

The program should repeatedly prompt the user to enter a string of no more than 20 characters. The program will end when the user types in DONE (all caps). Use fgets to get input from the user.

Because fgets leaves the newline character on the string, the program should trim off the newline by replacing it with the null character, effectively shortening the string. Use strchr to locate the newline.

The program will use the input to build up a longer string. You may assume this string will be no longer than 1000 characters. The user input is compared to the longer string and then takes action as follows:

  • If the input is contained within the longer string, ignore it. Use strstr to perform the search.
  • If the user input is less than the longer string (as indicated by the return value from strcmp), prepend the input onto the longer string with a space separating them.
  • If the input is greater than the longer string, append it with a space separating them.

After each user input, display the longer string.

Sample Run

Here's a sample of how the program would work. I've shown user input in bold, just to help it stand out. Your program won't use any special typography.

Enter a string: hello
hello
Enter a string: world
hello world
Enter a string: bye
bye hello world
Enter a string: cat
bye hello world cat
Enter a string: worl
bye hello world cat
Enter a string: beep
beep bye hello world cat
Enter a string: bingo
beep bye hello world cat bingo
Enter a string: DONE
beep byte hello world cat bingo

Let's analyze this one input at a time.

  1. User enters hello. Since this is the first sting entered, it is copied into the longer string.
  2. User enters world. Because world comes after hello, it is appended onto the longer string.
  3. User enters bye. This comes before hello world, so it is prepended.
  4. User enters cat. This comes after bye hello world, and is appended.
  5. User enters worl. This string is found within the longer one; no change to the longer string.
  6. User enters beep. Since beep comes before bye hello world cat, it is prepended.
  7. User enters bingo. This comes after beep bye hello world cat, and is appended.
  8. User enters DONE. The longer string is displayed one last time and the program ends.

Please note that the program is not putting the words in alphabetic order. It's actually doing something simpler than sorting.

In: Computer Science

Program must be in C Write a program that allows the user to enter the last...

Program must be in C

Write a program that allows the user to enter the last names of five candidates in a local election and the number of votes received by each candidate in two different arrays.

The program should then output each candidate’s name, the number of votes received, and the percentage of the total votes received by the candidate.

Your program should also output the winner of the election.

Example (Letters and numbers with underscore indicate an input):

Enter candidate's name and the votes received by the candidate.
Johnson 5000
Miller 4000
Duffy 6000
Robinson 2500
Asthony 1800

 Candidate    Votes Received   % of Total Votes
 ---------    --------------   ----------------
   Johnson       5000                 25.91
    Miller       4000                 20.73
     Duffy       6000                 31.09
  Robinson       2500                 12.95
   Asthony       1800                  9.33

Total Votes: 19300
The Winner of the Election is: Duffy

In: Computer Science

Write a Python program that simulates a restaurant ordering system where it stores multiple orders of...

Write a Python program that simulates a restaurant ordering system where it stores multiple orders of a dish and the price for each order stored into a list. The program will then print the receipt which includes list of orders and their price along with the subtotal before tax, the tax amount, and the final total. Also include tip suggestions for 10%, 15% and 20%. Use the format specifiers to make the price line up and the tip only 2 decimal points.

Example:

Welcome to No 2. Kitchen

Order

Lt. Tso Chicken                 $ 17.50

Half Century Eggs            $   2.50

Durian ice cream               $   5.00

=========================

Subtotal                             $ 25.00

Tax (7%)                           $   1.75

=========================

Total                                  $ 26.75

Tip suggestion

10% : $2.67  

15% : $4.01

20% : $5.35

In: Computer Science

8: Analyse the difficulties of measuring system benefits in information system 9: Compare between rewrite system...




8: Analyse the difficulties of measuring system benefits in information system

9: Compare between rewrite system and reengineering system

10: Show the key elements of enterprise architecture

11 : Assess how companies can encourage ethical behavior

12: Justify why companies use policies and give an examples

13: Evaluate canagh's proposal to solve ethical problems

14: Analyse two categories of IT decisions on IT governance

15: Justify how the security strategy must be linked with business objectives


In: Computer Science

- Part 2 – 4 Desk Checking Exercises – these are 3 programs (pseudocode) that are...

- Part 2 – 4 Desk Checking Exercises – these are 3 programs (pseudocode) that are working and 1 program (Python). Explainthe intent of the pseudocode / program. If you use test data, note the test data.  .  You are NOT trying to find mistakes.

What does this do? Desk Checking #2:  Explain the intent of this pseudocode.  Be as specific as possible.
List the data you use as the example data.

Use this textbox to explain the pseudocode/ code intent. Include any test data used:

start

         guess number between 1 and 100

         while guess is not correct

                           if guess is too high

                                             guess a number lower than the previous guess

                           else

                                             guess a number higher than the previous guess

                           endif

         endwhile                 

         player wins

stop

In: Computer Science

In computer science, when is the right time to find the Upper bound, Lower bound, and...

In computer science, when is the right time to find the Upper bound, Lower bound, and Tight bound? And what does Tight Bound show us?

In: Computer Science

- Part 2 – 4 Desk Checking Exercises – these are 3 programs (pseudocode) that are...

- Part 2 – 4 Desk Checking Exercises – these are 3 programs (pseudocode) that are working and 1 program (Python). Explainthe intent of the pseudocode / program. If you use test data, note the test data.  .  You are NOT trying to find mistakes.


Use this textbox to explain the pseudocode/ code intent. Include any test data used:

What does this do? Desk Checking #4:  Explain the intent of this code.  Be as specific as possible.  
List the data you use for example data.

import random

number = random.randint(1, 10)

keepGoing = input("Do you want to guess a number? Enter Y or N ")

while (keepGoing != "Y") and (keepGoing != "N"):

    keepGoing = input("Invalid Response." + " Please type Y or N. ")

while keepGoing == "Y":

    

    stringNumber = input("I'm thinking of a number. .\n Try to guess by entering a number between 1 and 10 ")

    userNumber = int(stringNumber)

    

    while (userNumber < 1) or (userNumber > 10):

        stringNumber = input("Number must be in the range of 1 to 10: Please try again: ")

        userNumber = int(stringNumber)

    if userNumber == number:

        keepGoing = "N"

        print("You are a genius. That's correct!")

    else:

        keepGoing = input("That's not correct. Do you want to guess again? Enter Y or N ")

        

        while (keepGoing != "Y") and (keepGoing != "N"):

            keepGoing = input("Invalid Response." + " Please type Y or N. ")

In: Computer Science

write a java prog that include an array of strings of size 50    String[] strings...

write a java prog that include an array of strings of size 50
   String[] strings = new String[50];
then find the max length of the inputs inside a method
keep reading from the user until user enters keyword to stop

input :
may ala
jony ram
asd fgghff
daniel
jwana

output :
max length : 10

In: Computer Science