AP® Computer Science A

Free Version

Upgrade subject to access all content

Moderate

Type Mismatch Error when Using Arithmetic Operations

APCSA-NKDXHN

Which of the following will result in a "type mismatch" error?
I.

int total = 0;
double dollarAmt = 10.56;
total = total + (int) dollarAmt;

II.

double a = 22.0, b = 2.0;
int age = a / (int) b;

III.

int[] nums = new int[10];    
double num = nums[0];
A

I only.

B

II only.

C

III only.

D

I and II only.

E

II and III only.