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
Question
LuckyWell [14K]

Answer:

you go to the what ever you use for the stuff i thing you want

Explanation:

6 0
3 years ago
Which option of ms-word is used o represent data in an organised manner?
tekilochka [14]
Use the charting features of Word 2007 and Excel 2007 to present<span> your </span>data<span> in a pie, line, </span>
3 0
3 years ago
¿Que es el simulador de vuelo en Google Earth?
Dimas [21]
Guat da fak did u say 
4 0
4 years ago
Write a program to print sum on first 10 natural numbers.
Kamila [148]

sum of 10 natural number is 55

4 0
3 years ago
Which infection sends information to your computer through a third party
Daniel [21]

Answer: Spyware

Explanation:

Spyware is a blanket term given to software that gathers information about your computer and the things you do on it, and sends that information over the Internet to a third party

8 0
3 years ago
Read 2 more answers
Other questions:
  • Write a recursive, int-valued method named productOfOdds that accepts an integer array, and the number of elements in the array
    10·1 answer
  • While there are a lot of programming languages out there, one of the most widely used when it comes to web applications and web
    10·1 answer
  • Write a function index(elem, seq) that takes as inputs an element elem and a sequence seq and returns the index of the first occ
    7·1 answer
  • TP is commonly used to __________ and __________ files to a server.
    5·1 answer
  • Which parts of the forebrain are sometimes described as the “executive center” and can be likened to the central processing unit
    9·1 answer
  • Question 4: What will be the output of the code? Show a complete analysis.
    6·1 answer
  • which of the following uses technical and artistic skills to create visual products that communicate information to an audience?
    14·1 answer
  • Graphic Designer A says that a halftone is an image created from a photograph and is comprised of a
    8·2 answers
  • What is responsible for coordinating a computer's hardware and software components?
    13·1 answer
  • Identify the type of software that should be in main memory in order to use the keyboard? *
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!