So I'm doing this homework assignment and I'm a bit stuck. The code is executable but the teacher is picky and wants the first value to return as (.00). I've scanned through my book looking for some type of operator. I was sure that any value */+- double would return a double value. It does for the next two but I can't get my first return to return in decimal places.

/*

Program Name: Assignment1.cpp

Chapter: Chapter 2 Assignment 1

Programmer: Zach Marshall

Date: 1/15/2016

Description: A program designed to take the input of a radius.

Then with the input of the radius, it will display circumfrence, area, and diameter.

*/

#include <iostream>

#include <cmath>

usingnamespace std;

int main(){

/*Start of Data types*/

double radius, diameter, circumference, area;

//start constants

constdouble pi =3.14159;

/*End of Data types*/

/*Start of Input/Output statements*/

cout<<"Enter the radius of the circle (in inches): ";

cin>> radius;//The user inputs how large the radius is

/*Secondary Datatypes used here because you can't declare radius as a variable without first defining it with the input*/

diameter =2.00* radius;//Equation for finding the diameter of a circle

circumference =2* pi * radius;// Equation for finding the circumference of a circle

area = pi *pow(radius, 2.0);//Equation for finding the area of a circle (uses power function) (radius*radius)

cout<<"The Diameter of a circle with a radius of "<< radius <<" is: "<< diameter <<" inches."<< endl;//output of the diameter

cout<<"The Circumference of a circle with a radius of "<< radius <<" is: "<< circumference <<" inches."<< endl;//output of the circumference

cout<<"The Area of a circle with a radius of "<< radius <<" is: "<< area <<" inches."<< endl;//output of the area

/*End of Input/Output Statements*/

return0;

}

The output if the radius is 10 =

Enter the radius of the circle (in inches): 10.00

The Diameter of a circle with a radius of 10 is: 20 inches.

The Circumference of a circle with a radius of 10 is: 62.8318 inches.

The Area of a circle with a radius of 10 is: 314.159 inches.

Press any key to continue . . .

I have tried entering it with the decimal places and without but no change as seen here.