Skip to content

Commit 6d6397e

Browse files
authored
Merge pull request #145 from dpdiest/patch-30
Update readme.md
2 parents 4a68667 + 2ff6a59 commit 6d6397e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

labs/ChemicalElements/readme.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ This lab serves multiple goals:
1010

1111
# A Class for Chemical Elements
1212

13-
In this lab you will study and modify a class for [chemical elements](https://en.wikipedia.org/wiki/Chemical_element).
13+
In this lab, you will study and modify a class for [chemical elements](https://en.wikipedia.org/wiki/Chemical_element).
1414
Consult <https://en.wikipedia.org/wiki/List_of_chemical_elements#List> for a complete list of all elements.
1515

1616
## Reading
1717

18-
Download [ChemElemProject](ChemicalElements.zip) and extract the project. Open it in in your IDE, compile and execute it.
18+
Download [ChemElemProject](ChemicalElements.zip) and extract the project. Open it in your IDE, compile, and execute it.
1919
Now read the code in "ChemElem.cs" and "Program.cs".
2020

2121
The class definition "ChemElem.cs" contains:
2222

2323
- Three attributes,
2424
- One constructor,
2525
- One static method,
26-
- One method that returns the melting point in Celsius,
26+
- One method that returns the melting point in Celsius, and
2727
- One `ToString` method.
2828

2929
The application program "Program.cs" performs one simple conversion from Kelvin to Celsius.
@@ -36,7 +36,7 @@ Do the following:
3636
#. In "ChemElem.cs", write getters and setters for all attributes
3737
#. In "ChemElem.cs", write a constructor that requires no arguments.
3838
#. In "Program.cs", create a second object using the custom constructor that takes 3 arguments, then display the value of its attributes using the getters you previously defined.
39-
#. In "Program.cs", create an object using the no-args constructor, and set its values using the setters your previously defined.
39+
#. In "Program.cs", create an object using the no-args constructor, and set its values using the setters you previously defined.
4040
#. In "Program.cs", display on the screen the string returned by the `ToString` method when it is called by the object you created in the previous step.
4141
#. In "Program.cs", try calling the `FromKelvinToCelsius` method with one of your objects, for instance using `hydrogen.FromKelvinToCelsius(34)`. What happens?
4242
#. Still in "Program.cs", try calling the `MeltingInCelsius` method with the class, for instance using `ChemElem.MeltingInCelsius();`. What happens?
@@ -48,17 +48,17 @@ We now want to significantly improve this class, by adding:
4848
#. An attribute for the boiling point,
4949
#. All the tools needed to display the information in Fahrenheit degrees, in addition to Celsius and Kelvin.
5050

51-
You may want to comment out part or all of your "Program.cs" file, before starting to change your class.
51+
You may want to comment out part or all of your "Program.cs" file before starting to change your class.
5252

5353
- Add an attribute for the boiling point (in Kelvin).
5454
- Modify the constructor, so that it takes a 4th argument, and sets its value to be the value of the boiling point attribute.
5555
- Create a *static* `FromKelvinToFahrenheit` method, taking inspiration from the `FromKelvinToCelsius` method.
5656
- Create a `MeltingInFahrenheit` method, that returns the melting point in Fahrenheit of the calling object. This method should use your `FromKelvinToFahrenheit` method.
57-
- Create a `BoilingInFahrenheit` method, that return the boiling point in Fahrenheit of the calling object. This method should use your `FromKelvinToFahrenheit` method.
57+
- Create a `BoilingInFahrenheit` method, that returns the boiling point in Fahrenheit of the calling object. This method should use your `FromKelvinToFahrenheit` method.
5858
- Modify the `ToString` method, so that the string returned includes
5959
- The name of the chemical element and its atomic number,
60-
- The _melting point_ in Kelvin and in Fahrenheit,
61-
- The _boiling point_ in Kelvin and in Fahrenheit.
60+
- The _melting point_ in Kelvin and Fahrenheit,
61+
- The _boiling point_ in Kelvin and Fahrenheit.
6262

6363
You should test all of those modifications in your "Program.cs" file as you implement them.
6464
Use relevant data, test your program, and make sure the behavior is the expected behavior.

0 commit comments

Comments
 (0)