two plastic curved rods, one of charge q and the other of charge -q. which form a semicircle of radius r=8cm in xy. If q=3.8pC, what would be the magnitud and direction of the electric force E produced in P,in the center.
In: Physics
Write a program to swap mth and nth elements of a linked list.
User should give input.
In: Computer Science
Count all nonzero elements, odd numbers and even numbers in a linked list.
Code needed in java.
In: Computer Science
Analyze competitors’ offerings
CASE STUDY SITUATION You are the vice president of development for BULLET, the second largest discount retailer in the nation. The senior VP has asked you to analyze a new sales venture and determine how to build a clientele foe the new venture and for traditional BULLET stores. There are close to 2000 BULLET stores across the country, most anchoring strip malls or outdoor shopping centers. BULLET stores feature typical grocery store items along with pharmacies, apparel, home décor, books, toys, electronics, seasonal items and health and beauty sections. BULLET’S biggest competitor is BOX MART, the leading discount retailer. BULLET does not come close to the number of store locations nor the revenue that BOX MART produces each year. Aside from similar store layouts and product offerings, there are notable differences between the two discount retailers. Although product offerings are similar, BULLET has a much different image than BOX MART. BULLET is perceived to be better organized, with a more streamlined store layout. They are also more in touch with fashion trends and home décor. BULLET also markets higher quality house brands in all departments, most notably in its food and beverage departments. BULLET offers a wide variety of fresh, ready-to-eat meals that beat BOX MART’S offerings in customer ratings each year. Executives at BULLET have decided to test market a concept for a BULLET branded convenience store. The BULLET convenience store will be located away form BULLET stores and will offer fuel and the loyal BULLET customer, and also new clientele who does not usually shop at BULLET stores. They are also hoping to attract the BOX MART customer. YOUR CHALLENGE The senior VP wants you to determine how a BULLET C-store can feel like a BULLET store, rather than a typical convenience store. You are to suggest techniques tha can expose BULLET C-store customers to BULLET retail store products, ideally resulting in a larger clientele for BULLET retail stores. In addition, you need to plan the product mix the BULLET C-stores; what typical convenience store products should be sold and what other products should be sold to keep up with BULLET’S well-regarded image? Are there store services that should be offered or not?
In: Operations Management
Write down a detailed role of succession planning and management in human resource planning with diagram.
In: Operations Management
First, read this very short article:
Click for .pdf of the "Myth of Pink and Blue Brains"
http://www.ascd.org/publications/educational-leadership/summer11/vol68/num10/The-Myth-of-Pink-and-Blue-Brains.aspx
Then think about about gender: the biology of 'male' and 'female,' the performance of masculinity and femininity, the power structures in society, and the culturally constructed gender stereotypes
answer this question: to what extent is gender a product of society, and how does society create gendered individuals?
In: Psychology
I want a unique c code for the following parts mentioned below: Please try to solve the following. I am not able to solve it.
I have already provideD the code for Part 1 and Part 2. You may only show their working output screenshots. You JUST need to *MODIFY PART 3* and upload the code for it
Please provide details too by highlighting what you modified,
PERFORM ALL THE PARTS SEPARATELY IN SHELL SERVER AND ATTACH CODE.
DO NOT SIMPLY PASTE THE CODE THAT I PROVIDED. PLEASE UPDATE THE PARTS THAT I MENTIONED BELOW
Details are provided to write code.
PART 1:
I have provided a file (threadhello.c that generates 10 threads, each of which simply prints out a "hello world" message before terminating. Examine this code carefully.
#include <pthread.h> #include <stdlib.h> #include <stdio.h> #define NUMBER_OF_THREADS 10 /* This is a structure that is used to pass parameters to the thread. * Currently, the only param is the thread id */ typedef struct { int tid; } paramListType; /* *params should be pointing to a structure of paramListType */ void *print_hello_world(void *params) { paramListType *paramPtr = params; printf("Hello World. Greetings from thread %d\n", paramPtr->tid) ; pthread_exit(NULL); } int main(int argc, char **argv) { pthread_t threads[NUMBER_OF_THREADS]; int status, i; /* parms will be a pointer to a parmListType structure that will * contain the thread id value */ paramListType *params; for(i=0; itid = i; status = pthread_create(&threads[i], NULL, print_hello_world, (void *) params); if(status != 0) { printf("pthread_create returned error code %d\n", status); exit(-1); } }
/* if the program doesn't wait for all the threads to finish, * you may not see the print message from some of them */ for(i=0; i<NUMBER_OF_THREADS; i++) { status=pthread_join(threads[i], NULL); } exit(0); }
Please also show how to Upload this file (you may use an ftp
client or, better yet, look up how to use the scp command (prefered))
Compile this code using the following command: clang threadhello.c -lpthread
Run this command several times. Submit at least 3 screenshots of different outputs that were all a result of running this code
DELIVERABLE #1: >=3 screenshots of this code correctly running
PART 2:
I have also provided a file threadarray.c Upload and run this program. Run the program several times where you have increased the size of the array.
#include <pthread.h> #include <stdlib.h> #include <stdio.h>
#define ARRAY_SIZE 15 /* This is a structure that is used to pass parameters to the thread. * Currently, the only param is the thread id */ typedef struct { int* arr; int tid; } paramListType; void* threadSum(void* p){ paramListType* ptr = (paramListType*)p; int n = ptr->tid; // Declare sum dynamically to return to join: int* thread_sum = (int*) calloc(1, sizeof(int)); //NOTE: uncomment the printf commands below to see behind the scenes if(n == 0){ for(int i = 0; i < ARRAY_SIZE/2; i++){ //printf("Working in thread %d, at position: %d\n", ptr->tid , i ); thread_sum[0] = thread_sum[0] + ptr->arr[i]; } } else{ for(int i = ARRAY_SIZE/2; i < ARRAY_SIZE; i++){ //printf("Working in thread %d, at position: %d\n", ptr->tid , i ); thread_sum[0] = thread_sum[0] + ptr->arr[i]; } } pthread_exit(thread_sum); } int main(int argc, char **argv) { // Declare integer array [1,2,3,4,5,6,7,8,9,10]: int* int_arr = (int*) calloc(ARRAY_SIZE, sizeof(int)); for(int i = 0; i < ARRAY_SIZE; i++) int_arr[i] = i + 1; // Declare arguments for both threads: paramListType thread_params[2]; thread_params[0].tid = 0; thread_params[0].arr = int_arr; thread_params[1].tid = 1; thread_params[1].arr = int_arr; // Declare thread IDs: pthread_t tids[2]; // create threads: pthread_create(&tids[0], NULL, threadSum, &thread_params[0]); pthread_create(&tids[1], NULL, threadSum, &thread_params[1]); // declare sums: int* sum0; int* sum1; // retrieve sum of threads: pthread_join(tids[0], (void**)&sum0); pthread_join(tids[1], (void**)&sum1); printf("Sum of whole array = %i\n", *sum0 + *sum1); return 0; }
DELIVERABLE #2: a screenshot of this code correctly running
PART 3: (REALLY IMPORTANT PART)
Change this program so that it fills the array values with (truly) random numbers between 1 and 100. Then, change the program so that it makes use of five (5) threads to sum the values in the array.
Hint: you may want to check that your five thread version is correctly working on known totals before updating your code to run on random values.
DELIVERABLE #3: your new program file
DELIVERABLE #4: a screenshot of your program running
In: Computer Science
Find the largest and smallest element of a linked list, print total of all elements and find out the average.
Code needed in java
In: Computer Science
In: Accounting
Given lists L1, L2 and L3, delete all the nodes having even number in info part from the list L1 and insert into list L2 and all the nodes having odd numbers into list L3.
Code needed in java.
In: Computer Science
Mortgage Calculator
Create a form that allows you to enter in interest rate, monthly payment, principal , and number of years. Your Java Servlet program then generates a table containing a row of output for each month of a mortgage. Your table should show Month number, New Principal, Interest Paid during the month. If the load is paid off, your table needs to properly stop.
*********************************** Sample Output *********************************
Interest Calculations
Calculating for:
interest rate/year =6
starting principal=10000
payment/month =1000
months =60
Month Number | Principal | Interest |
---|---|---|
1 | 9050.00 | 50.00 |
2 | 8095.25 | 45.25 |
3 | 7135.73 | 40.48 |
4 | 6171.40 | 35.68 |
5 | 5202.26 | 30.86 |
6 | 4228.27 | 26.01 |
7 | 3249.41 | 21.14 |
8 | 2265.66 | 16.25 |
9 | 1276.99 | 11.33 |
10 | 283.37 | 6.38 |
Last Payment = 284.79
This includes interest:1.42
**************************************************************************************
HINTS:
Take a look at the "RadioActive" servlet example in the notes. This application is similar to this homework. You can ignore the bar image part ... it's not part of this homework.
You will want to have a loop for the number of 12 * (Number of years). On each iteration of the loop, you will want to calculate the interest paid which is:
interestPaid = (newPrincipal * interest)/(12*100)
The 12 is because of 12 months in a year. The 100 is due to the fact that interest rates (like 6) are computed as 0.06 in interest calculations.
newPrincipal = newPrincipal + interestPaid - monthlyPayment
To get rid of the large number of decimal places that show up when you print a double, there is a format method in the String class that can help. Consider the following code (similar to the printf stuff in System.out):
String sPrinciple = String.format("%.2f", principal);
in Java Servlet
In: Computer Science
how are capital gains on form 1120s taxes?
In: Accounting
Students must complete a childhood (between 2-9 years of age) observation report in which physical and social behavior is evaluated within the context of developmental norms. A minimum of three physical behaviors and three social behaviors must be observed and evaluated. When observing a child, you are required to do so in a public area (playground, mall, library, etc.) and should not draw attention to yourself so the child is aware he or she is being observed. Please get parental permission for our observation. If you need guidance in locating a child to observe, please contact your Instructor immediately.
In addition to the observation, students must evaluate the child’s behavior compared to what is typical of a child of that age. For physical observations, students should evaluate the child according to developmental norms. For cognitive/social behavior, students should evaluate the child using at least two theories discussed in class. These theories can include Piaget’s theory, attachment theory, Erikson’s theory, etc.
The observation report must be typed in 12 point, Times New Roman font, with one inch margins. The observation report must be a minimum of three pages and grammatically correct.
Examples of physical behavior can include: Approximate height/weight, fine motor skills, gross motor skills, play activities, feeding behavior
Examples of social behavior can include: Expression of emotion, language, relationship with other children, relationship with caregivers
In: Psychology
Given two sorted linked lists, merge them into a third sorted linked list. If an element is present in both the lists, it should occur only once in the third list.
Code needed in java.
In: Computer Science
Create 4-page (not including the cover or reference page) paper on a hot topic in Human Resource Management.
Paper Topics:
Content: paper should consist of information that cannot be found in your text.
In: Operations Management