Questions
Implement a recursive algorithm to compute the product of two integers (in java). Your algorithm can...

Implement a recursive algorithm to compute the product of two integers (in java). Your algorithm can only perform addition and subtraction; no multiplication. Analyze the running time and space complexity of your solution.

In: Computer Science

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 120. Suppose Host A then sends two segments to Host B back-to-back. The first and second segments contain 80 and 50 bytes of data, respectively. In the first segment, the sequence number is 121, the source port number is 30058, and the destination port number is 80. Host B sends an acknowledgment whenever it receives a segment from Host A.

In the second segment sent from Host A to B, what are the sequence number, source port number, and destination port number?

If the first segment arrives before the second segment, in the acknowledgment of the first arriving segment, what is the acknowledgment number, the source port number, and the destination port number?

If the second segment arrives before the first segment, in the acknowledgment of the first arriving segment, what is the acknowledgment number?

In: Computer Science

Will biometrics involved encryption? How are biometric technology dependent on the use of cryptography?what are the...

Will biometrics involved encryption? How are biometric technology dependent on the use of cryptography?what are the different types of biometric that you have seen available why are they an advantage and disadvantage of biometrics?

In: Computer Science

Please provide an example of how MC.sim in R is to be used. The data can...

Please provide an example of how MC.sim in R is to be used. The data can be made up, but please provide steps and explanations what to plug into that function. Thanks.

In: Computer Science

Java question: Explain how class (static) variables and methods differ from their instance counterparts. Give an...

Java question:

Explain how class (static) variables and methods differ from their instance counterparts. Give an example of a class that contains at least one class variable and at least one class method. Explain why using a class variable and method rather than an instance variable and method would be the correct choice in the example you select.

In: Computer Science

Select the correct statement(s) regarding TCP. a. TCP is a connectionless protocol b. TCP uses windowing...

Select the correct statement(s) regarding TCP.

a. TCP is a connectionless protocol

b. TCP uses windowing as a means to control network congestion

c. TCP does not guarantee the proper sequencing of delivered packets

d. all of the above are correct statements

In: Computer Science

                                          &nb

                                                            Digital Clock with LCD Display

write the code for the function header:

#include "mbed.h"

#include "TextLCD.h"

     

1. In this lab, you will redo a digital clock this time with the LCD display and in the format of HH:MM:SS (HH is the hour from 0 -- 23, and MM is the minute from 00 -- 59, and SS is the second from 00-59)

2. Design the circuit that properly connects the LCD display to the mbed platform. Include your connection diagram in the Experiment Results of your lab report.

3. Based on the hardware design from step 2, design your code to implement the digital clock. Upon reset of the board, the clock should reset to 00:00:00, then changed to 00:00:01 after 1 second, and 00:00:02 after another second, etc.

4. Test your digital clock with an accurate clock (e.g. the clock in the computer). Explain the test process and what you observe while carrying out the test process. Is your digital clock accurate? If it is not, explain what you think might be the cause of the inaccuracy. "Calibrate" your digital clock by modifying your code to be as close to the accurate clock as possible. Include the details of your calibration process in your lab report.

I am more interested in the coding. Thanks

In: Computer Science

What is the purpose of copyrights, patents, and trademarks? If a student uses University resources to...

What is the purpose of copyrights, patents, and trademarks?

If a student uses University resources to develop and/or market software, is he/she required to notify the University?

What are the benefits of notifying the University?

What is the difference between a patent and a copyright?

In: Computer Science

Matlab Programming Write an M-file to read a real-valued vector of any length from the keyboard...

Matlab Programming

Write an M-file to read a real-valued vector of any length from the keyboard and sort it into descending order, i.e., rearrange all the numbers from the biggest one to the smallest one.

Please test your program with the following 9-element array:

input_vector=[-1, -11, 6,-17, 23, 0, 5, 9, -8]

In: Computer Science

Background: This course is all about data visualization. However, we must first have some understanding about...

Background: This course is all about data visualization. However, we must first have some understanding about the dataset that we are using to create the visualizations.

Assignment:

  • Use RStudio to generate a word document with basic data analysis of the following dataset: dataset_price_personal_computers.csv  

Questions/Requests:

  • Create a summary of stats for the dataset. (provide a screen shot)
  • Create a correlation of stats for the dataset. (provide a screen shot) (Hint: Transform may be needed)
  • What is the Min, Max, Median, and Mean of the Price? (provide a screen shot)
  • What is the correlation values between Price, Ram, and Ads? (provide a screen shot)
  • Create a subset of the dataset with only Price, CD, and Premium. (provide a screen shot)
  • Create a subset of the dataset with only Price, HD, and Ram where Price is greater than or equal to $1750. (provide a screen shot)
  • What percentage of Premium computers were sold? (provide a screen shot)(Hint: Categorical analysis)
  • How many Premium computers with CDs were sold? (provide a screen shot)(Hint: Contingency table analysis)
  • How many Premium computers with CDs priced over $2000 were sold? (provide a screen shot)(Hint: Conditional table analysis)

