• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem recognizing incompatible types error

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone! I am working on this code that accepts six grades from a GUI, drops the lowest grade and then gives the final grade. However, when I make an array of doubles to store the grades, my compiler tells me that there are incompatible types. What am I missing here? I only use doubles up until that point of the code, so this is really confusing me. Infinite thanks in advance for any help. The problem is highlighted on like 38 here.

 
Bartender
Posts: 563
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On the left side of the declaration,

double grades

grades is a single variable of type double. However, on the right side, the variable grades is assigned to a 5-element array of type double. Recheck the declaration of array variables and see if you can fix this simple syntax error.
 
Brian Mart
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...wow. It was a long day yesterday. Thanks for getting my brain to turn on again!
 
Greg Brannon
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sometimes the easy errors are the hardest to see without a little help. Glad I could.
reply
    Bookmark Topic Watch Topic
  • New Topic