using C thank you
Must submit as MS Word file with a screenshot of the 3 outputs. Run your program 3 times.
the output must be in a screenshot not typed for the each time you run the program. thank you
Modify the code below to implement the program that will sum up 1000 numbers using 5 threads.
1st thread will sum up numbers from 1-200
2nd thread will sum up numbers from 201 - 400
...
5th thread will sum up numbers from 801 - 1000
Make main thread wait for other threads to finish execution and sum up all the results.
Display the total to the user.
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#define N_OF_THREADS 4
void * print(void *tid){
printf("Hello %d\n", tid); pthread_exit(NULL);
}
int main(){
pthread_t threads[N_OF_THREADS];
int status, i; //
printf("Main. Creating thread %d\n", i);
for (int i=0; i<N_OF_THREADS; i++) {
printf("Main. Creating thread %d\n", i);
status = pthread_create(&threads[i], NULL, print, (void*)i);
if(status){
printf("Error %d\n", status);
exit(-1);
}
}
exit(NULL);
}
In: Computer Science
Directly copy the source code and paste into the Word file. Screenshot of running result must be presented.
1. (20 points) Write the “Hello, world!” program.
2. (30 points) Write a program to calculate the sum from -5 to10. Use the for loop to do the calculation.
3. (20 points) Write a complete C++ program that asks the user to enter the necessary information about the cylinder, calculate the volume in a function (named as calculate_vol, using reference to pass the volume value out), then display the cylinder volume in main function. The volume of cylinder is:
Vol_Cylinder = πr2h
Where π is 3.14159265, r is the radius, and h is the height.
4. (30 points) Declare a vector container. Using keyboard to input several integer numbers, say at least six integer numbers; find the smallest number and display the result.
In: Electrical Engineering
In: Economics
In: Economics
The user is going to cin a whole bunch of regular text. You store each word based on its first letter. Print out all the words they used by letter. Strip all punctuation and uncapitalize everything. :
- Project set up with stl includes, correct files, and turned in correctly. (Zipped project with no inner debug folder.)
- Basic data structure made. This requires at least two connected containers. More is okay if it makes sense to you, but no way this works with just one. Be sure to comment how it works so I understand it.
- Program planned out in English in inline comments in main. Think of it as you could read this to a programmer and they could do your homework for you. No code details belong in an outline; the person you are reading it to might not use C++. Fell free to mutter to yourself. You need someone else to understand what to do. But do not just comment every line; they know how to write in whatever language they choose. Don't forget - you can use any resource here short of other people and copying code of the internet. But if you can't remember how to use cin to pull words off a sentence, look it up. In the first page of search results I see three different ways to do it. No I'm not saying what they are.
- Parsing sentence down to words works
- Putting in your data structure works
- Removing punctuation and capital letters
Input: I asked my doctor how long I had to live. She said five. I said "Five what?" She said four...
Output: A asked B C D doctor E F five five four G H how had I I I I J K L long live M my N O P Q R S she said said she said T to U V W what X Y Z
In: Computer Science
Provide a 250+ word response to the following question. Please separate your answers by the parts of the question.
Assignment #2 – Advertising Plan (15 points possible)
Pick ONE of the following options:
Develop an ad campaign for a company/product/service related to your employment (note that if your employment is B2B in nature, most B2B doesn’t involve much advertising. They tend to use other promotional elements. So keep that in mind), OR
Develop an ad campaign for your very own (hypothetical!) beauty salon OR auto parts store that’s been in business for just over one year
To try to develop demand for your company/product/service -- OR to resuscitate your ailing store -- you've decided to conduct an ad campaign. Following the steps outlined in the Lecture from Chapter 18, provide a detailed description of your campaign. Be sure to mention each of the areas listed below. Also be sure that you are focusing on strategies for this specific ad campaign -- not simply your advertising or marketing in general. Do not use any current advertising campaign! NOTE: If you select your current employer who uses a differentiated strategy, select only one specific target market for this campaign.
Please start by giving a brief explanation of the product/service/store you are advertising.
Step 1 -- target market of this specific ad campaign
Provide a geographic, demographic, and psychographic description of your target. I am looking for an insightful description of your target.
Step 2a -- objective of this specific ad campaign
Be sure you identify what you want this ad campaign to accomplish. Which of the types of advertising (informative, persuasive or reminder) will you be using and why?
Step 2b -- focus of campaign
What will be the focus of your ads – product-focused or institutional? Why?
Step 3 – determine your budget
Think about the size of your business, overall sales and success. You don’t need a specific budget number but discuss how these areas will affect how much you are able to spend and whether that potentially eliminates some types of media.
Step 4a – convey the message (Be creative!)
Develop a unique selling proposition (USP) for the campaign. Make sure to provide an explanation of your rationale for the USP.
Step 4b -- appeal
Will you use an informational or emotional appeal? Why?
Step 5a & b – media types and vehicles.
Describe which media types you will use and why. List the specific media vehicles for each type. A media vehicle is the specific communication tool. For instance if magazine is the media type, then Sports Illustrated or Cosmopolitan is the media vehicle; if TV is the media type then Food Network or “Bones” is the vehicle (it can be a cable network or a network program).
Step 5c – media schedule
How will you schedule your media? (continuous, pulsing, flighting)? Explain how your budget will help you make this decision.
Step 6 -- IMC – integrating your ad with the rest of the promotional tools
Identify and discuss other, non-advertising promotions you will use to coordinate with this ad campaign. Are there personal selling, sales promotions/incentives, public relations and/or social media efforts you’d like to include?
Step 7 – Evaluating your campaign
This is maybe one of the most important steps. How will you evaluate the effectiveness of your campaign? How will you know if it “worked?” How will you know if you should repeat the campaign, or completely revamp it?
In: Operations Management
create a document in microsoft word or excel document which has the following:
Fictitious names and addresses of 10 folks including name, address and phone number. Recreate the bike table, which includes bike name, part number and hourly rate
Please limit your submission to no more than 2 pages.
In: Economics
answer key for all of the question below
A. Number expression (i.e., word of figure forms or symbols
B) punctuation other than commas or semicolon, hyphens, apostrophes, periods and question marks).
C )Commas or semicolons
D) capitalization
In: Operations Management
Choose one of the questions below to discuss. (200 word min)
1. What is meant by the term "open economy"? "Closed economy?"
2. What imported goods do you often buy? How would you be affected if the U.S. restricted international trade or stopped trading with other nations entirely?
3. What happens to the trade from either developed or underdeveloped nations when monopoly export and import agencies are set up? Why?
4. What are the differences between common markets, custom unions and free trade agreements? Which of these is the most comprehensive form of trade agreement.
5. What was the basic role of GATT? What is the basic objective of the WTO?
6. What are the major threats to further world trade liberalization?
7. What are the differences between the static vie of comparative advantage and the dynamic view of growth?
In: Economics
I want answers to the following questions regarding "Operations Strategy in a Global Environment":
The word count is less than 100 words for each question. I just want basic concepts of the following questions.
1. How does a corporation expect to accomplish its missions as
well as objectives?
2. What is the concept of an exceptional competitive
advantage?
3. Explain some cases of social and moral problems faced by global
operations managers?
4. How can the supply chain boost global operations?
In: Operations Management