1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sergeu [11.5K]
3 years ago
11

In mathematics, "quadrant I" of the cartesian plane is the part of the plane where x and y are both positive. Given a variable,

p that is of type POINT-- a structured type with two fields, x and y, both of type double-- write an expression that is true if and only if the point represented by p is in "quadrant I".
Computers and Technology
1 answer:
lbvjy [14]3 years ago
5 0

Answer:

#include <iostream>

using namespace std;

struct Cartesian {

double x;

double y;

};

int main() {

// creating a pointer p of type struct Cartesian

struct Cartesian *p = new Cartesian ;

cout << " Enter x: ";

// accessing the structure variable x by arrow "->"

cin >> p->x;

cout << "Enter y: ";

// accessing the structure variable y by arrow "->"

cin >> p->y;

// expression to check whether x and y lie in Quadrant 1

if (p->x > 0 && p->y > 0) {

 cout << "X and Y are in Quadrant 1 ";

}

else

{

 cout << "x And y are not in Quadrant 1";

}

// deleting the struct pointer p

delete p;

return 0;

}

Explanation:

in order to locate memory in heap, keyword "new" is used in C++ so,

struct Cartesian *p = new Cartesian ;

in order to access data members of the structure using pointer we always use an arrow "->". otherwise a dot oprerator is used to access data members.

in order to check whether x and y lie in 1st quadrent, we must use && operator in our if condition. so

if (p->x > 0 && p->y > 0)

&& will return true iff x and y both are +ve.

deleting the struct pointer p is important beacuse we are allocating memory in heap so heap memory should be used a resource and must be release when not needed otherwise it can cause memory leakage problems. so  

delete p;

You might be interested in
Two or more computers connected together is referred to as a(n)
son4ous [18]
Two or more computers connected together is referred to as a network.
So the answer is <span>B. network.</span>
8 0
3 years ago
What is a scenario where records stored in a computer frequently need to be checked
vazorg [7]

if your in  school and always are getting into trouble the school will always be checking your records


7 0
3 years ago
Read 2 more answers
Pedro is at a conference for computer programmers and wants to attend a session on new features in software that help write code
Natasha_Volkova [10]

Answer:

1) Variable Management for Beginers

6 0
3 years ago
How does an agile team obtain clarity on backlog items that may be picked up in upcoming iterations?
kherson [118]
It is important for developers to know exactly what is expected from each use case on the backlog. To obtain clarity and understand all of the requirements, cross-functional teams including developers, testers, users of the system, management, etc. should work together. Actors in the system should be interviewed, observed, or be given a questionnaire to figure out details regarding specific requirements.
7 0
4 years ago
Read 2 more answers
Organisms are classified as producers or consumers acorrding to the way they
lys-0071 [83]
I think A but i’m not sure
4 0
3 years ago
Read 2 more answers
Other questions:
  • The commands available from a menu may change as a result of a user's actions.
    10·1 answer
  • Can I change my brainly username?
    9·2 answers
  • List 5 major steps to make a bank deposit
    6·1 answer
  • Add the following binary numbers. 101110010 and 111001101
    13·1 answer
  • Given the following program: public class MysteryNumbers { public static void main(String[] args) { String one = "two"; String t
    13·1 answer
  • Which of the following gadgets is best for making a soft-shell shape out of butter?
    15·2 answers
  • 9.6 Code Practice<br> Instructions<br> 1<br> Declare a 4x 5 array called N<br><br> Please helppp
    9·1 answer
  • Select the correct answer. Which of these is a game-centric handheld gaming console? A. IPad B. iPhone C. PSVita D. Xbox ​
    9·2 answers
  • Why were Redditors interested in "Mister Splashy Pants"?
    6·2 answers
  • True or False: Visual Studio is not a part of Unity. You could use a different code editor to edit your C# scripts if you wanted
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!