Computer Science, asked by nevxrgxveup, 3 months ago

roblem #1: [35 pts] Profit calculation for an Avocado farm
Write a program that helps a farmer predict his profit by planting Avocado trees in his land. The farmer is
required to enter the dimensions of his land in meters (rectangular land with a width and length) and the
number of years of prediction. Then, the program will tell him how many trees to plant and a profit
prediction over the specified number of years. Write a program that does this job by knowing the following:
 The area of a rectangular shape is: Area = Length x Width.
 Each Avocado tree needs 36 m2 of space.
 The price of an Avocado tree is 10 $
 The price of 1 kg of Avocado fruit is 3 $
 An Avocado tree starts yielding fruits on the third year (no yield in the first two years), it yields an
average of 7 kg per year. Then, each year it yields 6 times the previous year’s yield. Example: if the
third year’s yield is 7 kg, then the fourth year’s yield is 6 x 7 = 42 kg.
 The cost of farming (Workers, water, etc.…) per year is 0.15 $ for each 1 m2
Example:
Land width = 100 m
Land length = 400 m
Number of years = 7 years
The area of land = 400 x 100 = 40000 m2
Number of trees to buy = 40000/36 = 1111 trees
Cost of all trees = 1111 x 10$ = 11110 $ (this is a one-time payment)
Cost of farming per year = 0.15 x 40000 = 6000 $ (for the entire land)
Yield calculation:
Year Yield of 1 tree in kg Earning from the entire land
1 and 2 0 0 $
3 7 7 kg x 3 $ x 1111 trees = 23331 $
4 7 x 6 = 42 42 kg x 3 $ x 1111 trees = 139986 $
5 42 x 6 = 252 252 kg x 3 $ x 1111 trees = 839916 $
6 252 x 6 = 1512 1512 kg x 3 $ x 1111 trees = 5039496$
7 1512 x 6 = 9072 9072kg x 3 $ x 1111 trees = 30236976$
Total profit = Total earning – (Yearly payment + cost of all trees)
= (23331 + 139986 + 839916 + 5039496 + 30236976) – (7x6000 + 11110)
= 36279705 $ – (42000 + 11110)
= 36279705 $ – (53110)
= 36226595 $CSCI250 Exam II-v2 Spring 2020-2021
Page 4 of 7
Sample run 1
Enter length & width of your land and the # of years: 100 400 4
Land size = 40000
You need 1111 trees that cost 11110 $
Earning per year:
year 1 and 2:
Yield: 0 kg
Earning: 0 $
year 3:
Yield: 7 kg per tree
Earning: 23331 $
year 4:
Yield: 42 kg per tree
Earning: 139986 $
Total profit = 128207 $
Sample run 2
Enter length & width of your land and the # of years: -100 200 8
Numbers must be positives
Sample run 3
Enter length & width of your land and the # of years: 100 400 7
Land size = 40000
You need 1111 trees that cost 11110 $
Earning per year:
year 1 and 2:
Yield: 0 kg
Earning: 0 $
year 3:
Yield: 7 kg per tree
Earning: 23331 $
year 4:
Yield: 42 kg per tree
Earning: 139986 $
year 5:
Yield: 252 kg per tree
Earning: 839916 $
year 6:
Yield: 1512 kg per tree
Earning: 5039496 $
year 7:
Yield: 9072 kg per tree
Earning: 30236976 $
Total profit = 36226595 $

Answers

Answered by mrlegendrohit
0

Answer:

a)Filtration

please mark me a Brilliant

Two immiscible liquids, oil and water, can be separated by using Separating Funnel. The mixture of oil and water forms two separate layers because they are completely insoluble in each other. Oil forms the upper layer while water forms lower.

Similar questions