Write statements to declare and initialize two variables : one, named element _number can hold any of the integer  values  1 through 118; the other, named atomic_weight can hold the atomic weight of the given element; atomic weights are values like 3.76.

LANGUAGE: C++

CHALLENGE:

Write statements to declare and initialize two variables : one, named element _number can hold any of the integer  values  1 through 118; the other, named atomic_weight can hold the atomic weight of the given element; atomic weights are values like 3.76.

In the declaration, initialize the variables to the values for oxygen, which is element number 8 and has an atomic weight of 15.9994.

SOLUTION:

The Bad News: The content you are trying to access is only available to members.

The Good News: You too can be a member, simply Click Here.

Already a member?

Posted in ,

1 Comment

  1. Lincoln on September 15, 2016 at 9:46 pm

    This was helpful to a degree but it will error since oxygen is already defined in double, so the program doesn’t expect it. All I did to fix it was change oxygen = 15.9994 to a comment and replace the oxygen next to atomic number to simply just 15.9994.

Leave a Comment

You must be logged in to post a comment.