The grades are all integer and divided by an integer. They would
result to an integer, that it trimming the values after the decimal
point. Try to write 3.0 instead of 3.

hope this helps.

yvonne

On Jan 16, 10:38 am, 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