Question: C++ 1) Create a struct Point2D that represents a point in a 2 dimensional plane. It should have two fields x and y. Create a

C++

1) Create a struct Point2D that represents a point in a 2 dimensional plane. It should have two fields x and y. Create a few points at different locations. Then print their locations. 2) Create a struct Student that represents a student. It should have a name, a school, a student id and a grade field. Create a few different students all with grade '-'. Then give them all 'A's. 3) Explain briefly and clearly how using structs is better than just using regular primitive variables to represent the data like we have until this point. 4) Create a function named dist which takes two Point2D points as parameters and returns the distance between the two points.

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!