I need help with Part 2! Coded in Java please!
Abby wants to start a backyard chicken egg business. As any good she wants to “count the costs” of such an operation to determine if she can make a profit. While there are a number of variables, naturally the most influential ones are:
Not being much of a programmer yet, she needs your help by writing a program which will help her assess the viability of her venture. The program should fulfill the following requirements:
Part 1:
Part 2:
Hint: The easiest way to do this is to let the percent be controlled in a for-loop varying from -25 to 25 with a step of 5.
Part 3:
Using UMLet or Draw.IO draw an activity diagram to document your programs implementation.
import java.util.Scanner;
public class profit_part1 {
int profit(int num_of_chickens,int eggs_perchicken_perday,int feed_perchicken_perday,int cost_perfeed_pound,int empty_cartoon_cost,int cost_of_one_egg)
{ if(num_of_chickens==0)
return 0;
int profit_per_day=0;
profit_per_day=(eggs_perchicken_perday*num_of_chickens*cost_of_one_egg)-(feed_perchicken_perday*cost_perfeed_pound*num_of_chickens)-empty_cartoon_cost;
int profit_per_month=profit_per_day*30;
int per_dozen=0;
per_dozen=(profit_per_month/(num_of_chickens*eggs_perchicken_perday*30))*12;
System.out.println("The cost per month is: "+profit_per_month);
System.out.println("The cost of per dozen egg is: "+per_dozen);
return 1;
}
}
public class profit_part2 {
int profit(int num_of_chickens,int eggs_perchicken_perday,int feed_perchicken_perday,int cost_perfeed_pound,int empty_cartoon_cost,int cost_of_one_egg)
{ if(num_of_chickens==0)
return 0;
double profit_per_day=0;
double new_feed_cost=0;
//for the feed cost varying from -25% to 0%
for(double i=25;i>=0;i=i-5)
{
new_feed_cost=cost_perfeed_pound-((i/100)*cost_perfeed_pound);
profit_per_day=(eggs_perchicken_perday*num_of_chickens*cost_of_one_egg)-(feed_perchicken_perday*new_feed_cost*num_of_chickens)-empty_cartoon_cost;
double profit_per_month=profit_per_day*30;
double per_dozen=0;
per_dozen=(profit_per_month/(num_of_chickens*eggs_perchicken_perday*30))*12;
System.out.println("the cost per dozen is: "+per_dozen);
}
//for the feed cost varying from 5% to 25%
for(double i=5;i<=25;i=i+5)
{
new_feed_cost=cost_perfeed_pound+((i/100)*cost_perfeed_pound);
profit_per_day=(eggs_perchicken_perday*num_of_chickens*cost_of_one_egg)-(feed_perchicken_perday*new_feed_cost*num_of_chickens)-empty_cartoon_cost;
double profit_per_month=profit_per_day*30;
double per_dozen=0;
per_dozen=(profit_per_month/(num_of_chickens*eggs_perchicken_perday*30))*12;
System.out.println("the cost per dozen is: "+per_dozen);
}
return 1;
}
}
public class main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int num_of_chickens, eggs_perchicken_perday, feed_perchicken_perday, cost_perfeed_pound, empty_cartoon_cost, cost_of_one_egg;
num_of_chickens = sc.nextInt();
eggs_perchicken_perday =sc.nextInt();
feed_perchicken_perday=sc.nextInt();
cost_perfeed_pound=sc.nextInt();
empty_cartoon_cost=sc.nextInt();
cost_of_one_egg=sc.nextInt();
profit_part1 p1=new profit_part1();
p1.profit(num_of_chickens, eggs_perchicken_perday, feed_perchicken_perday, cost_perfeed_pound, empty_cartoon_cost, cost_of_one_egg);
profit_part2 p2=new profit_part2();
p2.profit(num_of_chickens, eggs_perchicken_perday, feed_perchicken_perday, cost_perfeed_pound, empty_cartoon_cost, cost_of_one_egg);
}
}
I need help with Part 2! Coded in Java please! Abby wants to start a backyard...
Code in Java please, I am very confused... Abby wants to start a backyard chicken egg business. As any good she wants to “count the costs” of such an operation to determine if she can make a profit. While there are a number of variables, naturally the most influential ones are: Number of chickens Average number of eggs laid per day per chicken Pounds of feed per chicken per day Cost per pound for feed Empty carton cost Not being...
Hey guys, I need help writing a Tic-Tac-Toe game programmed in Java. The game has to be a 1D (One-Dimension) array board NOT 2D. It has to be a human plays against the computer type of Tic-Tac-Toe. Here is the requirements for the program. PLEASE NO COPY AND PASTE ANSWER. Thank you in advance! You will develop a program in which a human plays against the computer. 1. Validate user input at every opportunity. a. Do not allow number entries...
I mainly need help with the second part. Thank you in advance! Starbucks launched its prepaid (debit) Starbucks Card in November 2001. The card, which holds between $5 and $500 can be used at any Starbucks location. Suppose Starbucks management wants to study the reasons why some people purchase debit cards with higher prepaid amounts than do other people. Suppose a study of 25 randomly selected prepaid purchasers is taken. Respondents are asked the amount of the prepaid card, the...
Can you please help me with creating this Java Code using the following pseudocode? Make Change Calculator (100 points + 5 ex.cr.) 2019 In this program (closely related to the change calculator done as the prior assignment) you will make “change for a dollar” using the most efficient set of coins possible. In Part A you will give the fewest quarters, dimes, nickels, and pennies possible (i.e., without regard to any ‘limits’ on coin counts), but in Part B you...
(I just need Question 2)Please show the steps
clearly
contract to produce 10 items of x per week for a particular customer. • Part (a). Formulate the problem of deciding how much to produce per week as a linear program. • Part (b). Draw the feasible region of your LP formulation. • Part (c). Find the optimal solution of your LP model using graphical solution method. 2. Consider a factory that produces tables. The demand for the tables is known...
For number 2, I need help with part C.
BELOW THESE ARE WRONG ANSWERS FOR NUMBER 2.
1.092
30.876
17.575
41.425
Demand for a book at Amazon.com is 220 units per week. The product is supplied to Amazon from a factory. The factory charges Amazon $8 per book, while the total cost of shipping an order from the factory to the Amazon, when the shipment size is Q, is given by Shipment cost = $60 + 20 Assume the annual...
i need help with d-1 d-2 and e please!
Problem 7-15 Chec The Goodparts Company produces a component that is subsequently used in the aerospace industry. The component consists of three parts (A, B, and C) that are purchased from outside and cost 35, 30, and 10 cents per piece, respectively. Parts A and B are assembled first on assembly line 1, which produces 110 components per hour. Part C undergoes a drilling operation before being finally assembled with the...
Please help, need to code for this business assignment using
c++.
Business Expense Reimbursements Calculator Problem statement: Business trip is part of the enterprise culture. Suppose a businessperson just completed a business trip for your company. Now, you are tasked to write a program that calculates and displays the total travel expenses, allowable expenses for the trip, and the excess that must be paid by the businessperson, if any The program should prompt the user for the following . The...
I need help with this assignment. It's due Tuesday at 8 AM.
Please follow the instructions thoroughly as to not use any
advanced material we may not have gone over in class. The
instructions let you know what all should be used. Thanks!
Use only what you have learned in Chapters 1 - 7. Use of "advanced" material, material not in the text, or project does not follow the instructions, will result in a GRADE OF 0% for the project....
please help me with part 2 question
Α. D ΕΕ ADC UTUP AS Tent Kolbec Community College (KCC) has 4,000 full-time students and offers a variety of academic programs in three areas: professional studies, arts, and technology. The professional studies programs prepare students for administrative and clerical jobs in a variety of professional settings, including accounting, medicine, and law. The arts program's offerings are wide ranging and include graphic design, digital animation, culinary arts, cosmetology, and music arts. The technology...