Ask Question
27 April, 00:28

You are given two variables, already declared and assigned values, one of type double, named totalWeight, containing the weight of a shipment, and the other of type int, named quantity, containing the number of items in the shipment. Write an expression that calculates the weight of one item.

+1
Answers (1)
  1. 27 April, 03:32
    0
    double singleWeight = totalWeight/quantity;

    Step-by-step explanation:

    Considering you already have two different declared and assigned variables, in C language you would have the following lines:

    #include

    int main ()

    {

    double totalWeight = 5.2;

    int quantity = 2;

    double singleWeight = totalWeight/quantity;

    / / Displays operation

    printf ("%f / %d = %f", totalWeight, quantity, singleWeight);

    return 0;

    }

    It is very important to keep in mind that the type of variable of singleWeight is double due to the expecting number is the result of the division where the dividend is double too.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “You are given two variables, already declared and assigned values, one of type double, named totalWeight, containing the weight of a ...” in 📘 Mathematics if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers