Questions
Write the deleteNode() member function, which is also given in our textbook implementation. This function takes...

Write the deleteNode() member function, which is also given in our textbook implementation. This function takes a const T& as its parameter, which is the value of an item to search for and delete. Thus the first part of this function is similar to the search() function, in that you first have to perform a search to second the item. But once found, the node containing the item should be removed from the list (and you should free the memory of the node). This function is only guaranteed to find the first instance of the item and delete it, if the item appears multiple times in the list, the ones after the first one will still be there after the first item is removed by this function. This function should return a LinkedListItemNotFoundException if the item asked for is not found. The LinkedListItemNotFoundException class has already been defined for you in the starting template header file.

Here is the cpp for main and LinkedList - https://paste.ofcode.org/37gZg5p7fiR243AD4sD5ttU

In: Computer Science

Consider the following relation with structure EMPLOYEE_DATA (EmployeeID, EmployeeDegree, DepartmentID, DepartmentName) EmployeeID EmployeeDegree DepartmentID DepartmentName 001...

Consider the following relation with structure EMPLOYEE_DATA (EmployeeID, EmployeeDegree, DepartmentID, DepartmentName)

EmployeeID EmployeeDegree DepartmentID DepartmentName
001 Mathematics 1004 R&D
001 Mathematics 1004 R&D
002 Info. Systems 2003 Cybersecurity
003 Computer Sci 5816 Software

The functional dependencies are as follows: EmployeeID → EmployeeDegree, DepartmentID → DepartmentName, (EmployeeID,DepartmentID) → (EmployeeDegree, DepartmentName).

Put the above relation into BCNF. For your solution use the shorthand TABLENAME (primarykey1, primarykey2, attribute1, attribute2).

In: Computer Science

Last Statement. Look,- I'm a retired electrician of 30 years that's been through some life, and...

Last Statement. Look,- I'm a retired electrician of 30 years that's been through some life, and then some..? I saw Linus Sabastian on "Linus Tech Tips" and he made building PCs fun. He made them fun, and easy to learn how to assemble, transfer files, and some other things as well. I thought, because of the way he teaches the GUI to be fun that I could go to my Local Community College and learn CLI but here is the big problem with that?

CLI hasn't had anybody that can come up with a way to make it easy to learn, and fun, and until somebody does I'm going back to the GUI, and where the fun is.....To learn CLI I need the answer 1st to all my assignments just like learning how to build PC's on YouTube, and then I could at least begin to see how the answers are used in the questions of the assignment asked? I'm backward, and I learn visually just like Youtube teaches with having the answers in our hands. 1st.

To all the College Professors in the world that teach Linux and Windows Command Line, When one of you decides to give the answers with your assignments so the students don't have to spend valuable hours research hunting and you wonder why there failing the class? Do something different & radical for a change give the whole class the answers to all the assignments and then Linux will be fun, and we will understand the assignment because we can now see the answers to it. Sincerely T

In: Computer Science

Explain the CUDA memory model with respect to ( grid, block, thread)

Explain the CUDA memory model with respect to ( grid, block, thread)

In: Computer Science

I) Calculate the 8-bit 2's complement for -113. * a)0111 0001 b)1000 1110 c)1000 1111 d)1000...

I) Calculate the 8-bit 2's complement for -113. *

a)0111 0001

b)1000 1110

c)1000 1111

d)1000 0001

II) Select the correct expanded form for the binary number 11010.

III) What is the value of the digit A in the following hexadecimal number: 3A2

a)10

b)100

c)16

d)160

IV) What is the decimal representation for the integer with two’s complement 1011 1001? You must show work

In: Computer Science

IN JAVA!!! This is called the Josephus problem. Josephus.mp4Play media comment. Use words.txt as input. Use...

IN JAVA!!!

This is called the Josephus problem. Josephus.mp4Play media comment.

Use words.txt as input.

Use the Node class and the Circular Queue class you created in L5b.

In your main program input the words from words.txt into a Queue (a circular queue) - do this by using enqueue .

Then input an integer (n). Then starting at the head of the queue delete every nth node until only one node remains. Output the String in that last node.

Make NO changes to the Node class. In the Queue class you will need a method to delete every nth node.

You will need to print your queue, so make a print method in your Queue class. This should print the ENTIRE queue, not just the head. It is true that at the end only the head should remain, but by printing the entire queue and finding there is only one node printed you are verifying to me (and to yourself) that only the head remains.

When I ran my program these are the answers I got:

n=5 : hostelry

n=29: cliquish

n=7: alienist

SUGGESTION: Try this on a smaller input file first. This one contains just the numbers 1-20    Ex.txt

You can try this by hand, and then verify that your program is correct. For n=5, the answer is "20"

NODE CLASS

