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
Define function print_popcorn_time() with parameter bag_ounces. If bag_ounces is less than 3, print "Too small". If greater than
yawa3891 [41]

Answer:

void print_popcorn_time(int bag_ounces){

   if(bag_ounces < 3){

       cout<<"Too small"<<endl;

   }else if(bag_ounces > 10){

       cout<<"Too large"<<endl;

   }else{

       cout<<(6 * bag_ounces)<<"seconds"<<endl;

   }

}

Explanation:

The function is the block of the statement which performs the special task.

For checking the condition in the program, the if-else statement is used.

It can check the condition one or two but if we want to check the more than two different conditions then the continuous if-else statement is used.

syntax of continuous if else:

if(condition){

statement;

}else if(condition)

statement;

}else{

statement;

}

In the question, there are three conditions;

1. bag_ounces is less than 3

2. bag_ounces greater than 10

3. else part.

we put the condition in the above if-else statement and print the corresponding message.

8 0
3 years ago
Read 2 more answers
What is a data type?
kvasek [131]

Answer:

Data type is an attribute of the data in the computer science. It basically guide the compiler and interpreter about the data utilization in the program. Data type basically define the operation, which can be done on given data.

There are different types of data types are as follow:

Integer data type: This type if data type basically represent the integer type of data value from largest to smallest order.

For example: int p = 10;

Real data type: This type of data type is used to represent the real type of number from largest to smallest range.

For example: float b = 17.6;

7 0
3 years ago
Which search engine optimization technique involves sending data describing your web site to the search engines and then paying
vazorg [7]

Answer:

Search feeds.

Explanation:

Search feeds seem to be the search engine optimization strategy includes transmitting information to those of the search engines that explaining the user's website and afterward charging the fee to assure that is pages would be included in the site engine listing.

So, the following answer is correct according to the given scenario.

8 0
3 years ago
Write a function named enterNewPassword. This function takes no parameters. It prompts the user to enter a password until the en
Mkey [24]
______________———-___________
7 0
3 years ago
Using the physical mail analogy, what part of an address on an envelope is most like the ip address?
Slav-nsk [51]
The recipient IP address would would be the recipient home address. 
8 0
3 years ago
Other questions:
  • The Spell Checker can be found in which two locations in most word processing software?
    11·1 answer
  • Christine would like to add something to her document that will illustrate the text. She should _____.
    10·2 answers
  • Ruby is creating a presentation. She wants each slide displayed at intervals of five seconds. Which feature in the presentation
    6·2 answers
  • What is an audit trial
    8·1 answer
  • o maintain reasonable key security (mark all that apply): Ensure that someone else always has an extra key. Ensure that no extra
    10·1 answer
  • Write a dialogue between two friends who are debating on popularity or property​
    6·1 answer
  • A Network Management Station (NMS) is using SNMP to manage some Cisco routers and switches with SNMPv2c. Which of the following
    10·2 answers
  • web pages within the same website often have different blank because they have different blank A) home pages, urls B) goals, sou
    12·1 answer
  • An input value has to be greater than 18 and less than 65 if a driving license is to be approved for issue. What type of input c
    11·1 answer
  • Manny has drafted an email message and configured a delivery option "Do not deliver before: 5:00 P.M. and today's date." He shut
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!