Questions
A program must execute 1012 instructions to solve a problem. A single processor system can solve...

A program must execute 1012 instructions to solve a problem. A single processor system can solve the problem in 106 seconds. Thus on average the single processor system executes 106 or 1-million instructions per second.

We have a new program that has been parallelized for execution on a distributed-memory system. This parallel program uses (p) processors. Here each processor will execute 1012/p instructions and each processor must send 109(p-1) messages. We will assume there is not additional overhead for the parallel program and that the program will complete after each processor has executed all of its instructions and sent all of its messages (there are no delays for things like waiting for messages).

2.a. If it takes 10-3 seconds to send a message, how long will it take the program to run with 1000 processors if each processor is as fast as the single processor where the serial program was run?

2.b. If we upgrade our network and it now takes only 10-9 seconds to send a message.   Same question – how long to run on the same 1000 processors now?

In: Computer Science

Consider the middle 3 digits of your student ID composed of seven digits. Convert it to...

Consider the middle 3 digits of your student ID composed of seven digits. Convert it to binary format (each digit is represented by a maximum of 3bits). For example, 1060385 is simplified to 603 and then converted to 110 000 011. Assume now that we want to send your student ID while being able to detect and correct single bit errors. 1.1) Using two-dimensional parity check show what will be transmitted

Consider the middle 3 digits of your student ID composed of seven digits. Convert it to binary format (each digit is represented by a maximum of 3bits). For example, 1060385 is simplified to 603 and then converted to 110 000 011. Assume now that we want to send your student ID while being able to detect and correct single bit errors.

  1. 1.1) Using two-dimensional parity check show what will be transmitted codeword using datawords of size 3bits.

  2. 1.2) Using the hamming code show what would be the codeword that corresponds to your simplified binary student ID. Dataword size is 9bits.

  3. 1.3) Assume that a single bit error occurred and corrupted the 8th bit (numbering starts from 1 and from right). Show that the receiver of such corrupted codeword will be able to correct the error when using the hamming code.

codeword using datawords of size 3bits.

1.2) Using the hamming code show what would be the codeword that corresponds to your simplified binary student ID. Dataword size is 9bits.

1.3) Assume that a single bit error occurred and corrupted the 8th bit (numbering starts from 1 and from right). Show that the receiver of such corrupted codeword will be able to correct the error when using the hamming code.

MY digits is 732

binary 1011011100

In: Computer Science

Part 1: Image effects Your first task is to write two functions that manipulate digital images....

Part 1: Image effects

Your first task is to write two functions that manipulate digital images.

    

You will write two functions that take an image object, create a copy, perform a pixel-by-pixel manipulation, and return the manipulated copy. We have provided three helper functions (open_image, display_image, and save_image) that you can use to test your code. You may write any additional helper functions that you find useful. Below there are descriptions and sample images for each of the required manipulations.

The best way to test your image functions is to modify the main function at the bottom of hw7_images.py. You can add calls to the various image functions and use the helper functions to display and save the new/modified image.

The code for an example function, red_filter, is provided in hw7_images.py; images to show the effect of this filter are shown below.

  

The two functions you must write are as follows:

1. negative

Create a negative of the image by inverting all of the color values. Recall that the minimum color value is 0 and the maximum is 255. So a color value of 255 becomes 0 and a value of 33 becomes 222.

In: Computer Science

Let us consider applications of parity checks in error correction codes. (a) A Mind at Play:...

