Using the programs written for the previous assignments, create a simular program which randomly generates 3 sets of x and y coordinates and one randomly generated Real. Two of the sets of coordinates will (as in program 2) represent the end points of a line. The other set of coordinates and the Real will represent the midpoint of a circle and the circle's radius.
The coordinates should be randomly generated numbers from -99.9 to 99.9. The radius should be a randomly generated number from 0.1 to 99.9. Determine if the line is wholly within the circle. The program should display all of the generated data and one of the messages regarding the location of the line as shown below in Output Layout section. Make sure the decimal places line up.
Special Calculations:
Length of a Line Segment Equation:
√((p0x – p1x)2 + (p0y – p1y)2) (This requires use of the math library)
Output Layout:
Line Segment's 1st x coordinate: -##.#
Line Segment's 1st y coordinate: -##.#
Line Segment's 2nd x coordinate: -##.#
Line Segment's 2nd y coordinate: -##.#
Circle's Midpoint x coordinate: -##.#
Circle's Midpoint y coordinate: -##.#
Circle's Radius: ##.#
The line is in the circle!
OR
The line is not in the circle!
Other:
Data, function names and conditions:
p0x // a float from -99.9 to 99.9
p0y // a float from -99.9 to 99.9
p1x // a float from -99.9 to 99.9
p1y // a float from -99.9 to 99.9
mpx // a float from -99.9 to 99.9
mpy // a float from -99.9 to 99.9
radius // a float from 0.1 to 99.9
Please note, that it is not a homework site. We won't do your homework for you. However we are always willing to help solve problems you encountered, correct mistakes you made in your code and answer your questions.
We didn't see your attemts to solve this youself and so we cannot correct mistakes you didn't made and answer questions you didn't ask. To get help you should do something yourself and get real problems with something. If your problem is "I don't understand a thing", then you should go back to basics and study again. As it is impossible to find deriviative of function without knowledge in ariphmetics, you cannot do more complex tasks in programming without clear understanding of basics
And that:
Using the programs written for the previous assignments
Would you mind post it here so we could use it as a base as assignment reqire.
please I miss something this problem is about writing function with arguments,function prototype but I keep trying and it doesn't want to debug.could you help me with that?
// ConsoleApplication31.cpp : Defines the entry point for the console application.
//
#include <iostream>
#include <cmath>
#include <ctime>
using namespace std;