Lab 2: Writing C++ Code

The objective for today's lab is to type in and correct a C++ program. Follow these instructions:

  1. Type this program in
    #include <iostream>

    // Programmer: Your name
    // Period: The class period
    // This program obtains the _____ of the circle, prints and
    // computes the _____, ______, and _______
    //
    //***************************************************************
    // Variable Dictionary:
    //   PI:        Universal double point constant
    //   radius:  Radius of the circle, obtained from the user
    //   diam:    ________________
    //   circ:     ________________
    //   area:    ________________
    //***************************************************************
    int main( )
    {
       const double PI = 3.6;
       double radius, diam, circ;
     
       cinto radius
       diam = 2radius;
       2 (PI) radius=circumference
       area = 2*PI*radius*radius
       cout << "The radius is: " << "radius" << "\n";
       cout << "The diameter is: " << diam ;
       cout << "The circumference is: " << radius;
     
       return 0;
    }
  2. Compile and run the project
  3. Correct ALL of the syntax and logic errors
  4. Run the program
  5. Debug (correct) the program
  6. Click here for the solution

    Use the solution to model a program that converts Celsius to Fahrenheit. Google the equation to do the conversion