Let us consider applications of parity checks in error correction codes. (a) A Mind at Play: How Claude Shannon Invented the Information Age is a biography of Shannon, who is generally considered the architect of the information age. The ISBN-10 code for the book can be obtained by removing the prefix 978 from its ISBN13 code and then recalculating the check digit (the last digit). Recall that the 10 digits for the ISBN-10 code satisfy X 10 i=1 ixi = 0 mod 11, whereas the 13 digits for the ISBN-13 code satisfy x1 + 3x2 + x3 + 3x4 + ... = 0 mod 10 You are given 978-147676?690 as the ISBN-13 code. Please find the missing digit, and then derive the corresponding ISBN-10 version. (b) Please explain that if a (15,11)-Hamming code is used but the channel makes 2 or more errors, the decoder, using minimum distance decoding, is always wrong. (c) Consider a (15,11)-Hamming code you just designed in the practice exam, with syndromes designed to indicate bit error positions. Say we now extend each 15-bit codeword by one more parity check, x16, such that x16 = P15 i=1 xi mod 2. (c1) Please explain whether it is still useful to use the four syndromes defined for the original (15,11) code to check for single bit errors. (Hint: Consider which bit error positions the four syndromes can detect. You care most about the data bits.) (c2) Write down any additional syndrome(s) you would add. If not, please briefly explain why. (c3) What is the rate of this new 16-bit code? (1 point only here. Don’t overthink!) (c4) How many errors can we correct now with the 16-bit code? Briefly explain whether adding this 16th bit is worthwhile. (d) If we were to design a Hamming code with 5 check bits per codeword, how many data bits can we have per codeword? Please briefly explain why. What is the minimum distance of this code? Can we now correct 2 errors?

In: Computer Science

8.16 LAB: Mileage tracker for a runner Given the MileageTrackerNode class, complete main() to insert nodes...

8.16 LAB: Mileage tracker for a runner

Given the MileageTrackerNode class, complete main() to insert nodes into a linked list (using the InsertAfter() function). The first user-input value is the number of nodes in the linked list. Use the PrintNodeData() function to print the entire linked list. DO NOT print the dummy head node.

Ex. If the input is:

3
2.2
7/2/18
3.2
7/7/18
4.5
7/16/18

the output is:

2.2, 7/2/18
3.2, 7/7/18
4.5, 7/16/18

_____________________________

The given code that i need to use is:

______________________________

Main.cpp

#include "MileageTrackerNode.h"
#include <string>
#include <iostream>
using namespace std;

int main (int argc, char* argv[]) {
// References for MileageTrackerNode objects
MileageTrackerNode* headNode;
MileageTrackerNode* currNode;
MileageTrackerNode* lastNode;

double miles;
string date;
int i;

// Front of nodes list
headNode = new MileageTrackerNode();
lastNode = headNode;

// TODO: Read in the number of nodes

// TODO: For the read in number of nodes, read
// in data and insert into the linked list

// TODO: Call the PrintNodeData() method
// to print the entire linked list

// MileageTrackerNode Destructor deletes all
// following nodes
delete headNode;
}

___________________________________________________

MileageTrackerNode.h

#ifndef MILEAGETRACKERNODEH
#define MILEAGETRACKERNODEH

#include <string>
using namespace std;

class MileageTrackerNode {
public:
// Constructor
MileageTrackerNode();

// Destructor
~MileageTrackerNode();

// Constructor
MileageTrackerNode(double milesInit, string dateInit);

// Constructor
MileageTrackerNode(double milesInit, string dateInit, MileageTrackerNode* nextLoc);

/* Insert node after this node.
Before: this -- next
After: this -- node -- next
*/
void InsertAfter(MileageTrackerNode* nodeLoc);

// Get location pointed by nextNodeRef
MileageTrackerNode* GetNext();

void PrintNodeData();

private:
double miles; // Node data
string date; // Node data
MileageTrackerNode* nextNodeRef; // Reference to the next node
};

#endif

______________________________________________

MileageTrackerNode.cpp

#include "MileageTrackerNode.h"
#include <iostream>

// Constructor
MileageTrackerNode::MileageTrackerNode() {
miles = 0.0;
date = "";
nextNodeRef = nullptr;
}

// Destructor
MileageTrackerNode::~MileageTrackerNode() {
if(nextNodeRef != nullptr) {
delete nextNodeRef;
}
}

// Constructor
MileageTrackerNode::MileageTrackerNode(double milesInit, string dateInit) {
miles = milesInit;
date = dateInit;
nextNodeRef = nullptr;
}

