c language structures and pointers

1. You have a struct defined as

struct Coordinate
{
int x;
int y;
};

And you have variables defined from it:

Coordinate point1;
Coordinate point2;

Show just the code needed to access the y value of point2.

2.

The formula to find the distance between two points is:

distance.PNG

Using the struct definition in the previous questions, show the code needed to find the distance between point1 and point2, using cmath functions as needed.

Show just the line of code to produce the distance – do not show any include statements or an entire program.

3.

A pointer is a variable that contains a value that is

4.

How would you use the parameter f in the body of this function to access the numerator field?

void reduce(Fraction &f)

{

}

5.

The function argument in the previous question is defined as a

6.

You have this definition:

struct FractionArray
{
Fraction *fractions;
int nFractions;
};

And these statements:

FractionArray fractions;

fractions.nFractions = 100;

fractions.fractions = new Fraction[fractions.nFractions];

Using the new operator as in the code above means that you are

7.

Once you dynamically allocate memory, and you no longer need it to use it, what do you do?

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.