MUST BE SOLVED USING [R]
How to get the nth largest even value of given array? (Use while loop and if-statement for this problem. Do not use existing codes. Use your own codes). DO NOT USE ANY KINDS OF SORT FUNCTIONS.
For example, in given list [10,36,58,31,56,77,43,12,65,19], if n is defined as 2. The program will print 56.
In: Computer Science
Write Java Program.
(Plot the sine and cosine functions) Write a program that plots the sine function in red and cosine in blue, as shown in Figure 14.48c.
Hint: The Unicode for P is u03c0. To display -2p, use Text(x, y, "-2\u03c0"). For a trigonometric function like sin(x), x is in radians. Use the following loop to add the points to a polyline:
Polyline polyline = new polyline ();
ObservableList<Double> list = polyline.getPoints ();
double scaleFactor = 50;
for (int x = -170; x <= 170; x++){
list.add(x + 200.0);
list.add(100 - 50 * Math.sin((x / 100.0) * 2 * Math.PI));
}
In: Computer Science
What are the new development in cellular network such as infrastructure and applications? What's your thoughts on future of the cellular/mobile network? *2 or more paragraphs*
In: Computer Science
PART B: Computing Fibonacci Numbers With Threads
This programming project is based on a problem given in our textbook. The Fibonacci sequence is the series of numbers 0, 1, 1, 2, 3, 5, 8,.... Formally, it can be expressed as: fib0 = 0 fib1 = 1 fibn = fibn-1 + fibn-2 Write a multithreaded program that generates the Fibonacci series using the pThreads library. This program should work as follows: The user will enter on the command line the number of Fibonacci numbers that the program will generate. The program will then create a separate thread that will generate the Fibonacci numbers placing the sequence in data that is shared by the threads (an array or vector is probably the most convenient data structure). When the thread finishes execution, the parent thread will output the sequence generated by the child thread. Because the parent thread cannot begin outputting the Fibonacci sequence until the child thread finishes, this will require having the parent thread wait for the child thread to finish, using the techniques discussed in the class
In: Computer Science
Write a simple PHP script. In your script use all of the following: HTML, Javascript, and PHP.
In: Computer Science
JAVA PRACTICE PROBLEMS [ Thumbs up and good review guaranteed if code is correct! ]
PART I: Implement a method comboDie that takes two dice parameters. The method returns a die with color (the combination of each die’s colors) and face value (the integer average of each die’s face values).
PART II: Using the Die class defined in PART I, design and implement a class called PairOfDice,composed of two Die objects as instance data. The class should include the following methods:
•A non-default constructor, i.e. with parameters
•A setter method for each instance data
•A getter method for each instance data
•A method roll() that rolls both dice
•A toString()method that returns a string containing the colors of both dice, eg “Colors of both dice: Red, Blue”
•A method pairSum that returns the current sum of the two die values. (PairOfDice.java)
PART III: Write an application TestPairOfDice that uses the PairOfDice class to create a pair of dice. The application prints to the screen the sum of their face values. The program then rolls the pair of dice and prints to the screen the new sum of their face values and the colors of both dice. (TestPairOfDice.java)
Edit: Die class is defined in PART 1 of the question where you do it.
In: Computer Science
Create a new website using C# & ASP.Net in Visual Studio:
1. Create a web page to access a database and display the data from a table by providing an SQL statement. Create the page with these requirements:
create label, textbox and button
the textbox will capture the SQL statement
the button will process the statement and
display the results
2. Add necessary data access pages to your project.
3. Display the data in Gridview
In: Computer Science
what is the difference between FEATHER lightweight protocol and Searchable symmetric encryption?
explain and give the answer in terms of mobile cloud computing
In: Computer Science
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 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 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 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 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 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 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