PLEASE PROVIDE COMMENTS TO BE ABLE TO UNDERSTAND CODE
C++
Inventory Class
Create an inventory class. The class will have the following data members,
const int size = 100;
int no_of_products; // the total number of products in the
inventory. char name_array[size][15] ; // stores name of
products
double array [size][2]; // In the first column quantity of the
product and in the second column the price per item of the product
is stored.
name_array stores the name of products, it is assumed that the length of the product name is at most 14 characters and each name is null terminated ( See Table 1. for an example )
For each product, the two-dimensional array will store two pieces of information, the current stock in number of pieces and the per unit price. We note that the information for a given product will be stored in the same row in the one-dimensional and two-dimensional arrays ( See Table 2. for an example).
The class should provide the following functions.
Constructor function: The function receives no parameters but initializes the elements of the double array to zero and the first element of each row of the char array to a null character.
int row_no( char *product name): Function receives the name of the product and returns the number of the row that contains the information for this product in the two-dimensional arrays. This function may be used by other functions when needed.
int get_stock ( char *product_name): Function receives the name of the product and returns the current amount of the product in the stock.
double order( char *product_name, int quantity): The function will check if the requested quantity of the stock is available. If the requested quantity is available drop from the stock and return the total cost of the order, otherwise order cannot be met and return zero.
bool new_product( char *product_name, int quantity, double price): If there is an empty entry available in the arrays, then, a new product is added to the inventory. The new product should be added to the first available entries in the two-dimensional arrays. After that the function increases the number of different products in the inventory by one and returns true. If no space is available in the arrays, then, product can not be added to the inventory and the function returns false.
void discontinued_product( char *product_name); // If a product is discontinued, the function should set the entry of this item in the two- dimensional array zero and the first element of the row for this product in the two-dimensional name_array to a null character. This entry becomes available for adding new product to the inventory. Reduce the number of different products in the inventory by one.
Write the implementation of this class as well as test it with a driver program.
Note : In this problem you are not allowed to use string class or any of the string library functions.
|
c |
a |
m |
e |
r |
a |
\0 |
||||||||
|
t |
e |
l |
e |
v |
i |
s |
i |
o |
n |
\0 |
||||
|
\0 |
||||||||||||||
|
c |
o |
m |
p |
u |
t |
e |
r |
\0 |
||||||
|
\0 |
||||||||||||||
|
r |
e |
f |
r |
i |
g |
e |
r |
a |
t |
o |
r |
\0 |
||
|
o |
v |
e |
n |
\0 |
||||||||||
|
\0 |
||||||||||||||
|
\0 |
||||||||||||||
|
\0 |
Table 1. Stores the product names
|
12 |
625.00 |
|
17 |
410.00 |
|
0 |
0 |
|
8 |
750.00 |
|
0 |
0 |
|
6 |
975.00 |
|
9 |
550.00 |
|
0 |
0 |
|
0 |
0 |
|
0 |
0 |
Table 2. First column stores the stock in the inventory and second
In: Computer Science
Complete the following assignment in C programming language.
In: Computer Science
"You have just turned 22 years old, received your bachelor’s degree, and accepted your first job. Now you must decide how much money to put into your retirement plan. The plan works as follows: Every dollar in the plan earns 7% per year. You cannot make withdrawals until you retire on your 65th birthday. After that, you can make withdrawals as you see fit. You decide that you will plan to live to 100 and work until you turn 65. You estimate that to live comfortably in retirement, you will need $100,000 per year, starting at the end of the first year of retirement and ending on your 100th birthday. You will contribute the same amount to the plan at the end of every year that you work. How much do you need to contribute each year to fund your retirement?" Starting Age 22 Investment Return 7.0% Retirement Age 65 Planned Lifespan 100 Retirement Income $100,000 Needed Retirement Savings Required Annual Contribution
In: Finance
Complete the following assignment in C programming language.
In: Computer Science
A manager receives a forecast for next year. Demand is projected to be 600 units for the first half of the year and 900 units for the second half. The monthly holding cost is $2 per unit, and it costs an estimated $55 to process an order.
a. Assuming that monthly demand will be level during each of the six-month periods covered by the forecast (e.g., 100 per month for each of the first six months), determine an order size that will minimize the sum of ordering and carrying costs for each of the six-month periods. (Round your answers to the nearest whole number.)
Period Order Size 1 – 6 months units
7 – 12 months units
b. If the vendor is willing to offer a discount of $10 per order for ordering in multiples of 50 units (e.g., 50, 100, 150), would you advise the manager to take advantage of the offer in either period? If so, what order size would you recommend? (Round intermediate calculations to 2 decimal places.)
Period Order Size
1 – 6 months units
7 – 12 months units
In: Operations Management
Output per month Price Total
Revenue Total Cost Total Profit
Marginal
Revenue* Marginal Cost* Average Total
Cost Profit per Unit (Price Minus Average Cost)
0 $ 1,000 $ 0 $
60,000 -$60,000 - -
- -
100 1,000 100,000
90,000 10,000 $ 1,000 $
300 $900 $100
200 1,000 200,000
130,000 70,000 1,000
400 650 350
300 1,000 300,000
180,000 120,000 1,000
500 600 400
400 1,000 400,000
240,000 160,000 1,000
600 600 400
500 1,000 500,000
320,000 180,000 1,000
800 640 360
600 1,000 600,000
420,000 180,000 1,000
1,000 700 300
700 1,000 700,000
546,000 154,000 1,000
1,260 780 220
800 1,000 800,000
720,000 80,000 1,000
1,740 900 100
900 1,000 900,000
919,800 -19,800 1,000
1,998 1,022 -22
*Note that output levels are calibrated in hundreds in this
example; that's why we have divided the change in total costs and
revenues from one output level to another by 100 to calculate
marginal revenue and marginal cost. Very few manufacturers deal in
units of 1.
(a) What were the fixed costs of production for the firm?
$
(b) At what rate of output was profit per computer maximized?
(Choose the highest output level.)
computers per month
(c) At what output rate was total profit maximized? (Choose the highest output level.)
computers per month
In: Economics
1. Consider the following table that provides information for a firm’s short-run production function and its product demand, given by the column labeled D1.
|
Labor |
Output |
Price (D1) |
|
0 |
0 |
$10.00 |
|
1 |
16 |
10.00 |
|
2 |
31 |
10.00 |
|
3 |
45 |
10.00 |
|
4 |
58 |
10.00 |
|
5 |
69 |
10.00 |
|
6 |
78 |
10.00 |
Based on that information, calculate Total Revenue (TR), Marginal Revenue Product (MRP), Marginal Product of Labor (MP) and Value of the Marginal Product (VMP), then answer the following questions:
Assume that the labor market is perfectly competitive. If the wage rate is $100, how many workers should the firm hire in order to achieve maximum profit?
Assume that the labor market is perfectly competitive. If the wage rate rises from $100 to $135, how many workers will the firm fire?
Based on your previous answers, what is the wage elasticity of this firm’s labor demand when wage increases from $100 to $135?
Assume that the labor market is perfectly competitive. Suppose the firm’s product demand is now given by the column labeled D2. Calculate Total Revenue (TR), Marginal Revenue Product (MRP), Marginal Product of Labor (MP) and Value of the Marginal Product (VMP). If the wage rate is $100, how many workers should the firm hire in order to achieve maximum profit?
|
Labor |
Output |
Price (D2) |
|
0 |
0 |
$10.00 |
|
1 |
16 |
9.50 |
|
2 |
31 |
9.00 |
|
3 |
45 |
8.50 |
|
4 |
58 |
7.50 |
|
5 |
69 |
6.50 |
|
6 |
78 |
5.50 |
In: Economics
Suppose the initial conditions of the economy are characterized by the following equations. In this problem, we assume that prices are fixed at 1 (the price index is 100 and when we deflate, we use 1.00) so that nominal wealth equals real wealth.
1) C = a0 + a1 (Y - T) + a2 (WSM) + a3 (WRE) + a4 (CC) + a5 (r)
1’) C = a0 + a1 (Y - 200) + a2 (10,000) + a3 (15,000) + a4 (100) + a5 (3)
2) I = b0 + b1 AS + b2 CF + b3 (r)
2’) I = b0 + b1 (150) + b2 (2000) + b3 (3)
3) G = G
3’) G = 300
4) X - M = X - M
4’) X - M = - 100
Where: a0 = 165 , a1 = .75, a2 = .05, a3 = .10, a4 = .8, a5 = - 500, b0 = 210, b1 = .5, b2 = .5, b3 = - 200
Derive an expression for the aggregate expenditure curve and graph it on your exam sheet labeling this initial equilibrium output as point A. Also, add this point A to your consumption function. Show all work.
Draw an aggregate demand and an aggregate supply curve in the right hand graph on your exam sheet identifying this initial point as point A.
NOTE: We are holding the price level fixed at 100 in this problem. Also, note that you that you cannot derive an expression for the aggregate demand curve, just draw it with a negative slope going through point A.
In: Economics
You have been hired as a consultant for the following perfectly competitive firms firms. Treat each firm individually. Thus each row represents one firm. You will need to use the MR =MC analysis rules to make the recommendations to the firms. You will be using logic and critical thinking skills to make the suggestions.
Examine the information on MR, MC, Price, ATC, AVC and AFC to make a recommendation to each firm.
Remember firms want to max their total profits, they are not altruistic.
Secondly, recall the rules of profit maximization, minimizing losses, and shutdown cases for perfect competition. Apply those rules to each row to make a recommendation to each firm as to whether or not they are able to maximize profits; minimize losses; or should the firm shut down. Finally what happens to firms in the long run? Record your answers for each row and submit them to the dialog box for this assignment by the due date listed in assignments.
Below are the 4 competitors who want to max their profits. Please advise them as to what decisions they should make to accomplish this.
PC firms
Price Q TR TC P/L TVC ATC AVC MC
4 100 400 350 +50 300 3.5 3 5
10 20 200 500 -300 300 25 15 10
50 100 5000 5100 -100 3000 51 30 90
25 100 2500 2500 0 2000 25 20 25
In: Economics
A stock will pay a dividend of $1 in one month and $2 in four months. The relevant risk-free rate of interest based on continuous compounding is 12%. The current price of the stock is $90.
In: Finance