PHYCS 3730/6720 Lab Exercise

Reading and references: For these exercises we play with code from lab11 and lab02. Answers should go in a file lab12.

Exercise 1. Experimenting with the standard complex class

Convert the file ~p6720/exercises/intro_to_classes/checkcmplx.cc so it uses the standard C++ complex class instead of our own complex class. Make the following changes. Compile and run your code to verify your changes. Copy your code to your answer file. Then answer these questions:


Exercise 2. Experimenting with the standard string class

In exercise 3 of lab02, you modified the code whoyou.cc. Change your modified code so the character string is defined as a string object instead of a character array. Note that it is unnecessary to specify a string length. In the cout statement, use the overloaded + operator to concatenate strings, as in the example in the notes.

Copy your code to the answer file.