Goals
In this assignment you must use Java language to program the small application for a grocery buyer.
You will create meaningful utility that implements
The implementation plus coding style and efficiency will be graded.
Description
The supermarket uses three pricing scenarios for the local products –
Your application must calculate how much you pay for one item depending on a regular price, day of the week, and number of items.
For example, yogurt has regular price of $3. Then, if you buy 3 yogurts on Sunday your spending will be $2 per item.
It is not as simple as it first appears. Consider the following questions before programming:
Program requirements
There is no any sample run, just need a JAVA program to conform the
above requirements.
In: Computer Science
Costs and Profit Maximization: Work It Out 5
Suppose Margie decides to lease a photocopier and open up a black‑and‑white photocopying service in her dorm room for use by faculty and students. Her total cost, as a function of the number of copies she produces per month, is given in the table.
| Number of Photocopies Per Month | Total Cost | Fixed Cost | Variable Cost | Total Revenue | Profit |
|---|---|---|---|---|---|
| 0 | $100 | $100 | $0 | $0 | -$100 |
| 1,000 | $110 | $100 | $10 | $60 | -$50 |
| 2,000 | $125 | $100 | $25 | $120 | -$5 |
| 3,000 | $145 | $100 | $45 | $180 | $35 |
| 4,000 | $175 | $100 | $75 | $240 | $65 |
| 5,000 | $215 | $100 | $115 | $300 | $85 |
| 6,000 | $285 | $100 | $185 | $360 | $75 |
c. If the lease rate on the copier were to increase by $50 per month, how would that impact Margie’s profit‑maximizing level of output?
Margie would
have to decrease output to maximize profits.
have to increase output to maximize profits.
not change her level of output.
What will she do when it is time to renew her lease?
Margie will
renew her lease since she is still making above‑normal profits despite the increase in rent.
renew her lease only if she can renegotiate the rent to its previous levels.
not renew her lease since her profits have decreased.
How would this $50 increase in the lease rate affect Margie's profit?
Margie's profit would
decrease.
increase.
stay the same.
In: Economics
Is there a shortcut or simpler way to get the same output in C ?
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#define OFFSET 1
#define RANGE 53
int RandomInteger(int, int);
int PrintInstructions();
int main()
{
//six integer variables
int a, b, c, d, e, f;
//one integer for num of sets
int numSets;
srand(time(NULL));
while (1)
{
int i;
numSets = PrintInstructions();
if (numSets == 0)
{
printf("* You have choosen to exit the application.\n");
break;
}
for (i = 1; i <= numSets; i++)
{
a = RandomInteger(RANGE, OFFSET);
do
{
b = RandomInteger(RANGE, OFFSET);
} while (b == a);
do
{
c = RandomInteger(RANGE, OFFSET);
} while (c == a || c == b);
do
{
d = RandomInteger(RANGE, OFFSET);
} while (d == a || d == b || d == c);
do
{
e = RandomInteger(RANGE, OFFSET);
} while (e == a || e == b || e == c || e == d);
do
{
f = RandomInteger(RANGE, OFFSET);
} while (f == a || f == b || f == c || f == d || f == e);
printf("* Set # %d of six numbers is: %d %d %d %d %d %d\n", i, a, b, c, d, e, f);
}
}
return 0;
}
int RandomInteger(int range, int offset)
{
int randomNum = rand() % RANGE + OFFSET;
return randomNum;
}
int PrintInstructions()
{
int numSets = 0;
printf("*************************************************************************\n");
printf(" Enter in the number of randomly generated sets of numbers you want or \n");
printf(" enter in a 'q' or 'Q' to quit. \n");
printf("*************************************************************************\n");
printf("* Your Input: ");
scanf("%d", &numSets);
return numSets;
}
In: Computer Science
This is my code for an array using the bubblesort in the function outside of main. My bubblesort is not working correctly , and I was told i'm missing a +j instead of +i in the function for void sorter.Can someone please help me with making my sorter work properly? everything else is fine and runs great. Thank you
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void printer(int *ptr, int length);
void randomFill(int *ptr, int length);
void sorter(int *ptr, int length);
int main(void)
{
int size =30;
int array[size];
int *myPointer;
myPointer = array;
int i;
for(i =0; i<size; i++)
{
*myPointer = 0;
myPointer++;
}
printf("\nArray before:\n\n");
printer(array, size);
randomFill(array, size);
printf("\nArray after insert:\n\n");
printer(array, size);
sorter(array, size);
printf("\nArray after sort:\n\n");
printer(array, size);
return 0;
}
void printer(int *ptr, int length)
{
int i =0;
for(i =0; i<length; ++i)
printf("a[%d] = %d\n\n", i, *(ptr + i));
}
void randomFill(int *ptr, int length)
{
srand(time(NULL));
int i;
for(i =0; i<length; i++)
{
*ptr = (rand()% (205-55+1)) + 55;
ptr++;
}
}
void sorter(int *ptr, int length)
{
int i, j, temp;
for(i =0; i<length; i++)
{
for(j = i+1; j<length; j++)
{
if(*(ptr +i) > *(ptr +j))
{
temp = *(ptr + i);
*(ptr + i) = *(ptr + j);
*(ptr + j) = temp;
}
}
}
}
In: Computer Science
Your brother Joe is a surgeon who suffers badly from the overconfidence bias. He loves to trade stocks and believes his predictions with 100% confidence. In fact, he is uninformed like most investors. Rumors are that Vital Signs (a startup that makes warning labels in the medical industry) will receive a takeover offer at $0.62 per share. Absent the takeover offer, the stock will trade at $15.05 per share. The uncertainty will be resolved in the next few hours. Your brother believes that the takeover will occur with certainty and has instructed his broker to buy the stock at any price less than $20.62. In fact, the true probability of a takeover is 50%, but a few people are informed and know whether the takeover will actually occur. They also have submitted orders. Nobody else is trading in the stock.
a. Describe what will happen to the market price once these orders are submitted if in fact the takeover will occur in a few hours. What will your brother's profits be: positive, negative or zero?
b. What range of possible prices could result once these orders are submitted if the takeover will not occur. What will your brother's profits be: positive, negative or zero?
c. What are your brother's expected profits?
In: Finance
A village has six residents, each of whom has accumulated savings of $100. Each villager can use this money either to buy a government bond that pays 18 percent interest per year or to buy a year-old llama, send it onto the commons to graze, and sell it after 1 year. The price the villager gets for the 2-year-old llama depends on the quality of the fleece it grows while grazing on the commons. That in turn depends on the animal’s access to grazing, which depends on the number of llamas sent to the commons, as shown in the following table: Number of llamas on the commons Price per 2-year-old llama ($) 1 125 2 119 3 116 4 113 5 111 6 109 The villagers make their investment decisions one after another, and their decisions are public.
c. The village
committee votes to auction the right to graze llamas on the commons
to the highest bidder. Assuming villagers can both borrow and lend
at 18 percent annual interest, how much will the right sell for at
auction?
Instructions: Enter your response rounded to two
decimal places.
$
What will be the
resulting village income?
Instructions: Enter your response as a whole
number.
Village income: $
In: Economics
Cendana Berhad has made a profit of RM3 million last year. From those earnings, the company paid the dividend of RM2.00 on each of its 1,000,000 common shares outstanding. The capital structure of the company includes 30% debt, 20% preferred shares and 50% common shares. The corporate tax rate is 28%. The company wishes to venture into a new project and decided to use debt, preferred shares and common shares as sources of financing and still maintaining its current capital structure ratio. Based on the following information, calculate the weighted average cost of capital (WACC) of the company for taking the new project.
You are required to calculate:
i. The market price of its common share is RM12 and dividend are expected to grow at constant rate of 6% and flotation costs on its new common shares are RM1.50 per share.
ii) The company can issue 3% dividend preferred shares at a market price of RM10 per share and flotation cost of RM1.00 per share.
iii. The company can issue 7%, 5 years bonds that can be sold for RM1, 100 each in the market and flotation cost of RM5 per bond.
iv. WACC for taking the new project :
In: Finance
Two firms compete in selling identical widgets. They choose their output levels Upper Q1 and Q2 simultaneously and face the demand curve:
P=100? Q, where Q=Q1+Q2.
Until recently, both firms had zero marginal costs. Recent environmental regulations have increased Firm 2's marginal cost to $50. Firm 1's marginal cost remains constant at zero.
True or false: As a result, the market price will rise to the monopoly level. As a result of Firm 2's marginal cost rising to $50 , the market price:
a)will rise to the monopoly level because Firm 2 will not produce.
b)will rise to the monopoly level because each firm will produce half the monopoly output level.
c)will rise to the monopoly level because both firms will produce less output.
d) will not rise to the monopoly level because Firm 1 will not be profitable.
e) will not rise to the monopoly level because one firm can produce at lower cost than multiple firms.
I am looking for a detailed answer, so please show your work. It is very important for me to understand and learn how to solve this problem.
In: Economics
Performance Tires plans to engage in direct mail advertising. It is currently in negotiations to purchase a mailing list of the names of people who bought sports cars within the last three years. The owner of the mailing list claims that sales generated by contacting names on the list will more than pay for the cost of using the list. (Typically, a company will not sell its list of contacts, but rather provides the mailing services. For example, the owner of the list would handle addressing and mailing catalogs.)
Before it is willing to pay the asking price of $3 per name, the company obtains a sample of 225 names and addresses from the list in order to run a small experiment. It sends a promotional mailing to each of these customers. The data for this exercise show the gross dollar value of the orders produced by this experimental mailing. The company makes a profit of 20% of the gross dollar value of a sale. For example, an order for $100 produces $20 in profit.
Should the company agree to the asking price?
this is one part of the question i am stuck on the other 3 parts i did already
How is the certainty of your decision dependent on the number of names in the sample list? How would, for example, doubling the number of sample names change the certainty of your decision?
In: Statistics and Probability
Sonic Inc. manufactures two models of speakers, Rumble and Thunder. Based on the following production and sales data for June, prepare (a) a sales budget and (b) a production budget.
| Rumble | Thunder | ||
| Estimated inventory (units), June 1 | 274 | 81 | |
| Desired inventory (units), June 30 | 315 | 70 | |
| Expected sales volume (units): | |||
| East Region | 3,250 | 2,850 | |
| West Region | 5,750 | 6,500 | |
| Unit sales price | $100 | $195 |
a. Prepare a sales budget.
| Sonic Inc. | |||
| Sales Budget | |||
| For the Month Ending June 30 | |||
Product and Area |
Unit Sales Volume |
Unit Selling Price |
Total Sales |
| Model Rumble: | |||
| East Region | $ | $ | |
| West Region | |||
| Total | $ | ||
| Model Thunder: | |||
| East Region | $ | $ | |
| West Region | |||
| Total | $ | ||
| Total revenue from sales | $ | ||
Feedback
b. Prepare a production budget.
| Sonic Inc. | ||
| Production Budget | ||
| For the Month Ending June 30 | ||
| Units Model Rumble | Units Model Thunder | |
| Expected units to be sold | ||
|
||
| Total units required | ||
|
||
| Total units to be produced | ||
In: Accounting