// Constructor
MileageTrackerNode::MileageTrackerNode(double milesInit, string dateInit, MileageTrackerNode* nextLoc) {
miles = milesInit;
date = dateInit;
nextNodeRef = nextLoc;
}

/* Insert node after this node.
Before: this -- next
After: this -- node -- next
*/
void MileageTrackerNode::InsertAfter(MileageTrackerNode* nodeLoc) {
MileageTrackerNode* tmpNext;

tmpNext = nextNodeRef;
nextNodeRef = nodeLoc;
nodeLoc->nextNodeRef = tmpNext;
}

// Get location pointed by nextNodeRef
MileageTrackerNode* MileageTrackerNode::GetNext() {
return nextNodeRef;
}

void MileageTrackerNode::PrintNodeData(){
cout << miles << ", " << date << endl;
}

In: Computer Science

How is a technical report different from a news report? Mention their differences.

How is a technical report different from a news report? Mention their differences.

In: Computer Science

IF YOU HAVE ANSWERED THIS QUESTION BEFORE THEN PLEASE DONOT ANSWER AGAIN. Your task for this...

IF YOU HAVE ANSWERED THIS QUESTION BEFORE THEN PLEASE DONOT ANSWER AGAIN.

Your task for this assignment is to implement a stack data structure in C++. This may be accomplished by utilizing the C++ standard template library (STL) or by utilizing a user-defined class.

  1. Implement a transaction-based stack data structure using C++. The program will be interactive. Data transactions will be entered at the command line and results will be displayed on the console.

  2. Each input transaction will contain an arithmetic expression in post-fix format. Assume that operands and operations are separated by a space on an input line that contains one arithmetic expression. An operand will be a positive or negative float number. An operation may be +, -, * or /. You may assume that each arithmetic expression is correctly formatted. However, your program should not allow an attempt to divide by zero. Instead of dividing by zero, your program should display an error message and then begin evaluating a new input transaction.

    Sample input transactions are these:

    1. 2.0 3.3 + (result = 5.3)

    2. 34*-2.5/ (result=-4.8)

    3. 9.5 8 3.0 2 * 6 - / + (result= “error: division by zero”)

  3. An input transaction containing “end-of-file” indicates there are no more transactions to be processed. Implement a stack to evaluate each expression and display the result. Use the C++ built-in class or a user-defined class to implement stack functions.

  4. The program will be run at the command prompt by navigating to the directory containing the executable version of the program after the program is compiled. The program should display a prompt requesting input, such as “Please enter an expression in post-fix notation:”.

5. You are encouraged to add additional comments throughout the program that your feel might be helpful to the reader of your source code.

In: Computer Science

A consultant has recommended your organization look to increase its security profile in relation to SMTP...

A consultant has recommended your organization look to increase its security profile in relation

to SMTP traffic. Management has asked you devise a firewall-specific strategy to address the

recommendation. What strategy would you recommend, and why?

Your answer should be approximately 200-250 words in length.

In: Computer Science

This assignment is to give you practice using enums, string variables, and string functions. In order...

This assignment is to give you practice using enums, string variables, and string functions. In order to get full credit for the program you must use these three topics.

You are to write a program that will read a series of names of people from a data file that has been created with extra blank spaces and reformat the names into a standardized format.

The datafile is mp6names.txt. It is arranged with the information for one person on each line. The first character on the line will be either ‘M’ or ‘F’ indicating the gender of the person, and the second character will be either ‘M’, ‘S’, or ‘D’ indicating married, single or divorced. You may assume that there will be no bad data here. The remainder of the line is the person’s name in the form:

Last_name, First_name Middle_Initial.

Note that there will always be a comma immediately after the last name and, if the person has middle initial, it will always be followed by a period. However, there could be any number of blank spaces in between each part of the name and some people do not have middle initial.

Your task is to clean up the name and print it out in the standard format, e.g. Mr. Bill T. Jones with the appropriate title and exactly one space between each part of the name.

