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
Why does the IPv6 format use letters and numbers?
Iteru [2.4K]

Answer:

c is the response hope it helps

7 0
2 years ago
2. A shift register can operate:
Naddik [55]
C. Both serially and Perullo
8 0
2 years ago
I have the assembly for the max. can someone change the variables of it and make it min. I mean, the assembly for finding the mi
tatyana61 [14]
Bruh i honeselty dont know
4 0
3 years ago
Explain how data structures and algorithms are useful to the use of computer in data management<br>​
laiz [17]

Answer:

programmers who are competent  in data  structures and algorithms  can easily perform the tasks related  to data processing ,automated reasoning ,or calculations . data structure and algorithms  is significant  for developers  as it shows their problems solving abilities amongst the prospective employers .

5 0
2 years ago
Write a program that calculates and displays the number of minutes in a month. This program does not require any user input, and
dimulka [17.4K]

Answer:

Code to the answer is shown in the explanation section

Explanation:

import java.util.Scanner;

public class Question {

   public static void main(String args[]) {

     Scanner scan = new Scanner(System.in);

     System.out.println("Please enter the days of the month: ");

     int daysOfMonth = scan.nextInt();

     int minuteOfMonth = daysOfMonth * 60 * 24;

     System.out.println(minuteOfMonth);

   }

}

// 60 represents the number of minutes in one hour

// 24 represents the number of hours in a day

4 0
3 years ago
Other questions:
  • Which option helps you choose the design of a slide in a presentation?
    10·1 answer
  • 7. The penalties for a first-time DUI charge include a fine of __________. A. up to $500 for a BAL of .08 to .15 B. $500-$1,000
    5·1 answer
  • 350 square feet requires 1 gallon of paint. Assign gallons_paint with the amount of paint required for wall_area. Sample output
    12·1 answer
  • Given two variables matric_age and grad_age, write a statement that makes the associated value of grad_age 4 more than that of m
    15·1 answer
  • Write a program that asks the user to enter the size of a triangle (an integer from 1 to 50). Display the triangle by writing li
    14·1 answer
  • Please help me and solution in c language​
    5·1 answer
  • A customer dictates instruction on how to transcribe audio. Do you have to transcribe the instruction word for word?
    13·1 answer
  • the ghost adventures team uses a variety of tools and technology in investigations. which one is described as an adjustable freq
    9·1 answer
  • A maxillary partial denture will have a ____ connector, and the mandibular partial denture will have a ____ connector.
    15·1 answer
  • Fifteen years ago, everyone didn't have a cell phone. Anyone developing an app would not have found many users. Today, the exist
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!