class Node<T> {
//Node makes item, next, and prev all private
//and therefore has to provide accessors
//and mutators (gets and sets)
private T item;
private Node next;
private Node prev;

Node(T newItem) {
item = newItem;
next = null;
prev = null;
}

Node(T newItem, Node nextNode, Node prevNode) {
item = newItem;
next = nextNode;
prev = prevNode;
}

/**
* @return the item
*/
public T getItem() {
return item;
}

/**
* @param item the item to set
*/
public void setItem(T item) {
this.item = item;
}

/**
* @return the next
*/
public Node getNext() {
return next;
}

/**
* @param next the next to set
*/
public void setNext(Node next) {
this.next = next;
}

/**
* @return the prev
*/
public Node getPrev() {
return prev;
}

/**
* @param prev the prev to set
*/
public void setPrev(Node prev) {
this.prev = prev;
}

}

QUEUE CLASS

class Queue<T> {

private Node head, tail = null;
int size = 0;
public Queue() {
head = tail = null;
size = 0;
}
//enqueue
public void enqueue(T item) {
Node temp = new Node(item);
if (head == null) {
head = temp;
tail = temp;
} else {
temp.next = head;
tail.next = temp;
tail = temp;
}
size++;
}

//dequeue
public T dequeue(T item) {
Node temp = head;
head = head.next;
tail.next = head;
size--;
return (T) temp.item;
}
//size
public int size() {
if (size == 0) {
}
return size;
}
//peek
public T peek() {
return (T) head.item;
//return item
}
//isEmpty
public boolean isEmpty() {
return (size == 0);
}
//print in queue class
public void print() {
if(head != null) {
Node curr = head;
System.out.println(curr.item);
curr = curr.next;
while (curr != head) {
System.out.println(curr.item);
curr = curr.next;
}
}
}

//Deletes every nth node until only one node remains
public void delete(int num, Queue q) {
Node head = q.head;
Node tail = q.tail;
int count;
Node temp = tail;
int length = q.size;
while((head != tail) && length > 1){
count = 1;
while(count != num){
temp = temp.next;
count++;
}
System.out.println("Deleting " + temp.next.item);
temp.next = temp.next.next;
length--;
}
q.head = temp;
q.tail = temp;
q.size = length;
}
}

In: Computer Science

How would Hyper-V be installed on a Windows Server Core installation?

How would Hyper-V be installed on a Windows Server Core installation?

In: Computer Science

1) Within the main function, the call to the constructor by defense of a class called...

1) Within the main function, the call to the constructor by defense of a class called MyClass is made by creating the firstClass object as follows.

A) MyClass firstClass;

B) MyClass firstClass (8);

C) MyClass () firstClass;

D) MyClass firstClass ();

In: Computer Science

Which of the following is not a source of switching costs? Question 3 options: Financial Commitment....

Which of the following is not a source of switching costs?

Question 3 options:

Financial Commitment.

Learning Costs.

Loyalty Programs.

Lack of Contractual Commitments.

2,

Agile Development""

Question 2 options:

Tends to take too much time to implement, and is typically considered inflexible.

A relatively linear, and sequential approach to software development.

Seeks to enable more frequent product roll outs, and constant improvement across smaller components of a large project.

Frequently considered the "classic" method of software development.

3,

Which of the following is not an attribute of "Infrastructure as a Service" ("IaaS")?

Question 5 options:

It offers an organization an alternative to buying its own physical hardware.

It offers an organization the opportunity to pay solely for the resources that it consumes.

It typically requires the least amount of support and maintenance.

It offers an organization the least opportunity for customization.

In: Computer Science

1. Remove left recursions if any A -> Aab | abA | ab B -> bb...

1. Remove left recursions if any

A -> Aab | abA | ab
B -> bb | Bb | bB

In: Computer Science

Prove the following problems. 1 .Use the definition of big O to explain why or why...

Prove the following problems.

1 .Use the definition of big O to explain why or why not 3/(x2 + 3x) = O(3). Prove your answer.

2 .Use the definition of  Θ to explain why or why not sqrt(2 + sqrt(3x)) =  Θ(x1/4). Prove your answer.

3 .Explain why 5x2 =  Θ(2x2) is true and  5x2 ~ 2x2 is not true.

In: Computer Science

Create a new project to build a Binary search tree, and do the following: Create a...

Create a new project to build a Binary search tree, and do the following:

Create a TreeNode class,

Add the methods "Insert" to insert new nodes to the tree.

Add the method "inorder". Make the method to return a list of the node elements in inorder.

Implement the equals method in the BST. Two BST are equal if they contain the same elements.

In the main insert the elements of the tree, call the max method and print the max element, and Print the tree in "inorder" format.

Enter the following tree :

BinaryTree Test your program in case you have two identical trees and another time when you have different trees.

