Using Python, use the following list (Temperature = [56.2,31.8,81.7,45.6,71.3,62.9,59.0,92.5,95.0,19.2,15.0]) to:
- Create a loop to iterate through each of the elements in the temperature list.
- Convert each element of this list to a Celsius temperature and then, for each valid temperature in the list, print out both the original Fahrenheit temperature and the Celsius equivalent in this format: "32 degrees Fahrenheit is equivalent with 0 degrees Celsius."
In: Computer Science
In C language,
Write a program called minishell that creates two child
processes:
one to execute 'ls -al' and the other to execute
‘grep minishell.c’.
After the forks, the original parent process waits for both
child processes to finish before it terminates. The parent should
print out the pid of each child after it finishes. The standard
output of 'ls -al' process should be piped to the input to the
'grep minishell.c' process. Make sure you close the unnecessary
open files for the three processes. The output should be the one
line that includes the directory entry for minishell.c. You will
need to call the source file minishell.c for this to work
properly.
Please comment thoroughly so i can follow the logic.
In: Computer Science
C++
Part 1: Developing And Testing A Stack Template
Write a template, Stack.h, to implement a LIFO stack. Here is the specification for its public interface:
class Stack { ... Stack( ); // may have a defaulted parameter Stack(const Stack<V>&); // copy constructor ~Stack(); Stack<V>& operator=(const Stack<V>&); void push(const V&); const V& peek( ); void pop( ); int size( ) const; bool empty( ) const; void clear( ); };
If you use dynamic memory (and you surely will!) be sure to include the three memory management functions as public members, too. You may implement your Stack as arrayed or as linked -- your choice.
Fully test your template in a test driver CPP named Stack.TestDriver.cpp, remembering to include all the tests we've learned about in this class. Then use the H file in the following application:
In: Computer Science
A college must track equipment items purchased using special funds.
Create an Inventory class that represents an equipment item. An equipment item consists of an 8-alphanumeric inventory number, a short description of the item, the purchase price of the item, and its current location (e.g.: room/building location). If an item is surplussed (e.g., gotten rid of), then the current location should say surplus, but the item should remain on the list.
Write a program that reads inventory items from a file into a
vector. Implement a menu system that allows the user to add, edit,
and delete records from the list as well as search the list based
on inventory number and print a report of all records.
The list should always be maintained in order of inventory number.
When the program closes, the data file should be overwritten with
the most recent data from the list.
Implement one of the sorting and searching algorithms from the chapter. Do not use the built-in sort function.
Be sure to use the same menu options as shown in the example so the auto-grader can accurately grade your assignment.
Sample
MAIN MENU 1 - Add 2 - Edit 3 - Delete 4 - Search 5 - Print All 6 - Exit Choice: 2 Enter inventory number to edit: 12-2322-12 Curent Values 12-2322-12 Printer 800.00 PW-590 EDIT MENU 1 - Inventory Number 2 - Description 3 - Price 4 - Location 5 - Done Choice: 3 Enter new price: 820.00 EDIT MENU 1 - Inventory Number 2 - Description 3 - Price 4 - Location 5 - Done Choice: 1 Enter new Inventory Number: 12-AB-3333 Invalid inventory number. EDIT MENU 1 - Inventory Number 2 - Description 3 - Price 4 - Location 5 - Done Choice: 5 MAIN MENU 1 - Add 2 - Edit 3 - Delete 4 - Search 5 - Print All 6 - Exit Choice: 5 12-1194-94 Switch 417.00 TR-123 12-1232-35 Monitor 300.00 Surplus 12-1384-91 MicroPlus 1200.00 Surplus 12-2322-12 Printer 820.00 PW-590 12-3245-21 Test 120.00 Surplus 14-4343-41 Cabinet 175.00 AW-212 14-4992-22 Bookshelf 375.00 BN-100 14-8383-12 Chair 70.00 BN-100 14-9842-85 Desk 283.00 BN-100 14-9923-95 Typewriter 120.00 Surplus MAIN MENU 1 - Add 2 - Edit 3 - Delete 4 - Search 5 - Print All 6 - Exit Choice: 6
Need the answer in C++ and always need a .cpp file, .h file, and driver file
In: Computer Science
The purpose of this lab: Wireshark Intro Lab
is to get students familiar with the use of their VMs and running wireshark on their VMs. We also examine Ethernet, IPv4, and TCP addressing at the Network Access, Network, and Transport layers of the TCP/IP stack.
Reflection:
In two paragraphs reflect the experience of using Wireshark capture (in the lab) on the following questions: What was the most valuable feature of the lab? How did you prepare for this lab? What changes are you considering in preparing for your next lab? What did you learn from this experience? What advice would you give someone who was preparing for this lab for the first time? This should be well-written paragraphs that discusses items like those listed above.
In: Computer Science
Write a Java PATRON class with fields that reflect the structure of your patrons table.
Write a java FACTORY class with these two methods:
Note: The factory class is the only class in your project that should allow JDBC code
Write any other classes you need to produce a java application that allows you to retrieve a patron into a Graphical user interface, change something about that patron (except for the patronID which should be read only), and save the patron back to the database using your update method. After an update please let the user know if the update was successful or not.
EDIT: Patrons Table SQL
Create table Patrons (
PatronID int not null constraint PatronID_PK primary key,
FirstName varchar(255),
LastName varchar(255),
Address varchar(255),
City varchar(255),
State varchar(255),
Zip int,
Phone varchar(20),
Email varchar(255) constraint Email_UK unique,
CardType varchar(30),
Constraint CHK_CC check (CardType in('MasterCard', 'Discover',
'Visa', 'Amex')),
CardNumber varchar(20),
BirthDate date);
In: Computer Science
For PACMAN game specification
2.1 Product Perspective
2.2 Product Functions
2.3 User Classes and Characteristics
2.4 Operating Environment
2.5 Design and Implementation Constraints
2.6 Assumptions and Dependencies
In: Computer Science
AES has a larger block and key length compared to DES. If we ever had to do multiple encryptions with AES because we had computers fast enough to brute force a 128-bit key, would we need to move to Two-AES or Triple-AES?
In: Computer Science
C++ questions, Please make sure to divide your program into functions which perform each major task.
The game of rock paper scissors is a two player game in which each each player picks one of the three selections: rock, paper and scissors. The game is decided using the following logic:
ROCK defeats SCISSORS (“smashes”)
PAPER defeats ROCK (“wraps”)
SCISSORS defeats PAPER (“slices”)
If both players choose the same selection the game ends in a tie. Write a program that asks the user to select one of the three choices. The computer will randomly choose one of the three options as well. Your program will then display both players' selections as well as the who won the game.
In: Computer Science
Description: The purpose of the program is to create a Java ticket purchasing program that allows for users to log in, purchase tickets, keep records of tickets purchased, and keep information about the user.
Program Requirements: The following are the program requirements:
Deliverables: All program code and documentation including a user guide.
In: Computer Science
The following table shows data on the average number of
customers processed by several bank service units each day. The
hourly wage rate is $15, the overhead rate is 1.2 times labor cost,
and material cost is $4 per customer.
Unit | Employees | Customers Processed / Day |
A | 5 | 38 |
B | 6 | 46 |
C | 7 | 61 |
D | 3 | 33 |
a. Compute the labor productivity and the multifactor productivity
for each unit. Use an eight-hour day for multifactor
productivity.(Round your "Labor Productivity" answers to 1 decimal
place and "Multifactor Productivity" answers to 3 decimal
places.)
Unit | Labor Productivity (customers per day per worker) |
Multifactor Productivity (customers per dollar input) |
A | ||
B | ||
C | ||
D | ||
b. Suppose a new, more standardized procedure is to be introduced
that will enable each employee to process one additional customer
per day. Compute the expected labor and multifactor productivity
rates for each unit. (Round your "Labor Productivity" answers to 1
decimal place and "Multifactor Productivity" answers to 3 decimal
places.)
Unit | Labor Productivity (customers per day per worker) |
Multifactor Productivity (customers per dollar input) |
||
A | ||||
B | ||||
C | ||||
D | ||||
In: Computer Science
PLEASE put your answer in a table
What are the usages of the following API's/ Macros in contiki ?
In: Computer Science
Mr. Smith is thinking about opening a bicycle shop in his hometown. He loves to take his own bike on 50-mile trips with his friends, but he believes that any small business should be started only if there is a good chance of making a profit. Jerry can open a small shop, a large shop, or no shop at all.
Mr. Smith has done some analysis about the profitability of the bicycle shop. If Jerry builds the large bicycle shop, he will earn $60,000 if the market is favorable, but he will lose $40,000 if the market is unfavorable. The small shop will return a $30,000 profit in a favorable market and a $10,000 loss in an unfavorable market. The chance of Favorable market and unfavorable market is 50-50.
His old marketing professor will charge him $5,000 for the marketing study. It is estimated that there is a 50% probability that the survey will be favorable and 50% unfavorable study.
Furthermore, he has given the following probabilities:
Probability that the market will be favorable given a favorable outcome from the study 90%
Probability that the market will be unfavorable given a favorable outcome from the study 10%
Probability that the market will be favorable given an unfavorable outcome from the study 12%
Probability that the market will be unfavorable given an unfavorable outcome from the study 88%
In: Computer Science
Complete the redblacktree in Java.
Make every Node object have a false isBlack field, all new node is red by default.
In the end of the insert method, set the root node of your red black tree to be black.
Implement the rotate() and recolor() functions, and create tests for them in a separate class.
Tests, start with this tree in level order 44 (black) 25 (red) 72 (black), this is invalid tree. Make it valid after inserting 17.
import java.util.LinkedList;
public class BinarySearchTree<T extends Comparable<T>> {
protected static class Node<T> {
public T data;
public Node<T> parent; // null for root node
public Node<T> leftChild;
public Node<T> rightChild;
public boolean isBlack;
public Node(T data) {
this.data = data;
}
public boolean isLeftChild() {
return parent != null && parent.leftChild == this;
}
@Override
public String toString() { // display subtree in order
traversal
String output = "[";
LinkedList<Node<T>> q = new LinkedList<>();
q.add(this);
while (!q.isEmpty()) {
Node<T> next = q.removeFirst();
if (next.leftChild != null)
q.add(next.leftChild);
if (next.rightChild != null)
q.add(next.rightChild);
output += next.data.toString();
if (!q.isEmpty())
output += ", ";
}
return output + "]";
}
}
protected Node<T> root; // reference to root node of tree, null when empty
public void insert(T data) throws NullPointerException,
IllegalArgumentException {
// null references cannot be stored within this tree
if (data == null)
throw new NullPointerException("This RedBlackTree cannot store null
references.");
Node<T> newNode = new Node<>(data);
if (root == null) {
root = newNode;
} // add first node to an empty tree
else
insertHelper(newNode, root); // recursively insert into
subtree
}
private void insertHelper(Node<T> newNode, Node<T>
subtree) {
int compare = newNode.data.compareTo(subtree.data);
// do not allow duplicate values to be stored within this
tree
if (compare == 0)
throw new IllegalArgumentException("This RedBlackTree already
contains that value.");
// store newNode within left subtree of subtree
else if (compare < 0) {
if (subtree.leftChild == null) { // left subtree empty, add
here
subtree.leftChild = newNode;
newNode.parent = subtree;
// otherwise continue recursive search for location to insert
} else
insertHelper(newNode, subtree.leftChild);
}
// store newNode within the right subtree of subtree
else {
if (subtree.rightChild == null) { // right subtree empty, add
here
subtree.rightChild = newNode;
newNode.parent = subtree;
// otherwise continue recursive search for location to insert
} else
insertHelper(newNode, subtree.rightChild);
}
}
@Override
public String toString() {
return root.toString();
}
/**
* Performs the rotation operation on the provided nodes within this
BST. When the provided child
* is a leftChild of the provided parent, this method will perform a
right rotation (sometimes
* called a left-right rotation). When the provided child is a
rightChild of the provided parent,
* this method will perform a left rotation (sometimes called a
right-left rotation). When the
* provided nodes are not related in one of these ways, this method
will throw an
* IllegalArgumentException.
*/
private void rotate(Node<T> child, Node<T> parent)
throws IllegalArgumentException {
// TODO: Implement this method.
}
/**
* recolor() takes a reference to a newly added red node as its only
parameter. This method may
* also be called recursively, in which case the input parameter may
reference a different red
* node in the tree that potentially has a red parent node. The job
of this method is to resolve
* red child under red parent red black tree property violations
that are introduced by inserting
* new nodes into a red black tree. All other red black tree
properties must also be preserved.
* The method should be called from insertHelper after adding a new
red node to the tree (in both
* the cases of adding this new node as a left child and as a right
child). No further changes to
* the insertHelper method should be made.
*/
private void recolor(Node<T> newNode) {
// TODO: Implement this method.
}
}
In: Computer Science