Question: My code is c++ programming can you guys help me and fix my mistake? here is my code #include #include #include #include using namespace std;

My code is c++ programming

can you guys help me and fix my mistake?

here is my code

#include #include #include #include

using namespace std;

int main(){

// Add constants // Constant for R_SEED const int R_SEED = 314159; // Constant for maximum and minimum values for random number generation const int MAX = 12, MIN = -12; //Constant for radius of the circle const int R = 10; //Constant for epsilon const double EPSILON = 0.0001;

// Declare two variable for user input char choice; double x, y;

//configure RNG with R_SEED srand(R_SEED);

//prompt user with selection choice cout

//read user choice cin >> &choice;

//convert lower case choice to upper case choice choice = toupper(choice);

//switch statement for setting x and y values switch(choice){ case 'E': // Take user input for x and y coordinate cout > x;

cout > y;

break; case 'R': //generate random value between -12 to 12 for x and y coordinate x = MIN + ((double)rand() / RAND_MAX) * (MAX-MIN); y = MIN + ((double)rand() / RAND_MAX) * (MAX-MIN); break; default: cout

//set precision for print double values std::cout

// Compute particle distance from origin double distance = sqrt(x*x + y*y);

//Declare and assign boolean onWall variable bool onWall = false; if(abs(R - distance)

//Declare and assign boolean inside variable bool inside = false; if(R > distance + EPSILON || R > distance - EPSILON) inside = true;

// Using flags show output if(onWall) cout

}

My code is c++ programming can you guys help me and fix

3: Random upper ^ Output differs. See highlights below. Input R Your output Select particle location by: [E] entering coordinates (R) random generation Particle is at (-7.36, 10.46) Outside cell wall Expected output Select particle location by: [E] entering coordinates [R] random generation Particle is at (-7.00, -5.00) Inside cell wall 4: Random lower A Output differs. See highlights below. Input Your output Select particle location by: [E] entering coordinates (R) random generation Particle is at (-7.36, 10.46) Outside cell wall Expected output Select particle location by: [E] entering coordinates (R) random generation Particle is at (-7.00,-5.00) Inside cell wall

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!