Question: A- Although no program is required, the following requires you to determine the results of division when different data types are used. For example, what

A- Although no program is required, the following requires you to determine the results of division when different data types are used. For example, what will result if you divide an int by another int? How about dividing a float by a long? Given the following variables, give the numeric answer to the division in the space provided.

int someInt = 7 int someInt2 = 17 float someFloat = 4.51

long someLong = 2 double someDouble = 6.12345

Given the above variables, provide the exact numeric answer to these divisions:

someInt / someLong: _______

someFloat / someDouble: _______

someInt / someFloat: _______

B. Given a variable called gpa, which is a float (float gpa;), write a correct code fragment that divides someInt by someInt2, and assigns the result to gpa. Ensure that when dividing the two integers, the result of the division is accurate (and not just an integer). Write the code below (this is a single statement of code):

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!