Java Please!

In: Computer Science

Question 1: What third-party modules does this project use? What are they? What are their versions?...

Question 1: What third-party modules does this project use? What are they? What are their versions? How did you find that information?

Question 2: Who are the contributors for socket.io module? List their names and email addresses.

Question 3: What do you need to do if the event name ‘chat message’ is changed to ‘trump’ in index.html file so that the application doesn’t break?

var socket = io();

$('form').submit(function(){

socket.emit('trump', $('#m').val());

$('#m').val('');

return false;

});

socket.on('trump', function(msg){

$('#messages').append($('<li>').text(msg));

});

index.js:

var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);

app.get('/', function(req, res){
  res.sendFile(__dirname + '/index.html');
});

io.on('connection', function(socket){
  socket.on('chat message', function(msg){
    io.emit('chat message', msg);
  });
});

http.listen(3000, function(){
  console.log('listening on *:3000');
});

In: Computer Science

When multiple thread access the setLower and setUpper methods of the NumberRange object, the isValid method...

When multiple thread access the setLower and setUpper methods of the NumberRange object, the isValid method return false. Explain why?

public class NumberRange {

private final AtomicInteger lower = new AtomicInteger(0);

private final AtomicInteger upper = new AtomicInteger(0);

  public void setLower(int i) {

if(i>lower upper.get()) throw new IllegalArgumentException();

lower.set(i);

}

public void setUpper(int i) {

if (i < lower.get()) throw new IllegalArgumentException();

upper.set(i);

}

public boolean isValid() {

return (lower.get() <= upper.get());

}

}

In: Computer Science

Directions: Using a vector of integers that you define. Write a C++ program to run a...

Directions:

Using a vector of integers that you define.

Write a C++ program to run a menu driven program with the following choices:

1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit

Make sure your program conforms to the following requirements:

1. Write a function called getValidAge that allows a user to enter in an integer and loops until a valid number that is >= 0 and < 120 is entered. It returns the valid age.

2. Write a function called displayAges that takes in a vector of integers as a parameter and displays the ages in the format in the sample run below.

3. Write a function called AddAge that takes in a vector of integers by reference as a parameter, asks the user to input a valid age, and adds it to the vector of integers .

4. Write a function called getAverageAge that takes in a vector of integers as a parameter, computes, and returns the average age.

5. Write a function called getYoungestAge that takes in a vector of integers as a parameter, computes, and returns the youngest age.

6. Write a function called getNumStudentsVote that takes in a vector of integers as a parameter, computes, and returns the number of ages in the vector that are >= 18. (15 points).

7. Write a function called RemoveStudentsLessThanSelectedAge that takes in a vector of integers as a parameter, asks the user for an age, creates a new vector of integers that only contains the ages in the parameter vector which are >= the age selected by the user and returns the new vector.

8. Add comments wherever necessary.

NOTE: You must take care of the case when the vector is empty and an operation is being performed on it. In such cases the program should display a 0 for the given result.

Sample Runs:

NOTE: not all possible runs are shown below.

Welcome to the students age in class program!
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..1
Student ages:

1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..3
Average age = 0
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..4
Youngest age = 0
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..5
Number of students who can vote = 0
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..6
Please enter in the age...
5
Students removed
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..2
Please enter in the age...
4
Age added
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..2
Please enter in the age...
24
Age added
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..2
Please enter in the age...
18
Age added
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..2
Please enter in the age...
12
Age added
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..1
Student ages:
4 24 18 12
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..3
Average age = 14
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..4
Youngest age = 4
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..5
Number of students who can vote = 2
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..6
Please enter in the age...
15
Students removed
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..1
Student ages:
24 18
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..3
Average age = 21
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..4
Youngest age = 18
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..5
Number of students who can vote = 2
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..-8
Select an option (1..7)..8
Select an option (1..7)..1
Student ages:
24 18
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..2
Please enter in the age...
-8
Please enter in a valid age (1-120) ...
130
Please enter in a valid age (1-120) ...
55
Age added
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..1
Student ages:
24 18 55
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..7

Process finished with exit code 0

General Requirements:

1. Please make sure that you're conforming to specifications (program name, print statements, expected inputs and outputs etc.). Not doing so will result in a loss of points. This is especially important for prompts.

2. If we have listed a specification and allocated point for it, you will lose points if that particular item is missing from your code, even if it is trivial.

3. No global variables (variables outside of main() ) unless they are constants.

4. All input and output must be done with streams, using the library iostream

5. You may only use the iostream, iomanip, and vector libraries. Including unnecessary libraries will result in a loss of points.

6. NO C style printing is permitted. (Aka, don't use printf). Use cout if you need to print to the screen.

7. When you write source code, it should be readable and well-documented (comments).

In: Computer Science