PLEASE INCLUDE THE SOURCE CODE AND OUTPUT PLEASE AND
THANKS!!This assignment covers recursion and linked list which
include the following tasks:
2. a. Using C/C++, construct a single linked list of 8 nodes and assign random numbers as the nodes’ values. Then print the list from the first node to the last. Finally, free all memories of the linked list.
b. Using C/C++, construct a single linked list of 8 nodes and assign random numbers as the nodes’ values. Then create a new node and assign its value 100; insert this node at the sixth position of the list, and define a recursive function to print the list to verify the result. After that, delete the eighth node of the list to keep the linked list having 8 nodes, and define another recursive function to reprint the linked list backwards (from the last to the first).
In: Computer Science
Production, Direct Labor, Direct Materials, Sales Budgets, Budgeted Contribution Margin
Greiner Company makes and sells high-quality glare filters for microcomputer monitors. John Craven, controller, is responsible for preparing Greiner’s master budget and has assembled the following data for the coming year. The direct labor rate includes wages, all employee-related benefits, and the employer’s share of FICA. Labor saving machinery will be fully operational by March. Also, as of March 1, the company’s union contract calls for an increase in direct labor wages that is included in the direct labor rate. Greiner expects to have 6,700 glare filters in inventory on December 31 of the current year, and has a policy of carrying 25 percent of the following month’s projected sales in inventory. Information on the first four months of the coming year is as follows:
| January | February | March | April | |
| Estimated unit sales | 36,800 | 34,600 | 39,200 | 38,200 |
| Sales price per unit | $81 | $81 | $76 | $76 |
| Direct labor hours per unit | 2.80 | 2.80 | 2.50 | 2.50 |
| Direct labor hourly rate | $17 | $17 | $19 | $19 |
| Direct materials cost per unit | $10 | $10 | $10 | $10 |
Required:
Unless otherwise indicated, round all calculated amounts to the
nearest dollar or unit.
1. Prepare the following monthly budgets for Greiner Company for the first quarter of the coming year.
a. Production budget in units:
| Greiner Company | ||||
| Production Budget (units) | ||||
| For the First Quarter of the Coming Year | ||||
| January | February | March | Total | |
| Unit sales | ||||
| Desired ending inventory | ||||
| Total units required | ||||
| Less: Beginning inventory | ||||
| Units produced | ||||
b. Direct labor budget in hours: Round your answers to two decimal places, if required.
| Greiner Company | ||||
| Direct Labor Budget (hours) | ||||
| For the First Quarter of the Coming Year | ||||
| January | February | March | Total | |
| Units produced | ||||
| Direct labor hours per unit | ||||
| Total labor budget (hours) | ||||
c. Direct materials cost budget:
| Greiner Company | ||||
| Direct Materials Cost Budget | ||||
| For the First Quarter of the Coming Year | ||||
| January | February | March | Total | |
| Units produced | ||||
| Cost per unit | $ | $ | $ | $ |
| Total direct materials | $ | $ | $ | $ |
d. Sales budget: Round unit selling price amounts to the nearest cent and use the same for subsequent requirements.
| Greiner Company | ||||
| Sales Budget (dollars) | ||||
| For the First Quarter of the Coming Year | ||||
| January | February | March | Total | |
| Unit sales | ||||
| Unit selling price | $ | $ | $ | $ |
| Total sales revenue | $ | $ | $ | $ |
2. Calculate the total budgeted contribution margin for Greiner Company by month and in total for the first quarter of the coming year. (CMA adapted)
| Greiner Company | ||||
| Budgeted Contribution Margin | ||||
| For the First Quarter of the Coming Year | ||||
| January | February | March | Total | |
| Sales revenue | $ | $ | $ | $ |
| Direct labor cost | ||||
| Materials cost | ||||
| Contribution margin | $ | $ | $ | $ |
In: Accounting
Production, Direct Labor, Direct Materials, Sales Budgets, Budgeted Contribution Margin
Greiner Company makes and sells high-quality glare filters for microcomputer monitors. John Craven, controller, is responsible for preparing Greiner’s master budget and has assembled the following data for the coming year. The direct labor rate includes wages, all employee-related benefits, and the employer’s share of FICA. Labor saving machinery will be fully operational by March. Also, as of March 1, the company’s union contract calls for an increase in direct labor wages that is included in the direct labor rate. Greiner expects to have 6,900 glare filters in inventory on December 31 of the current year, and has a policy of carrying 35 percent of the following month’s projected sales in inventory. Information on the first four months of the coming year is as follows:
| January | February | March | April | |
| Estimated unit sales | 35,600 | 35,600 | 40,800 | 39,200 |
| Sales price per unit | $83 | $83 | $76 | $76 |
| Direct labor hours per unit | 2.70 | 2.70 | 2.40 | 2.40 |
| Direct labor hourly rate | $16 | $16 | $18 | $18 |
| Direct materials cost per unit | $10 | $10 | $10 | $10 |
Required:
Unless otherwise indicated, round all calculated amounts to the
nearest dollar or unit.
1. Prepare the following monthly budgets for Greiner Company for the first quarter of the coming year.
a. Production budget in units:
| Greiner Company | ||||
| Production Budget (units) | ||||
| For the First Quarter of the Coming Year | ||||
| January | February | March | Total | |
| Unit sales |
35,600 |
35,600 |
40,800 |
39,200 |
| Desired ending inventory | ||||
| Total units required | ||||
| Less: Beginning inventory | ||||
| Units produced | ||||
Feedback
b. Direct labor budget in hours: Round your answers to two decimal places, if required.
| Greiner Company | ||||
| Direct Labor Budget (hours) | ||||
| For the First Quarter of the Coming Year | ||||
| January | February | March | Total | |
| Units produced | ||||
| Direct labor hours per unit |
2.7 |
2.7 |
2.4 |
|
| Total labor budget (hours) | ||||
Feedback
c. Direct materials cost budget:
| Greiner Company | ||||
| Direct Materials Cost Budget | ||||
| For the First Quarter of the Coming Year | ||||
| January | February | March | Total | |
| Units produced | ||||
| Cost per unit | $ | $ | $ | $ |
| Total direct materials | $ | $ | $ | $ |
Feedback
d. Sales budget: Round unit selling price amounts to the nearest cent and use the same for subsequent requirements.
| Greiner Company | ||||
| Sales Budget (dollars) | ||||
| For the First Quarter of the Coming Year | ||||
| January | February | March | Total | |
| Unit sales | ||||
| Unit selling price | $ | $ | $ | $ |
| Total sales revenue | $ | $ | $ | $ |
Feedback
2. Calculate the total budgeted contribution margin for Greiner Company by month and in total for the first quarter of the coming year. (CMA adapted)
| Greiner Company | ||||
| Budgeted Contribution Margin | ||||
| For the First Quarter of the Coming Year | ||||
| January | February | March | Total | |
| Sales revenue | $ | $ | $ | $ |
| Direct labor cost | ||||
| Materials cost | ||||
| Contribution margin | $ | $ | $ | $ |
In: Accounting
Production, Direct Labor, Direct Materials, Sales Budgets, Budgeted Contribution Margin
Greiner Company makes and sells high-quality glare filters for microcomputer monitors. John Craven, controller, is responsible for preparing Greiner’s master budget and has assembled the following data for the coming year. The direct labor rate includes wages, all employee-related benefits, and the employer’s share of FICA. Labor saving machinery will be fully operational by March. Also, as of March 1, the company’s union contract calls for an increase in direct labor wages that is included in the direct labor rate. Greiner expects to have 5,900 glare filters in inventory on December 31 of the current year, and has a policy of carrying 35 percent of the following month’s projected sales in inventory. Information on the first four months of the coming year is as follows:
| January | February | March | April | |
| Estimated unit sales | 35,600 | 34,600 | 39,000 | 39,800 |
| Sales price per unit | $82 | $82 | $76 | $76 |
| Direct labor hours per unit | 2.80 | 2.80 | 2.40 | 2.40 |
| Direct labor hourly rate | $19 | $19 | $20 | $20 |
| Direct materials cost per unit | $10 | $10 | $10 | $10 |
Required:
Unless otherwise indicated, round all calculated amounts to the
nearest dollar or unit.
1. Prepare the following monthly budgets for Greiner Company for the first quarter of the coming year.
a. Production budget in units:
| Greiner Company | ||||
| Production Budget (units) | ||||
| For the First Quarter of the Coming Year | ||||
| January | February | March | Total | |
| Unit sales | ||||
| Desired ending inventory | ||||
| Total units required | ||||
| Less: Beginning inventory | ||||
| Units produced | ||||
b. Direct labor budget in hours: Round your answers to two decimal places, if required.
| Greiner Company | ||||
| Direct Labor Budget (hours) | ||||
| For the First Quarter of the Coming Year | ||||
| January | February | March | Total | |
| Units produced | ||||
| Direct labor hours per unit | ||||
| Total labor budget (hours) | ||||
c. Direct materials cost budget:
| Greiner Company | ||||
| Direct Materials Cost Budget | ||||
| For the First Quarter of the Coming Year | ||||
| January | February | March | Total | |
| Units produced | ||||
| Cost per unit | $ | $ | $ | $ |
| Total direct materials | $ | $ | $ | $ |
d. Sales budget: Round unit selling price amounts to the nearest cent and use the same for subsequent requirements.
| Greiner Company | ||||
| Sales Budget (dollars) | ||||
| For the First Quarter of the Coming Year | ||||
| January | February | March | Total | |
| Unit sales | ||||
| Unit selling price | $ | $ | $ | $ |
| Total sales revenue | $ | $ | $ | $ |
2. Calculate the total budgeted contribution margin for Greiner Company by month and in total for the first quarter of the coming year. (CMA adapted)
| Greiner Company | ||||
| Budgeted Contribution Margin | ||||
| For the First Quarter of the Coming Year | ||||
| January | February | March | Total | |
| Sales revenue | $ | $ | $ | $ |
| Direct labor cost | ||||
| Materials cost | ||||
| Contribution margin | $ | $ | $ | $ |
In: Accounting
You have worked very hard on your phonebook program for many weeks and it is becoming a popular application with all your friends. You decide you want to compete with facebook.com and the next upgrade of your phonebook software should make contact data accessible even if the user closes your application and returns to it at a later time. Add additional functionality to your previous phonebook program. Make it possible for users to: 1) Store all entries in the phonebook into a location/file-name specified by the user. 2) Retrieve entries from the location/file-name specified by the user. If the user does not explicitly specify a path to the file, a default location of your choosing should be used. Answer needs to be in C Programming. Please and thank you.
Current code is:
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
// Creates an array for the input from the user
struct phonebook{
char firstname[100];
char lastname[100];
char phonenumber[100];
};
void addfriend(struct phonebook **, int *);
void deletefriend(struct phonebook **, int);
void showPhonebook(struct phonebook **);
//Listed below are the 4 new functions for this code
void sortByFirstName(struct phonebook **);
void findNumber(struct phonebook **);
void randomSelect(struct phonebook **);
void deleteAll(struct phonebook **);
int main()
{
int i;
// This will create an array of type struct for phonebook
struct phonebook **arr = (struct phonebook **)malloc(50 * sizeof(struct phonebook *));
// This integer will be the index at which a new entry will be added
int index = 0;
// This part of the code will set all entries of arr to NULL
for( i = 0 ; i < 50 ; i++ )
arr[i] = NULL;
while(1)
{
//Prints the menu for the user to select an option
printf("Phone Book Application\n");
printf(" 1) Add friend\n");
printf(" 2) Delete friend\n");
printf(" 3) Show phone book\n");
printf(" 4) Sort by first name\n");
printf(" 5) Find a phone number\n");
printf(" 6) Randomly select a friend\n");
printf(" 7) Delete all\n");
printf(" 8) Exit\n");
printf("\nWhat would you like to do?: ");
int option;
scanf("%d",&option);
switch(option)
//This section of the code states cases based on the users input
{
case 1 : addfriend(arr, &index);
break;
case 2 : deletefriend(arr, index);
break;
case 3 : showPhonebook(arr);
break;
case 4 : sortByFirstName(arr);
break;
case 5 : findNumber(arr);
break;
case 6 : randomSelect(arr);
break;
case 7 : deleteAll(arr);
break;
case 8 : sortByFirstName(arr);
exit(0);
default : printf("Please enter a choice listed \n");
exit(0);
}
}
return 0;
}
void addfriend(struct phonebook **arr, int *index)
{
struct phonebook *temp = (struct phonebook *)malloc(sizeof(struct phonebook));
printf("Please enter the name of the friend\n");
scanf("%s%s", temp->firstname, temp->lastname);
printf("Please enter their phone number\n");
scanf("%s", temp->phonenumber);
arr[*index] = temp;
(*index)++;
}
void deletefriend(struct phonebook **arr, int index)
{
char f[100], l[100];
printf("Please enter the name of the friend\n");
scanf("%s%s", f, l);
int i;
// This part of the code will locate the required contact
for( i = 0 ; i < 50 ; i++ )
// This part of the code will display the contact if found
if(arr[i] && !strcmp(arr[i]->firstname, f) && !strcmp(arr[i]->lastname, l))
// This part of the code sets arr to NULL
arr[i] = NULL;
}
void showPhonebook(struct phonebook **arr)
{
int i;
for( i = 0 ; i < 50 ; i++ )
// This part of the code will display the contact if arr is is not NULL
if(arr[i])
printf("Name : %s %s\nPhone Number : %s\n\n",arr[i]->firstname, arr[i]->lastname, arr[i]->phonenumber);
}
// This part of the code creates a function that will sort the phonebook entries by first name
void sortByFirstName(struct phonebook **arr)
{
int i,j;
// This part of the code helps store the temp data
char *temp1= (char*)malloc(sizeof(char)*100);
char *temp2=(char*)malloc(sizeof(char)*100);
char *temp3=(char*)malloc(sizeof(char)*8);
for(i=0;i<50;i++)
{
if(arr[i])
for(j=i+1;j<50;j++)
{
if(arr[j])
if(strcmp(arr[j]->firstname,arr[i]->firstname)<0)// This part of the code will compare the names found in the phonebook
{
strcpy(temp1,arr[j]->firstname);// This part of the code will copy to the temp
strcpy(temp2,arr[j]->lastname);
strcpy(temp3,arr[j]->phonenumber);
strcpy(arr[j]->firstname,arr[i]->firstname);// This part of the code will change te array index value
strcpy(arr[j]->lastname,arr[i]->lastname);
strcpy(arr[j]->phonenumber,arr[i]->phonenumber);
strcpy(arr[i]->firstname,temp1);
strcpy(arr[i]->lastname,temp2);
strcpy(arr[i]->phonenumber,temp3);
}
}
}
showPhonebook(arr);// This part of the code will print all of the names found in the phonebook
}
void findNumber(struct phonebook **arr)
{
char f[20], l[20];
printf("Please enter the name of the friend\n");
scanf("%s%s", f, l);
int i;
for( i = 0 ; i < 50 ; i++ ){
// This part of the code will attempt to locate the friend's name in the phonebook
if(arr[i] && !strcmp(arr[i]->firstname, f) && !strcmp(arr[i]->lastname, l)){
// This part of the code will print the phone number if the name is located.
printf("Phone number : %s\n",arr[i]->phonenumber);
return;
}
}//if name not found
printf("Sorry, but this name was not found. \n");
}
// This part of the code allows the user to select a random friend from the phonebook
void randomSelect(struct phonebook **arr)
{
int i;
//This part of the code creates a loop
while(1){
// This part of the code will generate a random number between 0 and 50
i = rand() % 50;
if(arr[i])// If the number generated is not between the two prior numbers, it will be NULL
{
printf("Name : %s %s\nPhone Number : %s\n\n",arr[i]->firstname, arr[i]->lastname, arr[i]->phonenumber);
break;
}
}
}
// This part of the code will allow the user to delete all of the entries in the phonebook
void deleteAll(struct phonebook **arr){
int i;
for( i = 0 ; i < 50 ; i++ )
arr[i] = NULL;
}
In: Computer Science
A bicycle racer sprints at the end of a race to clinch a victory. The racer has an initial velocity of 11.2 m/s and accelerates at the rate of 0.3 m/s2 for 6.9 s.
a)The racer continues at this velocity to the finish line. If he was 293 m from the finish line when he started to accelerate, how much time did he save (in s)?
b)One other racer was 5 m ahead when the winner started to accelerate, but he was unable to accelerate, and traveled at 11.5 m/s until the finish line. How far ahead of him (in seconds) did the winner finish?
c) How far ahead of him (in meters) did the winner finish?
A fast elevator in a skyscraper is employing the following scheme to get from the starting level to the desired level: For the first half of the time it accelerates at the maximum allowed acceleration of 1.0 m/s2 and for the second half it decelerates at the maximum allowed acceleration of −1.0 m/s2. How long does it take (in seconds) to go from ground level to the highest level at 80 m elevation?
A track team is practicing for a 4 × 100 m relay race. The first runner, Linda, is running at a constant speed of 8.6 m/s. The next runner, Jenny, will be starting from rest at the 80 m mark. She has an acceleration of 1.0 m/s2. Ideally the two runners meet at the 100 m mark to hand over the baton. At this point, Jenny is still accelerating.
a) How long does it take Jenny to run from the 80-m mark to the 100-m mark?
b) At what distance behind Jenny should Linda be when Jenny starts running? (Assume for simplicity that there is no distance between the two runners when the switch happens.)
c) What’s Jenny’s speed at the 100m mark?
In: Physics
Consider the following stock price and shares outstanding information.
| DECEMBER 31, Year 1 | DECEMBER 31, Year 2 | |||||||
Price | Shares Outstanding | Price | Shares Outstanding | |||||
| Stock K | $18 | 109,000,000 | $33 | 109,000,000 | ||||
| Stock M | 74 | 2,300,000 | 49 | 4,600,000a | ||||
| Stock R | 35 | 26,000,000 | 39 | 26,000,000 | ||||
| aStock split two-for-one during the year. | ||||||||
Compute the beginning and ending values for a price-weighted index and a market-value-weighted index. Assume a base value of 100 and Year 1 as the base period. Do not round intermediate calculations. Round your answers to two decimal places.
PWIYear 1:
PWIYear 2:
VWIYear 1:
VWIYear 2:
Compute the percentage change in the value of each index during the year. Do not round intermediate calculations. Round your answers to two decimal places.
Percentage change in PWI: %
Percentage change in VWI: %
Compute the percentage change for an unweighted index assuming $1,000 is invested in each stock. Do not round intermediate calculations. Round your answer to two decimal places.
%
In: Finance
Scenario: American Airlines (AA) is trying to maximize profits on a certain international route with two kinds of travelers: vacationers (Group A) and business travelers (Group B). AA can effectively distinguish between the two types and can discriminate in pricing. Although fixed costs matter a lot for the calculation of profits, they do not matter for purposes of optimal pricing, so we’ll ignore them for now; however, we cannot ignore marginal cost, which we will assume is a constant $100 per traveler. (For purposes of calculating total profit below, you can assume no fixed costs, for convenience.) Demand for each type of traveler is given by the following equations, where Qi and Pi is the quantity and price for type i:
QA = 1400 – 2PA QB = 1000 – PB
Show your work here:
Solutions:
|
Price to type A: |
|
|
Price to type B: |
|
|
Quantity of type A: |
|
|
Quantity of type B: |
|
|
Total Profit: |
In: Economics
Consider the following stock price and shares outstanding information. DECEMBER 31, Year 1 DECEMBER 31, Year 2 Price Shares Outstanding Price Shares Outstanding Stock K $22 108,000,000 $33 108,000,000 Stock M 86 2,200,000 46 4,400,000a Stock R 37 21,000,000 42 21,000,000 aStock split two-for-one during the year. Compute the beginning and ending values for a price-weighted index and a market-value-weighted index. Assume a base value of 100 and Year 1 as the base period. Do not round intermediate calculations. Round your answers to two decimal places.
PWIYear 1:
PWIYear 2:
VWIYear 1:
VWIYear 2:
Compute the percentage change in the value of each index during the year. Do not round intermediate calculations. Round your answers to two decimal places.
Percentage change in PWI: %
Percentage change in VWI: %
Compute the percentage change for an unweighted index assuming $1,000 is invested in each stock. Do not round intermediate calculations. Round your answer to two decimal places.
%
In: Finance
Cenario:
Aristotle Murphy owns movie theatres in two towns of roughly the same size, 100 kilometers apart. In Monopolia, he owns the only chain of theatres (he is a monopolist). In Competitia, there is no theatre chain and he is only one of a number of independent theatre operators.
note
In Monopolia Mr. Murphy will be a price maker (since he is a monopolist there), but in Competitia he is a more of a price taker (since he is facing monopolistic competition). Therefore one can expect his price to be lower in Competitia in both the short and long runs. He is also practicing price discrimination because he is charging two different prices for the same product because he is able to separate his customers into two different markets due to the distance between the towns.
THE Question is:
Aristotle is adamant that he does NOT want to lower his prices in Monopolia in the long run, even when new competitors appear on the scene. If you are his business consultant, how can you help him do this? What specific tactics and rationale would you advise?
In: Economics