Using the singly linked list code as a base, create a class that implements a doubly linked list. A doubly linked list has a Previous link so you can move backwards in the list. Be sure the class is a template class so the user can create a list with any data type. Be sure to test all the member functions in your test program. c++
In: Computer Science
Secure VPN Configuration and Management & Wireless Network Defense
Give me two pages of easy about the topic.
In: Computer Science
You will need to provide screenshots of each number and each task. Example: Number 8 in VM One should have 20 screenshots, one for each command. Once completed merge all shots into a Word document and upload to the appropriate drobox.
VM One
VM Two
VM Three
In: Computer Science
Two players play a game where they start with a row of n piles of varied amounts of money. The players take turns and in each turn a player can pocket either the money in the first pile or the last pile in the row of piles that remains. Design an efficient algorithm (using dynamic programming), which on any given sequence of amounts, determines the maximum amount of money that player 1 can win.
If n is even, prove that player 1 wins at least half the money available. If n is odd, player 1 actually gets one more pile than player 2. In spite of that, show with a simple example that player 1 can be left with far less than half the total amount.
Note: you can write the algorithm either in plain English or in pseudocode.
In: Computer Science
Find out the control words for the following
Microoperations. Also, specify the functions being
carried out by each of these Microoperations.
(i) R2←clc(R2+R4+1)
(ii) -R3+R5
(iii) Output← shr(R7-R2-1)
(iv) R1←Input
(v) R3←R4’+1
(vi) R6←R2-R1+1
(vii) R5←0
(viii) R3←R2, C←1
(ix) R1←Input-R4-1
(x) R7←R6’+Input
.
In: Computer Science
Create the following functions for an array in C++. Test with size 10, 10,000 and 100,000. Time each sort.
Merge sort
Insertion Sort
Selection Sort
Bubble Sort
Quick Sort
PLEASE DO IT IN C++
In: Computer Science
Write a program using python that loops over each file in a specified directory and checks the size of each file.You should create 2-tuple with the filename and size, should append the 2-tuple to a list, and then store all the lists in a dictionary.
In: Computer Science
var selectedColor =
document.getElementById("colorChoice").value;
var selectedStyle = document.getElementById("style").value;
var selectedSize = document.getElementById("size").value;
var orderMessage = "Your order is: Color = " +
selectedColor
+ "; Style = " + selectedStyle
+ "; Size = " + selectedSize+"\n";
if (selectedStyle==="Long-sleeve")
//Add code to calculate the price and concatenate it to the
orderMessage
//For example, "The order is: Color = gray; Style=T-Shirt; Size =
XL \nThe price is $12"
//If the style and size are not available, then concatenate the
message that it is not available instead of a price.
// -- Notice: the color, style, and style is already stored
variables for you
// a t-shirt in any size is $9
// a long-sleeve t-shirt in adult sizes is $18
// a long-sleeve t-shirt is youth sizes is not available
// a tech shirt is is $12 except 2XL and 3XL which are $16.
alert(orderMessage);
//Next change this alert to write the order status to the HTML
page.
}
In: Computer Science
reate a C# program.
-Create 5 variables as decimals: Count, pricce, subtotal, tax, and
total
-Use a do while loop. If the price is not -1, the loop
continues.
Show count number (ie: Item 1, Item 2, Item 3...)
Enter price
Get subtotal
Increase count
-Calculate tax(0.035%) and total
Show total count, subtotal, tax,and total
Output:
Item1: $2.00
Item2:: $3.00
Item3: $1.00
Item4: $-2 (Note: A negative number will not be substracted. It will only be ignored)
There are 3 Items in this order (This is the total count)
Subtotal: $6.00
Tax 0.035: $0.21
Total: $6.21
In: Computer Science
class ArrayStringStack { String stack[]; int top; public arrayStringStack(int size) { stack = new String[size]; top = -1; } //Assume that your answers to 3.1-3.3 will be inserted here, ex: // full() would be here //empty() would be here... //push() //pop() //displayStack() }
1. Write two boolean methods, full( ) and empty( ).
2. Write two methods, push( ) and pop( ). Note: parameters may be expected for push and/or pop.
3. Write the method displayStack( ) that prints the stack like a stack, from top to bottom.
In java
In: Computer Science
Consider the following propositional formula:
(((A ^ B) -> C) ^ ((A ^ C) -> D)) -> ((A ^ B) -> D)
Perform the following tasks for this formula:
Convert this formula into CNF form and write a numbered list of all clauses obtained from this formula.
In: Computer Science
In RVW complete the following Sensor Challenges: Hand in your code for each challenge (you can paste into one document)
Try – it Forward until Touch Move the robot to the obstacle. Once the robot touches the obstacle it stops
Vacuum Challenge – Using the touch sensor, the robot needs to touch all four walls in the room
Arm Position Classic - For this challenge, The robotic arm is configured with the Touch Sensor attached so that it when the arm is fully upright the button on the Touch Sensor is pushed in. The starting point of the challenge has an object approximately 5 rotations length away from the robot. Starting with the arm in the ‘down’ position, program the robot to raise its arm until the touch sensor is pushed in, move forward 5 rotations, lower the arm around the object, and then bring the object back to the starting location.
Threshold Value - Using the Ultrasonic Sensor, set the threshold value so that the robot plays a sound when it detects an object within 10cm of the sensor.
Backward until far - Place a robot close to a wall with the Ultrasonic Sensor facing directly at it. Program the robot to move backward until the Ultrasonic Sensor reads a value greater than 30cm, and then stop.
Submit to Blackboard:
A document that contains your code for each of the above challenges.
Click on the badges icon to view your badges. In the same document, a screen shot of the badges earned to show you completed the challenges successfully. Although the screen shot below shows two challenges completed, yours should have five completed.
In: Computer Science
In C++
Create a program that uses Selection Sort and Insertion Sort for the National Football League list of current players. It's going to be a big list(over 1000 names). Please identify, in comments, which part of the code is for the Selection Sort and which part of the code is for Insertion Sort. It must have both.
Inputting data from a text file named "Players.txt"
Only want the name of the player(first name then last name), their team name, and position they play.
Example is:
Name | Team | Position |
Patrick Mahomes | Chiefs | Quarterback |
Julio Jones | Falcons | Wide Receiver |
Fletcher Cox | Eagles | Defensive Tackle |
Structure of the input file is:
Patrick Mahomes, Chiefs, Quarterback
Julio Jones, Falcons, Wide Receiver
Fletcher Cox, Eagles, Defensive Tackle
Output both lists separately(please indicate which lists goes with which sorting method) to a text file along with how long it took to go through the Selection Sort and Insertion Sort and how many iterations it took for each.
Thanks.
If you can't do this then can you please let someone else.
In: Computer Science
C programming
4. Exploring Pointers and Use of Arrays [15 pts]
In a shell environment, programs are often executed using command
lines arguments. For example:
g++ -o cm03_la01 cm03_la01.c.
In C such program can be develop using a standard for which the
main program has two parameters as follows:
int main (int argc, char * argv[ ])
{
/*program here */
}
3
Because of the equivalence between pointers and arrays, the above C
code can also be written as follows:
int main (int argc, char ** argv)
{
/*program here */
}
The first parameter is an integer specifying the number of words
on the command-line, including the
name of the program, so argc is always at least one. The second
parameter is an array of C strings
that stores all of the words from the command-line, including the
name of the program, which is
always in argv[0]. The command-line arguments, if they exist, are
stored in argv[1], ..., up to
argv[argc-1].
Consider the program bin2dec.c, which is a program for binary to
decimal conversion that passes the
binary string as a command line.
For instance by typing ”bin2dec 11111”, you should get the
following message: “The Decimal equivalent is: 31”. Analyze and
understand the functionality
of bin2dec.c. Implement a new program base2dec.c that takes as
command line parameters the
source base 2, 8, or 16 followed by the string of base symbols and
gives the equivalent decimal
value. Below are some examples of execution outputs expected:
“base2dec 3 11111” will have as answer: “Error: The source base
should be 2, , 8, or 16”
“base2dec 2 11111” will have as answer: “The decimal equivalent
value is 31”
“base2dec 16 FF” will have as answer: “The decimal equivalent value
is 255”
“base2dec 8 35” will have as answer: “The decimal equivalent value
is 29”
Deliverable: File base2dec.c
This is what I have so far but it is not complete, please
finish/fix the following code
/*----------------------------------------------------------------------------*/
/* Title: bin2dec.c */
/*----------------------------------------------------------------------------*/
/* Binary to decimal conversion */
/* */
/* To compile: */
/* $ gcc -o bin2dec bin2dec.c */
/* $ chmod 755 bin2dec */
/* */
/* To run: */
/* $ ./bin2dec */
/* */
/*----------------------------------------------------------------------------*/
#include <stdio.h>
#include <math.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
unsigned binary_to_decimal(const char *str)
{
unsigned value, i, p;
/* Check if input is made of 0s(ASCII 48) and 1s (ASCII 49)
*/
for (i= 0; i < strlen(str); i++)
{
if (str[i] != 48 && str[i] != 49 )
{
printf(" Incorrect data\n");
exit (0);
}
}
/* Convert Binary to Decimal
Repeat for each binary digit starting from the last array element
*/
p = strlen(str) -1;
value = 0;
for (i= 0; i < strlen(str); i++)
{
value += (str[p] - 48) * (int)pow((double)2, (double)i);
p--;
}
return value;
}
unsigned hex_to_decimal(const char *str)
{
unsigned value, i, p;
/* Check if input is made of 0s(ASCII 48) and 1s (ASCII 49)
*/
for (i= 0; i < strlen(str); i++)
{
if (str[i] != 48 && str[i] != 49 && str[i] != 50
&& str[i] != 51 && str[i] != 52 && str[i]
!= 53
&& str[i] != 54 && str[i] != 55 && str[i]
!= 56 && str[i] != 57 && str[i] != 65 &&
str[i] != 66
&& str[i] != 67 && str[i] != 68 && str[i]
!= 69 && str[i] != 70)
{
printf(" Incorrect data\n");
exit (0);
}
}
/* Convert Binary to Decimal
Repeat for each binary digit starting from the last array element
*/
p = strlen(str) -1;
value = 0;
for (i= 0; i < strlen(str); i++)
{
value += (str[p] - 48) * (int)pow((double)16, (double)i);
p--;
}
return value;
}
unsigned oct_to_decimal(const char *str)
{
unsigned value, i, p;
/* Check if input is made of 0s(ASCII 48) and 1s (ASCII 49)
*/
for (i= 0; i < strlen(str); i++)
{
In: Computer Science
Answer at least one of the question above . Thanks
In: Computer Science