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

Cost analysis is an important part of engineering. When you are in practice, you

ID: 3535591 • Letter: C

Question

Cost analysis is an important part of engineering. When you are in practice, you may be asked to write programs to determine the minimum cost for a number of different potential circumstances. Your programs can be used as decision making tools for a project.

Consider the building of an airport with the runway being built on landfill. The contractor has two dump trucks, one with a capacity of 8 tons and the other with a capacity of 12 tons. The contractor uses the trucks to haul fill from a remote site to the airport location. The operating cost per trip for the 8 and 12 ton trucks is $14.57 and $16.26, respectively. One truck cannot make more than 60 percent of the total trips.

Write a program that develops the minimum cost for a given number of tons. Prompt the user to enter the total number of tons. Display the number of trips required for each truck and the total cost. Also display the percent carried by each truck.

Explanation / Answer

#include int main (void) { double mass, sixtyPercentMass; int eightCount = 0, twelveCount = 0; printf("Enter the number of tons: "); scanf("%lf", &mass); sixtyPercentMass = 0.6 * mass; while((twelveCount*12)