You are REQUIRED to use functions, enums, string variables and string functions in the solution to this problem. Define an enum for the Marital Status of the person (with the values SINGLE, MARRIED and DIVORCED) and write a function that reads in the character from the file and returns the appropriate enum value.

Read the name from the file into a string variable and write another function that uses the functions of the string class (e.g. find(), substr() etc.) to clean up the name and create a new string variable containing the name in the new format.

Finally, add the appropriate title to the name and print it out. All males will have the title “Mr.” – married females will have “Mrs.” and single or divorced females will have “Ms.”

Continue doing this until the end of file is reached. Your output must include the original name as read from the file followed by the new name in the standardized format.   For formatting purposes you may assume that no name will have more than 30 characters.

This is just a SUGGESTED method and for each step you may want to include output for debugging purposes to insure that your program is working correctly. Feel free to design your own modules as you like. A sample output from the first few lines of the data file follows:

Original name                  Standardized name

Bach,   Johann    S.         Mr. Johann S. Bach
Curie,     Marie A.            Mrs. Marie A. Curie
Parker, Alice   M.             Ms. Alice M. Parker

In: Computer Science

Write a C program that reads a file and reports how many lines, words, and characters...

Write a C program that reads a file and reports how many lines, words, and characters appear in it. For the purpose of this program, a word consists of a consecutive sequence of any characters except white space characters. For example, if the file lear.txt contains the following passage from King Lear,

Poor naked wretches, wheresoe’er you are,

That bide the pelting of this pitiless storm,

How shall your houseless haeds and unfed sides,

Your loop’d and window’d raggedness, defend you

From seasons such as these? O, I have ta’en

Too little care of this!

Your program should be able to generate the following sample run:

File: lear.txt

Lines: 6

Words: 43

Chars: 210

In: Computer Science

in c++ language This assignment is to give you practice using structs and sorting. In competitive...

in c++ language

This assignment is to give you practice using structs and sorting.

In competitive diving, each diver makes dives of varying degrees of difficulty. Nine judges score each dive from 0 through 10 in steps of 0.5. The difficulty is a floating-point value between 1.0 and 3.0 that represents how complex the dive is to perform. The total score is obtained by discarding the lowest and highest of the judges’ scores, adding the remaining scores, and then multiplying that total by the degree of difficulty. Write a program to score each of the dives, using the following input and output specifications, and determine the winner of the competition.

Input:

Create the file m7divers.txt using the data given at the end.

The first line contains an integer for the number of divers in the competition and subsequent lines contain:
Diver’s name (10 characters max, no blanks included), difficulty (double), and judges’ ratings (nine doubles). There is one line of data for each diver.

Example file: (This is not the data to use)

Anne 2.0 8.0 8.5 8.5 8.5 9.0 9.0 9.0 9.5 9.5 124.0
Sarah 1.6 7.0 7.5 8.0 8.0 8.0 8.5 8.5 8.5 9.0 91.2

Output:

The name and difficulty, followed by the scores sorted into increasing order, in tabular form with appropriate headings along with the earned total points for that dive.

Example for sample data above

NAME DIFF SORTED SCORES         POINTS
Anne 2.0 8.0 8.5 8.5 8.5 9.0 9.0 9.0 9.5 9.5 124.0
Sarah 1.6 7.0 7.5 8.0 8.0 8.0 8.5 8.5 8.5 9.0 91.2


At the end of the table, print out the name of the winner of the competition (the person with the highest points) and his/her final score.

Hint: Use functions to modularize your program.

Use this data for your input file. download the data from the attachment.

NAME DIFF SORTED SCORES        
Anne 2.0 8.0 8.5 8.5 8.5 9.0 9.0 9.0 9.5 9.5
Sarah 1.6 7.0 7.5 8.0 8.0 8.0 8.5 8.5 8.5 9.0
Deborah 2.3 9.0 9.0 9.5 10.0 10.0 9.5 9.5 9.5 9.5
Kathryn 2.4 9.0 9.0 9.0 9.5 9.5 9.5 9.0 8.0 8.5
Martha 2.7 9.0 9.0 9.5 9.5 9.0 8.5 8.5 8.5 8.5
Elizabeth 2.9 8.0 8.0 7.5 8.5 8.5 8.0 8.0 7.5 8.5
Tina 2.5 8.5 8.5 8.5 8.5 8.5 8.5 8.5 8.5 8.5

