Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1-)You are working as an excavator operator. The excavator will dig a hole which

ID: 3640498 • Letter: 1

Question

1-)You are working as an excavator operator. The excavator will dig a hole which is maximum depth is 50 m then when it takes the soil out of the hole, in each 5 m, 5% of the soil drops from the excavator’s bucket. The maximum capacity of your excavator’s bucket is 10 kg. User will input a height value (between 1 and 50) which is the position of the excavator and your program calculates the amount of soil when the excavator reaches the top of the hole according to the defined value by the user.

(in each 5 m, the amount of soil in the excavator’s bucket is decreasing. So, in your program you must update the value of the soil.)

2-)User will input the position of the excavator (between 1 and 50). According the inputted position value, user will input amount of soil (kg). The maximum capacity of your excavator’s bucket is same. How many steps are required to carry the all soils to the top of the hole for this position?
(in each 5 m, 5% of the soil drops from the excavator’s bucket)

Explanation / Answer

#include int main() { int depth,n,i; float output,soil,x; int step; printf(" Enter the depth value you want to dig upto (1-50 in meters):"); scanf("%d",&depth); printf(" Enter Amount of soil(in kgs):"); scanf("%f",&soil); n= depth / 5; /* n is how many times 5 m mark will come */ /* max capacity is 10 kg*/ output=10; /*output is amount of soil at top ..initally initialized as 10..as its max capacity*/ for(i=0;i0) { step++; x=x-output; //while there is soil left ..Steps are remaining } printf("Amount of soil excavator got out in this trip:%f",output); printf(" No. of steps required to extract %f kg amount of soil is : %d",soil,step); }