I'm trying to get started in this Java program: 1. Define the double variables name test1, test2, test3 2. Assign values three test scores to test1, test2, test3 (for example 98, 95, 97) 3. Calculate the average or test1, test2 and test3 I started with: double test1 = "98" double test2 = "95"; double test3 = "97"; and the program already tells me something is wrong.

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions.

A community for students.

I'm trying to get started in this Java program: 1. Define the double variables name test1, test2, test3 2. Assign values three test scores to test1, test2, test3 (for example 98, 95, 97) 3. Calculate the average or test1, test2 and test3 I started with: double test1 = "98" double test2 = "95"; double test3 = "97"; and the program already tells me something is wrong.

Computer Science
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

double test1 = "98" is missing ';'
it's a double. i.e. numbers with decimals trailing. 98 should be 98, not "98" it should be like this: double test1 = 98;
correct, the "" mean it is being defined as a string. but you want a double integer value. so you do not need the "".

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

:p you guys move fast :D.
dw, but you are correct konrad, the first value is missing ;
I always like to go slow with them :P. Make them learn it. technically we should also say 98.0d is the standard. Only Double, Floats, and Longs really are classified... You can find it here! http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html
I personally don't use d though...
Additional question: I got program without errors, but my average displays 96.6666666667. How can I make it only display 96.7? I know how to do it in C++, but not in Java.
decimalFormat or bigInteger

Not the answer you are looking for?

Search for more explanations.

Ask your own question