In: Computer Science

Write a program in PYTHON which: *Defines the following 5 functions: whoamI() This function prints out...

Write a program in PYTHON which:

*Defines the following 5 functions:

whoamI()

This function prints out your name and PRINTS OUT any programming course you have taken prior to this course.

isEven(number)

This function accepts one parameter, a number, and PRINTS OUT a message telling if the numberer is even or odd. Keep in mind that a number is even if there is no remainder when the number is divided by two.

printEven(number)

This function accepts one parameter, a number, and PRINTS OUT all even values from 2 thru this number.

sumUp(number)

This function accepts one parameter, a number, and RETURNS the sum of ALL values from 1 up to this number

howmanyDigits(number)

This function accepts one parameter, a number, and RETURNS the number of digits contained in the value. (for example, if the value was 475, the function would return a 3. Hint: the simplest way to do this is to convert the number to a string .. then the length is accessible

* follows the function definition with main process statements which:

1.) calls the 'whoamI' function to that the program begins by outputting uses information

2.) prompt the user for a positive int and store it

   If the user does not enter a valid number, reprompt. Continue this until a valid value

   has been entered.

3.) present the user with 4 choices:  

              -find out if the number is even or odd

              - printout all even values up to the number

              -output the sum of all values from one to the number

- output the number of digits in the number

4.) Carry out the user’s choice. Be sure to call one of the functions that you have defined to do this.

If you wish you may put the main statements in a loop that repeats until the user chooses to exit.  

In: Computer Science

Discuss several categories of common end-user technology problems. Provide examples of problem-solving processes applied to typical...

Discuss several categories of common end-user technology problems.

Provide examples of problem-solving processes applied to typical support problems.

In: Computer Science

This Code Is Supposed To Be Performed In JAVA 1.) Create an abstract class DiscountPolicy. It...

This Code Is Supposed To Be Performed In JAVA

1.) Create an abstract class DiscountPolicy. It should have a single abstract method computeDiscount that will return the discount for the purchase of a given number of a single item. The method has two parameters, count and itemCost. Create a driver class that tests this class and provide the UML.

2.) In a separate program, define DiscountPolicy as an interface instead of the abstract class. Create a driver class that tests this class and provide the UML.

Perform The Following

1.) Create an abstract class DiscountPolicy with a single abstract method computeDiscount that will return the discount for the purchase of a given number of a single item.

2.) Create a driver class

3.) Create an interface class DiscountPolicy with a single abstract method computeDiscount that will return the discount for the purchase of a given number of a single item.

4.) Create a driver class or use the same driver class that you created earlier

In: Computer Science

1. Enhance Binary System Conversion program with Lab05.2 Addition Function Write a program that accepts two...

1. Enhance Binary System Conversion program with Lab05.2 Addition Function Write a program that accepts two positive binary number in string and perform the addition with Lab05.2 function enhance in a way can accept binary string in addition to decimal string (use input parameter to control the base2 or base10 addition) and output the as binary string. (Optional: Demonstrate 8 bits and 16 bits in length as inputs.) // the example function prototype for addition function below where accepting two numbers, m, and base as input; output the addition result as string type as return value; base should be 2 or 10 as required. string addFunction(string numberA, string numberB, int m, int base); Requirement: C++ programing; program an addition algorithm function that can both accept binary and decimal addition; convert each other if necessary. ................................................................................................................................................................................................................

Requirement:

1. Write a string addFunction that both can accept two positive binary numbers and decimal numbers in string.

2. The example function prototype for addition function below where accepting two numbers,m, and base as input; output the addition result as string type as return value; base should be 2 or 10 as required.

3. Output needs as binary string.

4. Example for String addFuntion(string numberA, string number B, int m, int base).

Program language: C++

In: Computer Science