Your document should be an easy-to-read font in MS Word (other word processors are fine to use but save it in MS Word format).

For : dataset_price_personal_computers.csv  this is the link. With the help of this you can download that csv file

https://drive.google.com/file/d/1Op6XIzU5WuVF-w1OHqdcUJXMTUICaFy0/view

Sorry, i came to know that unable to download the file. Try this link and let me know

Please provide answers for this question including screenshots and code.

Thanks

In: Computer Science

Given a queue of integers, write an algorithm in Pseudocode that, using only the queue ADT,...

Given a queue of integers, write an algorithm in Pseudocode that, using only the queue ADT, calculates and prints the sum and the average of the integers in the queue without changing the contents of the queue.

In: Computer Science

in C++, please show step by step with simple codes. thank you An application from Biology...

in C++, please show step by step with simple codes. thank you
An application from Biology
The only built-in function you can use is length.
1. As a starting point, write a piece of pseudocode for a function that finds a substring of a string. Your
function should take as input the string, the starting point of the desired substring, and the length of the desired substring. For example, substring(“abracadabra”, 3, 5) should return “acada”.

2. Turn your pseudocode from 1 into C++ code. Run your code with several outputs to be sure it’s right.

3. We may wish to look for occurrences of specific protein sequences (that correspond to certain traits) in a strand of DNA. For instance, if you were looking for the protein sequence "AATG" in the DNA strand "ATGCAGAAAGCTACGATCAATGATCGATC AATGGAT", you would find that it starts at index 18. Note that there is more than one match, but we’ve found the starting index of the first one.
Write a piece of pseudocode, using your function from 1 and 2, that finds the index of the start of the the first match of a given string protein within the string dna. In our example above, protein would be “AATG” and dna would be "ATGCAGAAAGCTACGATCAATGATCGATC AATGGAT".

4. Turn your pseudocode from 3 into C++ code. Run your code with several outputs to be sure it’s right.

In: Computer Science

Section 6.9 of your textbook ("Debugging") lists three possibilities to consider if a function is not...

Section 6.9 of your textbook ("Debugging") lists three possibilities to consider if a function is not working.

Breaking a large program into smaller functions creates natural check points for debugging. If a function is not working, there are three possibilities to consider:
• There is something wrong with the arguments the function is getting; a precondition is violated.
• There is something wrong with the function; a postcondition is violated.
• There is something wrong with the return value or the way it is being used.

1. Describe each possibility in your own words.

2. Define "precondition" and "postcondition" as part of your description.

3. Create your own example of each possibility in Python code. List the code for each example, along with sample output from trying to run it.

In: Computer Science

Python: Using Inheritance to Create a Derived Class in Python In this lab, you create a...

Python: Using Inheritance to Create a Derived Class in Python

In this lab, you create a derived class from a base class, and then use the derived class in a Python program. The program should create two Motorcycle objects, and then set the Motorcycle’s speed, accelerate the Motorcycle object, and check its sidecar status.

Instructions

  1. Open the file named Motorcycle.py.
  2. Create the Motorcycle class by deriving it from the Vehicle class. Use a public derivation.
  3. In the Motorcycle class, create an attribute named sidecar.
  4. Write a public set method to set the value for sidecar.
  5. Write a public get method to retrieve the value of sidecar.
  6. Write a public accelerate method. This method overrides the accelerate method inherited from the Vehicle class. Change the message in the accelerate method so the following is displayed when the Motorcycle tries to accelerate beyond its maximum speed: "This motorcycle cannot go that fast".
  7. Open the file named MyMotorcycleClassProgram.py.
  8. In the MyMotorcycleClassProgram, there are two Motorcycle objects named motorcycleOne and motorcycleTwo.
  9. Set the sidecar value of motorcycleOne to true and the sidecar value of motorcycleTwo to false.
  10. Set motorcycleOne’s maximum speed to 90 and motorcycleTwo’s maximum speed to 85.
  11. Set motorcycleOne’s current speed to 65 and motorcycleTwo’s current speed to 60.
  12. Accelerate motorcycleOne by 30 mph, and accelerate motorcycleTwo by 20 mph.
  13. Print the current speed of motorcycleOne and motorcycleTwo.
  14. Determine if motorcycleOne and motorcycleTwo have sidecars. If yes, display the following: "This motorcycle has a sidecar". If not, display the following: "This motorcycle does not have a sidecar".
  15. Execute the program.

In: Computer Science

Create properly formatted script file (Initials_Final_pb_02.m) that will prompt the user to input a 1-D array...

Create properly formatted script file (Initials_Final_pb_02.m) that will prompt the user to input a 1-D array of numbers (positive, negative, zero) and then use loop and conditional statement to find the number of all non-zero elements in this array and their products

Do NOT use the built-in commands such as sum, prod, length, size, … etc.

-        Use proper names for input and output variables.

Use the following 3 vectors to test your function and include the results as a commented text at the end of your script file. [3 -1 0 -4 2], [10 -15 20 -15 0], [1 0 -2 5 -2 3]

Format the output using fprintf similar to the following:

There are 4 non-zero numbers and their product is 24

In: Computer Science