Hi Adrian,

If you look at the type used for the grade averages it is of type
integer.  So in the program when the average is calculated the
fractional part is truncated.

Cheers,
Casey

On Jan 16, 1:38 pm, Adrián E. Córdoba <[email protected]> wrote:
> I think something is wrong in LAB-1034, Exercise 1 if/else control
> structure, "(1.1) Build and run a Java program that uses if/else
> control structure".
> If you follow the directives in that LAB, and build an run
> MyGradesProject and enter the math, history, and science grades (78,
> 56 and 87 respectively) like the figures show, the program compute and
> display that the average is "73.0" as Figure-1.15 shows.
> But, if you compute the same average:
>
>                                 (78+56+87) / 3
>
>  in a calculator (like Windows Calculator), the average is "73.66..".
> What's wrong?
>
> Thank you in advance.

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to