166k views
2 votes
Assume that children is an integer variable containing the number of children in a community and that families is an integer variable containing the number of families in the same community. Write an expression whose value is the floating point average number of children per family.

User Pranphy
by
7.2k points

1 Answer

2 votes

Answer:

Answered

Explanation:

Children*1 d/ family

Integer division returns an integer value in most languages.

I am assuming "1d" is double precision 1, which turns the expression into floating point division, thus allowing an answer like 1.8.

it can also be written as

float(children)/float(family)

User SIMULATAN
by
7.2k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.