Mr. Kent doesn't care about almost anything ... but himself and his money. So, when his power plant leaked radioactive goo that caused several species of wildlife to go extinct, he was only concerned with the public perception as it might affect his income and possible jail time.
Many rumors surfaced around the Springfield Nuclear Power Plant. One of them is high concern over the mutation rate of the rare Springfield molted platypus. With barely more than 500 left in the wild, the word "extinction" has been tossed around. So, to quell the media, Mr. Kent had 30 of them captured, dissected, and analyzed to check for signs of mutation. He found that the mutation rate is 2% each month, but when they do mutate, they become sterile and cannot reproduce. With this information, he wants to create one of those newfangled computer simulations that the press loves so much. That's where you come in!
Specifications:
In this assignment, you will create a class called Animal_Category.
Your Animal_Category class is to contain the following data members:
Your Animal_Category class is to contain the following member functions:
You will also create a class called Platypus. Below, we will describe what will define a platypus. You will also create a main function in which you will create objects of type platypus to test the functionality of your new user-defined type.
Your Platypus class is to contain the following data members:
Member functions:
Further, the platypus has a chance of becoming dead each time it ages. This chance is ten times the platypus' weight. A 5 pound platypus has a 50% chance of death. A 10 pound platypus (or heavier) has a 100% chance of death. Again here update the value of the corresponding data member when needed.
Think very carefully about writing the above functions and how they should be used. There are indeed circumstances when some functions should not execute. For example, a dead platypus shouldn't eat anything.
Your program should fully test your platypus class. It must call every member function in the platypus class. It must print to the screen what it is doing and show the changes that appear when the member functions are called. The fight function will require two platypuses: one to call the fight function and one to be a parameter in the fight function.
c++ language
In: Computer Science
JAVA PROGRAMMING
For this assignment, review the successor method in BST. The successor of a node is the node with the next highest value in the tree. The successor of the node with the largest value in a tree, is null.
The algorithm to find the successor of a node is straight forward: if the node has a right subtree, the successor is the smallest node in that subtree (for that we use method minNode). Otherwise, we traverse the tree from the root and towards the node whose successor we are seeking. Each node at which we continue to traverse left, we mark as the successor. The last such node is the actual successor.
TreeNode with parent node
Modify BST so that each TreeNode has a pointer to its parent node. (The only node without a parent is the root node). Ensure that every time you add a node to a tree, that all points (left, right, and parent) are updated as needed.
Successor search using the parent node
Write a new method, with signature
TreeNode successorP(TreeNode ofThisNode) that finds the successor of a node without traversing the tree from the root, but by using the knowledge captured in the parent field. There are many variants of this technique online. Many of them are incomplete or may contain bugs. Make sure that your code works perfectly well with each node in the test tree sycamore. Your code must be well documented with meaningful comments.
Delete a node
Write a method with signature
boolean deleteNode(TreeNode deleteMe)
that implements the deletion algorithm as discussed in class. The
deletion algorithm is as follows:
If node-to-delete has zero children, just dereference it from its parent.
If node-to-delete has one child only, its child is "adopted" by its parent.
If the node-to-delete has two children, swap it with its successor, reducing the case to one of the previous two.
For this problem, use the parent field in TreeNode.
import java.util.ArrayList;
import java.util.List;
/**
* A simple Binary Search Tree (BST) class.
*/
public class BST {
// A tree is just a root, really! Everything grows from here.
private TreeNode root; // what's a TreeNode? See below.
// And here's what a TreeNode looks like.
class TreeNode {
String value; // The data we store in this node
TreeNode left; // left child
TreeNode right; // right child
// basic constructor
public TreeNode(String s) {
this.value = s; // assigns content to String
left = right = null; // makes pointers to children null
} // constructor TreeNode
} // class TreeNode
/**
* Inserts unique value into tree; if value already
* exists, method returns false.
*
* @param s value to insert
*/
public boolean insert(String s) {
boolean success = false;
if (!valueExists(s)) { // Value is not stored in tree already; we can add it
success = true; // Method will return this value to indicate successful insertion
TreeNode newNode = new TreeNode(s); // Node with new value to be inserted
if (root == null) { // If tree is empty,
root = newNode; // new node becomes its root.
} else { // Start our search from the root to find where to place new node.
TreeNode currentNode = root; // We start our search from the root.
boolean keepTrying = true; // Control variable from the principal loop, below.
while (keepTrying) { // Principal loop; exits only when keepTrying becomes false.
if (s.compareTo(currentNode.value) > 0) { // New value is greater than current node; go RIGHT
if (currentNode.right == null) { // If right child is null
currentNode.right = newNode; // place new value here
keepTrying = false; // Flag to exit the principal loop.
} else { // Right child is not null
currentNode = currentNode.right; // Make right child the current node and try again.
}
} else { // New value is less than current node; go LEFT
if (currentNode.left == null) { // If left child is null
currentNode.left = newNode; // place new value here.
keepTrying = false; // Flag to exit the principal loop.
} else { // Left child is not null.
currentNode = currentNode.left; // Make left child the current node and try again.
}
}
}
}
}
return success;
} // method insert
/**
* Find if String searchForMe exists in the tree, in an iterative scan
*
* @param searchForMe Value to search for
* @return true if searchForMe found; false otherwise
*/
public boolean valueExists(String searchForMe) {
boolean success = false; // Assume String is not in the tree.
if (root != null) { // Start searching from the top.
TreeNode currentNode = root; // initialize iterative node
boolean keepTrying = true; // Loop control flag
while (keepTrying) {
if (currentNode.value.compareTo(searchForMe) == 0) { // found!
success = true; // flag success
keepTrying = false; // get out of the while loop
} else if (searchForMe.compareTo(currentNode.value) > 0) { // Go right
if (currentNode.right == null) { // end of tree; no luck
keepTrying = false; // exit while loop
} else { // keep pushing right
currentNode = currentNode.right; // new value for next iteration
}
} else { // Go left
if (currentNode.left == null) { // end of tree; no luck
keepTrying = false; // exit while loop
} else { // keep pushing left
currentNode = currentNode.left; // new value for next iteration
}
}
}
}
return success;
} // method valueExists
/**
* Iterative in-Order traversal of the tree
*/
public void inOrder() {
if (root == null) { // empty tree
System.out.println("Tree is empty");
} else {
System.out.println("\n\nIn-Order traversal of your tree:\n");
int wordCount = 1; // tracks how many words are printed before new line
int wordPerLine = 5; // I want this may words per line
List nodesToProcess = new ArrayList(); // Simple "stack"
// Start from the top
TreeNode currentNode = root;
// The following loop traverses while there are items in the "stack"
while ( currentNode != null || nodesToProcess.size() > 0 ) {
while (currentNode != null) {
nodesToProcess.add(0,currentNode);
currentNode = currentNode.left; // Go as left as you can
}
currentNode = nodesToProcess.get(0); // When no more left, print what's on top of the stack
System.out.printf("%-15s ",currentNode.value);
if ( wordCount%wordPerLine==0 ) {
System.out.printf("\n");
}
wordCount++;
nodesToProcess.remove(0); // remove the current node from the stack
currentNode = currentNode.right; // go right
}
}
} // method inOrder
/**
* Method to find the smallest node of a tree (or subtree). The smallest node is the
* left-most node of the tree (or subtree).
* @param node the root of the tree or subtree we wish to scan
* @return the node with the smallest value
*/
public TreeNode minNode(TreeNode node) {
TreeNode current = node;
while ( current.left != null) { // Keep going left until no more
current = current.left;
}
return current; // this is the smallest node
} // method minNode
/**
* Method successor finds, iteratively, the node with the next highest value from the
* node provided. If the node whose successor we seek has a right subtree, the successor
* is the smallest node of that subtree. Otherwise, we start from the root, towards
* the node whose successor we seek. Every time we go left at a node, we mark that
* node as the successor.
* @param ofThisNode Node whose successor we are seeking.
* @return The node's successor; null if it has no successor
*/
public TreeNode successor(TreeNode ofThisNode) {
TreeNode succ = null;
if ( ofThisNode.right != null) { // Node whose successor we seek, has a right subtree.
succ = minNode(ofThisNode.right); // Successor is smallest node of right subtree.
} else { //
TreeNode current = root; // Start from root and go towards node whose successor we seek.
boolean keepTraversing = true; // Switch to exit the while loop when done
while (keepTraversing) {
if ( ofThisNode.value.compareTo(current.value ) < 0 ) { // Node whose successor we seek should be to the left.
if ( current.left != null ) { // Can we go left?
succ = current; // Mark this node as successor
current = current.left; // Go left
} else { // We can no longer go left -- end of tree?
keepTraversing = false; // Signal to exit the while loop.
}
} else { // Node whose successor we seek should be to the right.
if ( current.right != null ) { // Can we go right?
current = current.right; // Go right
} else { // We can no longer go right -- end of tree?
keepTraversing = false; // Signal to exit while loop.
}
} // Done deciding left/right as we search for the node whose successor we seek.
} // Done traversing the tree
} // Done looking for the successor; we have it (or we end up with null, ie, end of tree).
return succ;
} // method successor
/** Quick testing */
public static void main (String[]args){
// Instantiate a binary search tree.
BST sycamore = new BST();
// Favorite soliloquy to be used as content for the tree
String text = "Now is the winter of our discontent " +
"Made glorious summer by this sun of York; " +
"And all the clouds that lour'd upon our house " +
"In the deep bosom of the ocean buried.";
// Split soliloquy into separate words (converting to lower case for uniformity).
String[] words = text.toLowerCase().replaceAll("[^a-zA-Z ]", "").split(" ");
// Add to tree.
for (String word : words) {
sycamore.insert(word);
}
// Print the tree using the in-Order traversal
sycamore.inOrder();
} // method main
} // class BSTIn: Computer Science
JAVA PROGRAMMING
For this assignment, review the successor method in BST. The successor of a node is the node with the next highest value in the tree. The successor of the node with the largest value in a tree, is null. The algorithm to find the successor of a node is straight forward: if the node has a right subtree, the successor is the smallest node in that subtree (for that we use method minNode). Otherwise, we traverse the tree from the root and towards the node whose successor we are seeking. Each node at which we continue to traverse left, we mark as the successor. The last such node is the actual successor.
TreeNode with parent node
Modify BST so that each TreeNode has a pointer to its parent node. (The only node without a parent is the root node). Ensure that every time you add a node to a tree, that all points (left, right, and parent) are updated as needed.
Successor search using the parent node
Write a new method, with signature
TreeNode successorP(TreeNode ofThisNode) that finds the successor of a node without traversing the tree from the root, but by using the knowledge captured in the parent field. There are many variants of this technique online. Many of them are incomplete or may contain bugs. Make sure that your code works perfectly well with each node in the test tree sycamore. Your code must be welldocumented with meaningful comments.
Delete a node
Write a method with signature
boolean deleteNode(TreeNode deleteMe)
that implements the deletion algorithm as discussed in class. The
deletion algorithm is as follows:
If node-to-delete has zero children, just dereference it from its parent.
If node-to-delete has one child only, its child is "adopted" by its parent.
If the node-to-delete has two children, swap it with its successor, reducing the case to one of the previous two.
For this problem, use the parent field in TreeNode.
import java.util.ArrayList;
import java.util.List;
/**
* A simple Binary Search Tree (BST) class.
*/
public class BST {
// A tree is just a root, really! Everything grows from
here.
private TreeNode root; // what's a TreeNode? See below.
// And here's what a TreeNode looks like.
class TreeNode {
String value; // The data we store in this node
TreeNode left; // left child
TreeNode right; // right child
// basic constructor
public TreeNode(String s) {
this.value = s; // assigns content to String
left = right = null; // makes pointers to children null
} // constructor TreeNode
} // class TreeNode
/**
* Inserts unique value into tree; if value already
* exists, method returns false.
*
* @param s value to insert
*/
public boolean insert(String s) {
boolean success = false;
if (!valueExists(s)) { // Value is not stored in tree already; we
can add it
success = true; // Method will return this value to indicate
successful insertion
TreeNode newNode = new TreeNode(s); // Node with new value to be
inserted
if (root == null) { // If tree is empty,
root = newNode; // new node becomes its root.
} else { // Start our search from the root to find where to place
new node.
TreeNode currentNode = root; // We start our search from the
root.
boolean keepTrying = true; // Control variable from the principal
loop, below.
while (keepTrying) { // Principal loop; exits only when keepTrying
becomes false.
if (s.compareTo(currentNode.value) > 0) { // New value is
greater than current node; go RIGHT
if (currentNode.right == null) { // If right child is null
currentNode.right = newNode; // place new value here
keepTrying = false; // Flag to exit the principal loop.
} else { // Right child is not null
currentNode = currentNode.right; // Make right child the current
node and try again.
}
} else { // New value is less than current node; go LEFT
if (currentNode.left == null) { // If left child is null
currentNode.left = newNode; // place new value here.
keepTrying = false; // Flag to exit the principal loop.
} else { // Left child is not null.
currentNode = currentNode.left; // Make left child the current node
and try again.
}
}
}
}
}
return success;
} // method insert
/**
* Find if String searchForMe exists in the tree, in an iterative
scan
*
* @param searchForMe Value to search for
* @return true if searchForMe found; false otherwise
*/
public boolean valueExists(String searchForMe) {
boolean success = false; // Assume String is not in the tree.
if (root != null) { // Start searching from the top.
TreeNode currentNode = root; // initialize iterative node
boolean keepTrying = true; // Loop control flag
while (keepTrying) {
if (currentNode.value.compareTo(searchForMe) == 0) { //
found!
success = true; // flag success
keepTrying = false; // get out of the while loop
} else if (searchForMe.compareTo(currentNode.value) > 0) { // Go
right
if (currentNode.right == null) { // end of tree; no luck
keepTrying = false; // exit while loop
} else { // keep pushing right
currentNode = currentNode.right; // new value for next
iteration
}
} else { // Go left
if (currentNode.left == null) { // end of tree; no luck
keepTrying = false; // exit while loop
} else { // keep pushing left
currentNode = currentNode.left; // new value for next
iteration
}
}
}
}
return success;
} // method valueExists
/**
* Iterative in-Order traversal of the tree
*/
public void inOrder() {
if (root == null) { // empty tree
System.out.println("Tree is empty");
} else {
System.out.println("\n\nIn-Order traversal of your tree:\n");
int wordCount = 1; // tracks how many words are printed before new
line
int wordPerLine = 5; // I want this may words per line
List nodesToProcess = new ArrayList(); // Simple "stack"
// Start from the top
TreeNode currentNode = root;
// The following loop traverses while there are items in the
"stack"
while ( currentNode != null || nodesToProcess.size() > 0 )
{
while (currentNode != null) {
nodesToProcess.add(0,currentNode);
currentNode = currentNode.left; // Go as left as you can
}
currentNode = nodesToProcess.get(0); // When no more left, print
what's on top of the stack
System.out.printf("%-15s ",currentNode.value);
if ( wordCount%wordPerLine==0 ) {
System.out.printf("\n");
}
wordCount++;
nodesToProcess.remove(0); // remove the current node from the
stack
currentNode = currentNode.right; // go right
}
}
} // method inOrder
/**
* Method to find the smallest node of a tree (or subtree). The
smallest node is the
* left-most node of the tree (or subtree).
* @param node the root of the tree or subtree we wish to scan
* @return the node with the smallest value
*/
public TreeNode minNode(TreeNode node) {
TreeNode current = node;
while ( current.left != null) { // Keep going left until no
more
current = current.left;
}
return current; // this is the smallest node
} // method minNode
/**
* Method successor finds, iteratively, the node with the next
highest value from the
* node provided. If the node whose successor we seek has a right
subtree, the successor
* is the smallest node of that subtree. Otherwise, we start from
the root, towards
* the node whose successor we seek. Every time we go left at a
node, we mark that
* node as the successor.
* @param ofThisNode Node whose successor we are seeking.
* @return The node's successor; null if it has no successor
*/
public TreeNode successor(TreeNode ofThisNode) {
TreeNode succ = null;
if ( ofThisNode.right != null) { // Node whose successor we seek,
has a right subtree.
succ = minNode(ofThisNode.right); // Successor is smallest node of
right subtree.
} else { //
TreeNode current = root; // Start from root and go towards node
whose successor we seek.
boolean keepTraversing = true; // Switch to exit the while loop
when done
while (keepTraversing) {
if ( ofThisNode.value.compareTo(current.value ) < 0 ) { // Node
whose successor we seek should be to the left.
if ( current.left != null ) { // Can we go left?
succ = current; // Mark this node as successor
current = current.left; // Go left
} else { // We can no longer go left -- end of tree?
keepTraversing = false; // Signal to exit the while loop.
}
} else { // Node whose successor we seek should be to the
right.
if ( current.right != null ) { // Can we go right?
current = current.right; // Go right
} else { // We can no longer go right -- end of tree?
keepTraversing = false; // Signal to exit while loop.
}
} // Done deciding left/right as we search for the node whose
successor we seek.
} // Done traversing the tree
} // Done looking for the successor; we have it (or we end up with
null, ie, end of tree).
return succ;
} // method successor
/** Quick testing */
public static void main (String[]args){
// Instantiate a binary search tree.
BST sycamore = new BST();
// Favorite soliloquy to be used as content for the tree
String text = "Now is the winter of our discontent " +
"Made glorious summer by this sun of York; " +
"And all the clouds that lour'd upon our house " +
"In the deep bosom of the ocean buried.";
// Split soliloquy into separate words (converting to lower case
for uniformity).
String[] words = text.toLowerCase().replaceAll("[^a-zA-Z ]",
"").split(" ");
// Add to tree.
for (String word : words) {
sycamore.insert(word);
}
// Print the tree using the in-Order traversal
sycamore.inOrder();
} // method main
} // class BST
In: Computer Science
Reduce the following "top -b -n 1" output to its first, second, and last columns, and include only those processes belonging to "root". Use fscanf and strtok please. top - 05:00:58 up 543 days, 8:56, 1 user, load average: 0.11, 0.03, 0.01 Tasks: 112 total, 1 running, 111 sleeping, 0 stopped, 0 zombie %Cpu(s): 0.1 us, 0.1 sy, 0.0 ni, 99.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem : 499976 total, 41456 free, 51636 used, 406884 buff/cache KiB Swap: 0 total, 0 free, 0 used. 392008 avail Mem 1 root 20 0 185324 4988 3032 S 0.0 1.0 7:08.14 systemd 2 root 20 0 0 0 0 S 0.0 0.0 0:00.06 kthreadd 3 root 20 0 0 0 0 S 0.0 0.0 3:19.04 ksoftirqd/0 5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H 7 root 20 0 0 0 0 S 0.0 0.0 7:29.74 rcu_sched 8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh 9 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0 10 root rt 0 0 0 0 S 0.0 0.0 4:36.48 watchdog/0 11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs 12 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 netns 13 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 perf 14 root 20 0 0 0 0 S 0.0 0.0 0:13.48 khungtaskd 15 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 writeback 16 root 25 5 0 0 0 S 0.0 0.0 0:00.00 ksmd 17 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 crypto 18 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kintegrityd 19 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 20 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kblockd 21 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ata_sff 22 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 md 23 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 devfreq_wq 27 root 20 0 0 0 0 S 0.0 0.0 22:01.55 kswapd0 28 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 vmstat 29 root 20 0 0 0 0 S 0.0 0.0 0:00.00 fsnotify_ma+ 30 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ecryptfs-kt+ 46 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kthrotld 47 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 acpi_therma+ 48 root 20 0 0 0 0 S 0.0 0.0 0:00.00 vballoon 49 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 50 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 51 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 52 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 53 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 54 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 55 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 56 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 57 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 58 root 20 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0 59 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 scsi_tmf_0 60 root 20 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_1 61 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 scsi_tmf_1 67 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ipv6_addrco+ 80 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 deferwq 81 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 charger_man+ 128 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 129 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 130 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 131 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 132 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 133 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 134 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 135 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 137 root 20 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_2 138 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 scsi_tmf_2 145 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kpsmoused 496 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 raid5wq 526 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset 551 root 20 0 0 0 0 S 0.0 0.0 4:41.75 jbd2/vda1-8 552 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ext4-rsv-co+ 614 root 20 0 27708 2248 1924 S 0.0 0.4 48:36.07 systemd-jou+ 621 root 0 -20 0 0 0 S 0.0 0.0 0:36.37 kworker/0:1H 632 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 iscsi_eh 648 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ib_addr 651 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ib_mcast 652 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ib_nl_sa_wq 653 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kauditd 654 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ib_cm 657 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 iw_cm_wq 660 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 rdma_cm 689 root 20 0 102968 228 0 S 0.0 0.0 0:00.00 lvmetad 796 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kvm-irqfd-c+ 1427 root 20 0 5220 116 0 S 0.0 0.0 25:47.02 iscsid 1428 root 10 -10 5720 3524 2436 S 0.0 0.7 123:01.13 iscsid 1449 message+ 20 0 42972 2008 1392 S 0.0 0.4 0:10.67 dbus-daemon 1455 syslog 20 0 256392 1564 0 S 0.0 0.3 13:44.06 rsyslogd 1459 root 20 0 28728 2752 2248 S 0.0 0.6 0:37.68 systemd-log+ 1462 root 20 0 653228 3996 1192 S 0.0 0.8 4:47.32 lxcfs 1469 root 20 0 4396 1156 1072 S 0.0 0.2 0:00.00 acpid 1471 root 20 0 274488 1016 212 S 0.0 0.2 27:45.06 accounts-da+ 1483 root 20 0 27728 2176 1896 S 0.0 0.4 1:34.16 cron 1490 daemon 20 0 26044 1724 1520 S 0.0 0.3 0:00.84 atd 1520 root 20 0 13372 192 52 S 0.0 0.0 0:04.41 mdadm 1594 root 20 0 14472 1588 1452 S 0.0 0.3 0:00.00 agetty 5845 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0 5906 root 20 0 92832 6816 5884 S 0.0 1.4 0:00.04 sshd 5942 root 20 0 21428 5372 3368 S 0.0 1.1 0:00.06 bash 5958 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kworker/u2:1 6134 root 20 0 65512 5844 5140 S 0.0 1.2 0:00.00 sshd 6135 sshd 20 0 65512 3200 2484 S 0.0 0.6 0:00.00 sshd 6141 root 20 0 65512 5784 5072 S 0.0 1.2 0:00.00 sshd 6142 sshd 20 0 65512 3208 2484 S 0.0 0.6 0:00.00 sshd 6147 root 20 0 40388 3492 2988 R 0.0 0.7 0:00.00 top 6433 root 20 0 277088 764 0 S 0.0 0.2 0:00.56 polkitd 8836 systemd+ 20 0 100324 1552 1312 S 0.0 0.3 0:10.54 systemd-tim+ 9724 root 20 0 42364 2344 1808 S 0.0 0.5 0:08.68 systemd-ude+ 14463 postgres 20 0 293408 14644 12936 S 0.0 2.9 0:23.56 postgres 14465 postgres 20 0 293408 1704 0 S 0.0 0.3 0:00.67 postgres 14466 postgres 20 0 293408 3408 1704 S 0.0 0.7 0:22.84 postgres 14467 postgres 20 0 293408 2076 372 S 0.0 0.4 0:22.46 postgres 14468 postgres 20 0 293792 3324 1328 S 0.0 0.7 0:13.53 postgres 14469 postgres 20 0 148392 1876 116 S 0.0 0.4 0:13.18 postgres 17737 www-data 20 0 819836 4652 1880 S 0.0 0.9 0:36.39 apache2 17738 www-data 20 0 819844 4948 2008 S 0.0 1.0 0:36.33 apache2 18046 root 20 0 36840 2220 1460 S 0.0 0.4 0:00.00 systemd 18051 root 20 0 209056 2344 0 S 0.0 0.5 0:00.00 (sd-pam) 20779 root 20 0 0 0 0 S 0.0 0.0 0:01.12 kworker/u2:0 25939 root 20 0 71584 4064 2876 S 0.0 0.8 0:17.42 apache2 27861 root 20 0 0 0 0 S 0.0 0.0 0:01.00 kworker/0:1 32109 root 20 0 14656 1328 1192 S 0.0 0.3 0:00.02 agetty 32497 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfsalloc 32498 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs_mru_cac+ 32699 root 20 0 65512 2516 1804 S 0.0 0.5 5:54.88 sshd
A start of this problem:
#include
#include
#include
int main()
{
FILE *myfile = fopen("out.top.txt","r");
char a[500] = "this is about as big as this line will be";
// top - 11:45:12 up 7 min, 2 users, load average: 0.34, 1.01, 0.66
// 8729 root 20 0 0 0 0 S 0.0 0.0 0:00.03 kworker/u8+
while (fscanf(myfile,"%[^\n]\n",a)==1) {
// printf("line in is %s\n",a);
char *b1 = strtok(a," "); // printf("first word is %s\n",b1);
if (atoi(b1) > 0) {
// printf("first word is a number\n");
char *b2 = strtok(NULL,", "); // printf("second word is %s\n",b2);
if (!strcmp(b2,"root")) printf("%s owner is %s\n",b1,b2);
}
}
}In: Computer Science
In: Nursing
Can you read this and make it sound better
1. After reading the case study, I did not realize how vital
walkthroughs are for the benefit of the facility. The feedback that
this hospital got from this simple walkthrough was astounding. For
example, the hospital was not keeping the bathrooms clean and that
by this action it does affect what the patient thinks of the
hospital. Also not being able to give directions to family members
should have never had happened. The doctor even said that's how he
was treated at his ED was going to make him need care. The values
of walkthroughs can completely change the hospital to make it a
better place for the patient care and quality of the overall
hospital. The significance of this walkthrough did greatly improve
the hospital's level of quality care. The first thing the hospital
walkthrough made him realize was the "patient" aka the doctor had
never walk through the patient's entrance of the hospital. As a
patient, he called the hospital for example and was told that he
was having an acute asthma attack in the Operation Center and was
put on hold for several minutes then transferred his call to ED.
The second thing the walkthrough found was that family members were
trying to get information on the phone from a doctor and tried to
get medical directions, but that the staff member was unable to
give them instructions so and they transferred him to another
person to get directions and the instructions given were incorrect
directions. The third thing the walkthrough provided to the
hospital was all of the signage for directions around the outside
of the hospital were covered by plants and shrubbery, so no one
knew which direction to go. Once arriving at the ED, it was chaos,
and very filthy. One account said it felt like they were going to
the county jail. The one point that stood out to me is that a
family member went into the bathroom and it was so dirty, and they
thought how could they care for my family if they can't even keep
the restrooms clean. I believe this is one of the most important
parts of the walkthrough because after all, they've been through
already if they can't even have a clean bathroom what does this to
say about the doctor's level of care in the hospital. Are they
following proper procedures to disinfect and make sure everything
is clean? The final thing that they found after conducting their
walkthrough was that there were no hooks for their clothes to be
hung when they had to change into a patient's gown. They have to
throw their clothes onto the floor. The doctor even said that he
always thought they were neglected for just throwing the clothes on
the floor, but he didn't realize that there were no hooks or
hangers for the clothes to be stored properly. I believe if they
would make just these simple improvements like cleaning the
bathrooms, making sure the patients have hooks in their room,
giving proper directions to give family members follow up proper
care instructions their ED would improve rapidly, and patient level
of care would improve greatly. 2. The difference between patient
satisfactory and patient experience is how the values are
prioritized. Patient experience is going above and beyond to make
sure the patient is satisfied and is happy with the services that
the hospital has provided for them. Patient satisfaction is more of
the outcome measure of how they were treated and is sometimes is a
process measure that is done. In some cases patient satisfaction
can be a negative outcome but still have a positive patient
experience. This means that the patient satisfaction can include
true and false positives. The one that is most meaningful to
patients is their patient experience. I believe patient experience
is more valuable because if the patient is not happy with their
experience, then the hospital did not go above and beyond to make
sure everything was taken care of for the patient. The patient in
turn isn't going to talk highly of the hospital, and the bottom
line is I am not going to be satisfied and happy. The largest and
widest marketing device I believe in healthcare is by word of
mouth. If the patient has a bad experience at the hospital, they're
going to talk about it to their family members and everyone else
who would listen to them complains. Same goes if the patient had a
great experience at a hospital if everything was amazing, and the
hospital went above and beyond to make sure all their needs were
met will are also going to tell people about their experiences, and
more people are more likely going to want to make a choice to come
to your hospital instead of going to somewhere else. If you just
focus on patient satisfaction you're only going to get the outcome
measure or process measure not what the patient is going to say to
other potential patients.
In: Nursing
In: Economics
Case Study:
The Healthy Food Exchange (HFX) is a type of e-business exchange that does business entirely on the Internet. The company acts as a clearing exchange for both buyers and sellers of organic food.
For a person to offer food item for sale, he/she must register with HealthyFood. The person must provide a current physical address and telephone number as well as a current e-mail address. The system will then maintain an open account for this person. Access to the system as a seller is through a secure, authenticated portal.
A seller can list food items on the system through a special Internet form. Information required includes all the pertinent information about the food, its category, its general condition, and the asking price. A seller may list as many food items as desired. The system maintains an item ID of all food items in the system so that buyers can use the search engine to search for food item. The search engine allows searches by category, name, location, condition or keyword.
People wanting to buy food items come to the site and search for the item they want. When they decide to buy, they must open an account with a credit card to pay for the item. The system maintains all this information on secure servers.
When a request to purchase is made, along with the payment, The HealthyFood sends an e-mail notice to the seller of the item that was chosen. It also marks the item as pending. The system maintains this as an open order until it receives notice that the item have been shipped and mark it as sold. After the seller receives notice that a listed item has been sold, he/she must notify the buyer via e-mail within 12 hours that the purchase is noted. Shipment of the order must be made within 12 hours after the seller sends the
ITAP2013 Software Engineering
notification e-mail. The seller sends a notification to both the buyer and HealthyFood when the shipment is made.
After receiving notice of shipment, HealtyFood maintains the order in a shipped status. At the end of each month, a check is mailed to each seller for the food item orders that have been in a shipped status for 7 days. The 7-day waiting period is to allow the buyer to notify HealthyFood if the shipment does not arrive for some reason, or if the food item is not in the same condition as advertised.
The buyers can, if they want, enter a service rating for the seller. The service rating is an indication of how well the seller is servicing food purchases. Some sellers are very active and use HealthyFood as a major outlet for selling food items. So, a service rating is an important indicator to potential buyers.
Tasks and Deliverables:
Answer all the following tasks in the form of a report:
1. You are working as a Software Engineer at VITSoft Pvt Ltd. company in Sydney. Your manager asked you to develop a software specification analysing feasibility, functional, and non-functional requirements for above case study. As the first task, you should develop the requirements specification for the proposed system. In your report you should clearly indicate the assumptions and any constraints. The specification should have the following sections. However, you could add other topics based on your assumptions.
1. Introduction
a. Purpose
b. Scope
a. Definitions, Acronyms
2. Constraints
3. Assumptions
4. Requirements
a. Functional Requirements
b. Non-functional Requirements
c. Others
5. Stake holders
6. Project Management
a. Time
b. Deliverables and Milestones
c. Quality
d. Risk
e. Cost
7. References
8. Appendices
ITAP2013 Software Engineering
2. Draw Use Case diagram and clearly indicate actors and use cases. You can use Ms Visio, Ms Word, or any online tool.
3. Select FOUR Use Cases and write Use Case scenarios with preconditions and post conditions.
4. Draw Class diagram for the above system. Clearly indicate classes, possible methods, and message calls.
5. Select FOUR functionalities and design User Interfaces. You could use some wireframe designing tools such as Balsamiq (use trial version) or Invision. Include your wireframes in the report.
6. Design at least FIVE test cases for each for the above scenarios.
7. Discuss the software techniques you will use to support configuration
management and the tools to manage change request by customer
Can anyone do the project management part.
In: Computer Science
Wal-Mart is the second largest retailer in the world. The data file (WalMart_revenue.xlsx) is included in the Excel data zip file in week one, and it holds monthly data on Wal-Mart’s revenue, along with several possibly related economic variables. Develop a linear regression model to predict Wal-Mart revenue, using CPI as the only (a) independent variable. (b) Develop a linear regression model to predict Wal-Mart revenue, using Personal Consumption as the only independent variable. (c) Develop a linear regression model to predict Wal-Mart revenue, using Retail Sales Index as the only independent variable. (d) Which of these three models is the best? Use R-square value, Significance F values and other appropriate criteria to explain your answer. Identify and remove the four cases corresponding to December revenue. (e) Develop a linear regression model to predict Wal-Mart revenue, using CPI as the only independent variable. (f) Develop a linear regression model to predict Wal-Mart revenue, using Personal Consumption as the only independent variable. (g) Develop a linear regression model to predict Wal-Mart revenue, using Retail Sales Index as the only independent variable. (h) Which of these three models is the best? Use R-square values and Significance F values to explain your answer. (i) Comparing the results of parts (d) and (h), which of these two models is better? Use R-square values, Significance F values and other appropriate criteria to explain your answer. Please use one Excel file to complete this problem, and use one sheet for one sub-problem. Use a Microsoft Word document to answer questions. Finally, upload the files to the submission link for grading.
|
Date |
Wal Mart Revenue |
CPI |
Personal Consumption |
Retail Sales Index |
December |
|
11/28/03 |
14.764 |
552.7 |
7868495 |
301337 |
0 |
|
12/30/03 |
23.106 |
552.1 |
7885264 |
357704 |
1 |
|
1/30/04 |
12.131 |
554.9 |
7977730 |
281463 |
0 |
|
2/27/04 |
13.628 |
557.9 |
8005878 |
282445 |
0 |
|
3/31/04 |
16.722 |
561.5 |
8070480 |
319107 |
0 |
|
4/29/04 |
13.98 |
563.2 |
8086579 |
315278 |
0 |
|
5/28/04 |
14.388 |
566.4 |
8196516 |
328499 |
0 |
|
6/30/04 |
18.111 |
568.2 |
8161271 |
321151 |
0 |
|
7/27/04 |
13.764 |
567.5 |
8235349 |
328025 |
0 |
|
8/27/04 |
14.296 |
567.6 |
8246121 |
326280 |
0 |
|
9/30/04 |
17.169 |
568.7 |
8313670 |
313444 |
0 |
|
10/29/04 |
13.915 |
571.9 |
8371605 |
319639 |
0 |
|
11/29/04 |
15.739 |
572.2 |
8410820 |
324067 |
0 |
|
12/31/04 |
26.177 |
570.1 |
8462026 |
386918 |
1 |
|
1/21/05 |
13.17 |
571.2 |
8469443 |
293027 |
0 |
|
2/24/05 |
15.139 |
574.5 |
8520687 |
294892 |
0 |
|
3/30/05 |
18.683 |
579 |
8568959 |
338969 |
0 |
|
4/29/05 |
14.829 |
582.9 |
8654352 |
335626 |
0 |
|
5/25/05 |
15.697 |
582.4 |
8644646 |
345400 |
0 |
|
6/28/05 |
20.23 |
582.6 |
8724753 |
351068 |
0 |
|
7/28/05 |
15.26 |
585.2 |
8833907 |
351887 |
0 |
|
8/26/05 |
15.709 |
588.2 |
8825450 |
355897 |
0 |
|
9/30/05 |
18.618 |
595.4 |
8882536 |
333652 |
0 |
|
10/31/05 |
15.397 |
596.7 |
8911627 |
336662 |
0 |
|
11/28/05 |
17.384 |
592 |
8916377 |
344441 |
0 |
|
12/30/05 |
27.92 |
589.4 |
8955472 |
406510 |
1 |
|
1/27/06 |
14.555 |
593.9 |
9034368 |
322222 |
0 |
|
2/23/06 |
18.684 |
595.2 |
9079246 |
318184 |
0 |
|
3/31/06 |
16.639 |
598.6 |
9123848 |
366989 |
0 |
|
4/28/06 |
20.17 |
603.5 |
9175181 |
357334 |
0 |
|
5/25/06 |
16.901 |
606.5 |
9238576 |
380085 |
0 |
|
6/30/06 |
21.47 |
607.8 |
9270505 |
373279 |
0 |
|
7/28/06 |
16.542 |
609.6 |
9338876 |
368611 |
0 |
|
8/29/06 |
16.98 |
610.9 |
9352650 |
382600 |
0 |
|
9/28/06 |
20.091 |
607.9 |
9348494 |
352686 |
0 |
|
10/20/06 |
16.583 |
604.6 |
9376027 |
354740 |
0 |
|
11/24/06 |
18.761 |
603.6 |
9410758 |
363468 |
0 |
|
12/29/06 |
28.795 |
604.5 |
9478531 |
424946 |
1 |
|
1/26/07 |
20.473 |
606.348 |
9540335 |
332797 |
0 |
In: Statistics and Probability
Can you read this and make it sound better
1. After reading the case study, I did not realize how vital
walkthroughs are for the benefit of the facility. The feedback that
this hospital got from this simple walkthrough was astounding. For
example, the hospital was not keeping the bathrooms clean and that
by this action it does affect what the patient thinks of the
hospital. Also not being able to give directions to family members
should have never had happened. The doctor even said that's how he
was treated at his ED was going to make him need care. The values
of walkthroughs can completely change the hospital to make it a
better place for the patient care and quality of the overall
hospital. The significance of this walkthrough did greatly improve
the hospital's level of quality care. The first thing the hospital
walkthrough made him realize was the "patient" aka the doctor had
never walk through the patient's entrance of the hospital. As a
patient, he called the hospital for example and was told that he
was having an acute asthma attack in the Operation Center and was
put on hold for several minutes then transferred his call to ED.
The second thing the walkthrough found was that family members were
trying to get information on the phone from a doctor and tried to
get medical directions, but that the staff member was unable to
give them instructions so and they transferred him to another
person to get directions and the instructions given were incorrect
directions. The third thing the walkthrough provided to the
hospital was all of the signage for directions around the outside
of the hospital were covered by plants and shrubbery, so no one
knew which direction to go. Once arriving at the ED, it was chaos,
and very filthy. One account said it felt like they were going to
the county jail. The one point that stood out to me is that a
family member went into the bathroom and it was so dirty, and they
thought how could they care for my family if they can't even keep
the restrooms clean. I believe this is one of the most important
parts of the walkthrough because after all, they've been through
already if they can't even have a clean bathroom what does this to
say about the doctor's level of care in the hospital. Are they
following proper procedures to disinfect and make sure everything
is clean? The final thing that they found after conducting their
walkthrough was that there were no hooks for their clothes to be
hung when they had to change into a patient's gown. They have to
throw their clothes onto the floor. The doctor even said that he
always thought they were neglected for just throwing the clothes on
the floor, but he didn't realize that there were no hooks or
hangers for the clothes to be stored properly. I believe if they
would make just these simple improvements like cleaning the
bathrooms, making sure the patients have hooks in their room,
giving proper directions to give family members follow up proper
care instructions their ED would improve rapidly, and patient level
of care would improve greatly.
2. The difference between patient satisfactory and patient experience is how the values are prioritized. Patient experience is going above and beyond to make sure the patient is satisfied and is happy with the services that the hospital has provided
for them. Patient satisfaction is more of the outcome measure of how they were treated and is sometimes is a process measure that is done. In some cases patient satisfaction can be a negative outcome but still have a positive patient experience. This means that the patient satisfaction can include true and false positives. The one that is most meaningful to patients is their patient experience. I believe patient experience is more valuable because if the patient is not happy with their experience, then the hospital did not go above and beyond to make sure everything was taken care of for the patient. The patient in turn isn't going to talk highly of the hospital, and the bottom line is I am not going to be satisfied and happy. The largest and widest marketing device I believe in healthcare is by word of mouth. If the patient has a bad experience at the hospital, they're going to talk about it to their family members and everyone else who would listen to them complains. Same goes if the patient had a great experience at a hospital if everything was amazing, and the hospital went above and beyond to make sure all their needs were met will are also going to tell people about their experiences, and more people are more likely going to want to make a choice to come to your hospital instead of going to somewhere else. If you just focus on patient satisfaction you're only going to get the outcome measure or process measure not what the patient is going to say to other potential patients.
In: Economics