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
stellarik [79]
3 years ago
8

Write a program that takes a point (x,y) from theuser and find where does the point lies. The pointcan

Computers and Technology
1 answer:
agasfer [191]3 years ago
4 0

Answer:

C++ Program .

#include<bits/stdc++.h>

using namespace std;

int main()

{

int x,y;//declaring two variables x and y.

string s;//declaring string s..

cout<<"enter x and y"<<endl;

cin>>x>>y;//taking input of x and y..

if(x>=0 &&y>=0) //condition for 1st quadrant..

cout<<"the point lies in 1st Quadrant"<<endl;

else if(x<=0 &&y>=0)//condition for 2nd quadrant..

cout<<"the point lies in 2nd Quadrant"<<endl;

else if(x>=0 &&y<=0)//condition for 3rd quadrant..

cout<<"the point lies in 3rd Quadrant"<<endl;

else //else it is in  4th quadrant..

cout<<"the point lies in 4th Quadrant"<<endl;

cout<<"enter n to terminate the program"<<endl;

while(cin>>s)//if the user has not entered n the program will not terminate..

{

   if(s=="n")

   {

       cout<<"the program is terminated"<<endl;

       exit(0);

   }

   cout<<"you have not entered n please enter n to terminate the program<<endl;

}

}

Explanation:

The above written program is for telling the point lies in which quadrant.I am first declaring two variables x and y.Then after that taking input of x and y after that checking in which quadrant the point lies.

Taking input of the string s declared earlier for program termination the program will keep running until the user enters n.

You might be interested in
Your client noticed that his ad was disapproved for editorial reasons. Why is it important for him to understand and abide by Go
astra-53 [7]

Answer: Ad Words policies can help ensure ads are useful, varied, relevant, and safe for web users

Explanation: Google Ads do have a policy for the ad display which requires that the ads should be secured, relevant and safe for the users on the web. Google Ads positively review every Ads that is created or has been changed in some terms as their policy. It maintains the standard and relevancy on the web and no objectionable content gets posted .

This might be the reason that the client's ads are disapproved because he/she is not aware of the Google's ads policies.

3 0
3 years ago
When she manages a software development project, Candace uses a program called __________, because it supports a number of progr
alexandr402 [8]

Answer:

PLS programming language supporting.

Explanation:

7 0
3 years ago
The Sleeping-Barber Problem:
s2008m [1.1K]

Answer:

Explanation:

Following are the Semaphores:

Customers: Counts waiting customers;

Barbers: Number of idle barbers (0 or 1)

mutex: Used for mutual exclusion.

Cutting: Ensures that the barber won’t cut another customer’s hair before the previous customer leaves

Shared data variable:

count_cust: Counts waiting customers. ------------copy of customers. As value of semaphores can’t access directly.

// shared data

semaphore customers = 0; semaphore barbers = 0; semaphore cutting = 0; semaphore mutex = 1;

int count_cust= 0;

void barber() {

while(true) { //shop is always open

wait(customers); //sleep when there are no waiting customers

wait(mutex); //mutex for accessing customers1

count_cust= count_cust-1; //customer left

signal(barbers);

signal(mutex);

cut_hair();

}

}

void customer() {

wait(mutex); //mutex for accessing count_cust

if (count_cust< n) {

count_cust= count_cust+1; //new customer

signal(customers); signal(mutex);

wait(barbers); //wait for available barbers get_haircut();

}

else { //do nothing (leave) when all chairs are used. signal(mutex);

}

}

cut_hair(){ waiting(cutting);

}

get_haircut(){

get hair cut for some time; signal(cutting);

}

6 0
3 years ago
katniss dismisses effie's metaphor because, literally, she knows pearls cannot be created with pressurised coal,they come from w
Marta_Voda [28]

Answer:

oysters

Explanation:

oysters form pearls inside their mouths, it's a very long process, and most oysters never finish or do them

please give brainliest

8 0
3 years ago
Read 2 more answers
What does "CYBER-COCKROACH" mean??
katrin2010 [14]

Answer:

The cyber cockroach is the presented external anatomy of a cockroach, with labeled views of photographs from diverse angles in place of diagrams. The cyber cockroach can be navigated around the head, thorax and abdomen with possible close up views of the legs and the images are downloadable

Cyber cockroach is a useful tool for the study of insects of the Blattodea order

Explanation:

3 0
3 years ago
Other questions:
  • Samuel is working on decimal and binary conversion for his college project. He is using the binary number 111011 and wants to ex
    10·2 answers
  • I need help with some computer stuff
    8·1 answer
  • Jim is in the market for a car that will last for the next 10 years and has saved up some money for the purpose of a car. What’s
    12·1 answer
  • In 4-bit sign magnitude representation, what is the binary encoding of the number -5?
    15·1 answer
  • If you copy and paste from someone else's document (such as a website, a friend's paper, an instructor's solutions manual, etc.)
    15·1 answer
  • What component uses thermal paste to attach the heat sink?
    13·1 answer
  • Why is the yellow light blinking on the front of my computer
    10·1 answer
  • When is it appropriate to utilize the nat network connection type?
    8·1 answer
  • NO SPAMMERS, ONLY FULL ANSWER
    8·2 answers
  • Susan discovers the following log entries that occurred within seconds of each other in her Squert (a Sguil web interface) conso
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!