for this code
input:
4
0 5
1 0
2 10
3 6
4
0 -5
1 0
2 -10
3 -6
output:
(nothing)
expected output:
2. The shape of a lima¸con can be defined parametrically as
r = r0 + cos θ
x = r cos θ
y = r sin θ
When r0 = 1, this curve is called a cardioid. Use this definition to plot the shape of a limacon for r0 = 0.8, r0 = 1.0, and r0 = 1.2. Be sure to use enough points that the curve is closed and appears smooth (except for the cusp in the cardioid). Use a legend to identify which curve is which.
1. Use matplotlib.pyplot.plot to produce a plot of the functions f(x) = e−x/10 sin(πx) and g(x) = xe−x/3 over the interval [0, 10]. Include labels for the x- and y-axes, and a legend explaining which line is which plot.
Define the following vectors and matrices:
vec1 = np.array([ -1., 4., -9.])
mat1 = np.array([[ 1., 3., 5.], [7., -9., 2.], [4., 6., 8. ]]
13. The function np.random.rand can be used to construct and fill vectors and matrices with random numbers. Use the help facility in Python to learn how to construct a 10 × 10 matrix named M filled with random numbers.
Define the following vectors and matrices:
vec1 = np.array([ -1., 4., -9.])
mat1 = np.array([[ 1., 3., 5.], [7., -9., 2.], [4., 6., 8. ]]
10. What function would you use to find the value of j so that vec1[j] is equal to the smallest element in vec1?
11. What expression would you use to find the smallest element of the matrix
mat1?
Q2. Write a program to define four structures with structure variable of array types. Enter data into each structure variable that has four records and each record contains five fields.
. Write a program to initialize the data members through passing two parameters using a constructor. Calculate their sum and print the output on the screen using a separate member function of a class.
Team ABC approaches you to design for them a payroll system that will later be converted into an application The design must show all the classes and interface and the relationship existing between them.
Defender get bonus rate based on the number of games played which is 20%, Goalkeepers number of clean sheet 10%,Middlefielder of assist 10&, Strikers number of goals scored.
The payroll must have the following functionalities
1. Given a list of players, the system must determine and store the total payment of each player in a list.
2. Given a list of salaries for players, the system must determine the monthly costs of the team
3. Given a list of player , the system must determine the best monthly striker.
· Implement the following hierarchy.
· Make Shape, TwoDimensionalShape, and ThreeDimensionalShape as abstract class
· Add virtual functions of calculateArea() and perimeter() in TwoDimensionalShape.
· Implement the above functions in child classes Circle, Square , Triangle. Take help from Google to find the formulas.
· add virtual functions of calculateSurfaceArea() and calculateVolume() in ThreeDimensionalShape
Implement all functions in child classes Sphere, cube, and tetrahedron.
sales management system project code in c++ by using oop.its use class, inheritance and function?