|
|
|
|
*** gas *** sum over 12 months: $1400.23 average: $ 116.69 highest cost: $ 207.14 lowest cost: $ 52.55 *** electricity *** sum over 12 months: $1149.10 average: $ 95.76 highest cost: $ 188.32 lowest cost: $ 50.90 *** water *** sum over 12 months: $ 629.84 average: $ 52.49 highest cost: $ 78.33 lowest cost: $ 40.56 *** cable *** sum over 12 months: $1310.95 average: $ 109.25 highest cost: $ 152.64 lowest cost: $ 46.93 *** phone *** sum over 12 months: $ 957.65 average: $ 79.80 highest cost: $ 83.57 lowest cost: $ 79.15 |
slicedpan (114) May 10, 2012 at 3:07pm You are trying to access a member of ar[i] called utility, but the type of ar[i] is double (since ar is an array of doubles). Report |
|
|
Well a double is a built in type that represents a number. You are basically asking for the 'utility' of a number. That doesn't make any sense. However if you have a variable that has a type 'utilityInfo', you can legitimately ask about a member of that data type called 'utility' since it contains member data with that name. 1 2 3 4 5 6 7 8 9 10 utilityInfo myUtilInfo; myUtilInfo.utility = "blah"; //this is fine utilityInfo myUtils[10]; myUtils[0].utility = "foo"; //this is also fine double aNumber; aNumber.utility = "something"; //this is not possible, a double does not contain a //member called utility |