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
11Alexandr11 [23.1K]
3 years ago
5

Question 1:

Computers and Technology
1 answer:
Julli [10]3 years ago
3 0

Answer:

Following are the code to the given question:

#include<iostream>//header file

#include<math.h>//header file

using namespace std;

int main()//main method

{

   long long x, x1, y, y1;//defining long variable

   int count=0,i,j;//defining integer variable

   cout<<"Enter a range for x coordinates: "<<endl;//print message        

   cin>>x>>x1;//input x and x1 value                          

   cout<<"Enter a range for y coordinates: "<<endl;//print message

   cin>>y>>y1; //input y and y1 value  

   for(i = x; i <= -x1; i++)//use nested loop that tests each coordinates                                        

   {

       for(j = y; j <= y1; j++)//use nested loop that tests each coordinates

       {

           if(((2*pow(i,2)) + abs(2*i*j) + pow(j,2)) == 10000)//use if that checks condition as per the given question

           {

               cout<<"There is a planet at "<<i<<", "<<j<<endl;//  print coordinates

               count++;//incrementing count variable value                                                    

           }

       }

   }

   cout<<"Total number of planets detected are: "<<count<<endl;//print count value

   return 0;

}

Explanation:

In this code, inside the main method long "x, x1, y, and y1" and integer "count, i, and j" type variable is declared that uses a long variable to input value from the user-end.

In the next step, two nested loops have defined that test each coordinate and define if block that checks condition as per the given question and use i, j, and count variable to print value with the message.

You might be interested in
Ontext clues can be used to determine the _____ of an unfamiliar word
Solnce55 [7]
Meaning of the word.

6 0
3 years ago
How can an Excel table be added to a Word document? Check all that apply.
densk [106]

Answer:

A and B

Explanation:

3 0
3 years ago
3. How can you correct the color of your photos automatically?​
natita [175]

Answer:

use the lightroom

download the app haha

4 0
3 years ago
Read 2 more answers
a solid state drive is a removable flash memory device that you insert and remove from a slot in a computer, mobile device, or c
yulyashka [42]
It is true, Because all the the drives or memories which doesn't have a plates spinning like hard disk are called solid state drives.
4 0
3 years ago
Given a string, convert the characters of the string into opposite case,i.e. if a character is lower case than convert it into u
o-na [289]

Answer:

// CPP program to Convert characters  

// of a string to opposite case  

#include<iostream>  

using namespace std;  

// Function to convert characters  

// of a string to opposite case  

void convertOpposite(string &str)  

{  

int ln = str.length();  

 

// Conversion according to ASCII values  

for (int i=0; i<ln; i++)  

{  

 if (str[i]>='a' && str[i]<='z')  

 //Convert lowercase to uppercase  

  str[i] = str[i] - 32;  

 else if(str[i]>='A' && str[i]<='Z')  

 //Convert uppercase to lowercase  

  str[i] = str[i] + 32;  

}  

}  

// Driver function  

int main()  

{  

string str = "GeEkSfOrGeEkS";  

 

// Calling the Function  

convertOpposite(str);  

 

cout << str;  

return 0;  

}  

Explanation:

8 0
3 years ago
Other questions:
  • In your presentation you added a text box to?
    5·1 answer
  • What happens when a flash memory card is installed in a slot and it is recognized by windows?
    6·1 answer
  • Knowing the meaning of the acronym WAS I WHY can be most helpful to you when you?
    14·1 answer
  • Lord Strawberry, a nobleman, collected birds. He had the finest aviary in Europe, so large that eagles did not find it uncomfort
    9·1 answer
  • Assslainsdffddsvvdesdssbhasasco5m
    5·2 answers
  • - A blacksmith is shoeing a miser's horse. The blacksmith charges ten dollars for his work. The miser refuses to pay. "Very well
    6·1 answer
  • What is a photographic print made from a negative image?
    7·1 answer
  • The navigation items for a Lightning app are available on mobile: A. In a special mobile configuration in the navigation menu an
    15·1 answer
  • If your cell phone rings while you are driving and you do not have a hands-free device you should
    9·1 answer
  • assuming the default gateway is connected to the internet, what type of internet access would this server have?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!