Question 1:
The Wayfinder is an ancient piece of technology created as a means of navigating challenging stretches of space. The device connects to every piece of technology in the galaxy in order to detect planets and spaceships and then shown their location to the user. As it happens, locations of planets follow a specific distribution. A planet can exist at coordinates x,y only if
2x² + |2xy| + y² =10000
The user can use the Wayfinder to find nearby planets by input the range for x and y. Draw a flowchart and write a C++ program that models the Wayfinder. Ask the user to input a range for x and y, then print all possible planet coordinates. The program should also print the number of planets detected.
Hint: you can use pow(x,n) to get the value of xn and abs(x) to get the absolute value of x.

helpppppppppp!!!!!!!!!!

Sample output:

Question 1:The Wayfinder Is An Ancient Piece Of Technology Created As A Means Of Navigating Challenging

Answers

Answer 1

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.


Related Questions

The part (or statement) of a recursive function that decides whether the recursive loop is terminated is called: (Select all that apply)

Answers

Answer:

The base case

Explanation:

Required

The part that determines the termination of a recursion

This part of a recursion is referred to as the base case.

Take for instance, the following:

factorial(int n) {

   if (n < = 1) {         return 1; }

   else {             return n*factorial(n-1);    }  }

The base case of the above is     if (n < = 1) {         return 1; }

Because the recursion will continue to be executed until the condition is true i.e. n less than or equals 1

People think that they can send email messages from their personal computers and that it cannot be traced. This is called the _____.

Answers

Message Trace

Essentially it's a method used by administrators to monitor and trace emails

anyone know how to translate this 1100111111110100000110 pls n ty!4!:$;

Answers

Answer:

1100111111110100000110 = �

Binary -> UTF-16

3,407,110 in decimal form

Additionally, it also translates to the color green in hexadecimal.

Not really sure what you are trying to translate this in to though.

yeah sure no problem that says

What temperature is most commonly used in autoclaves to sterilize growth media and other devices prior to experimentation

Answers

Answer:

The most effective temparature used in autoclave is 121°C

Assume that processor refers to an object that provides a void method named process that takes no arguments. As it happens, the process method may throw one of several exceptions. Write some code that invokes the process method provided by the object associated with processor and arrange matters so that your code causes any exception thrown by process to be ignored. Hint: use the catch (Exception ex) and do nothing under the catch clause.

Answers

Answer:

Following are the code to the given question:

try//defining a try block

{

processor.process();//defining an object processor that calls process method

}

catch(Exception e)//defining a catch block

{

}

Explanation:

In this question, the 'Try' and 'catch' block is used in which both the keywords are used to represent exceptions managed during runtime due to information or code errors. This try box was its code block which includes errors. A message queue catches the block errors and examines these.

In the try block, a method "process" is used which is create the object processor that calls the method.

Other Questions
Why did businesses hire children?O A. They could pay them less than adults.B. They wanted to give them part-time jobs.O C. They wanted to give them a skill.D. They could keep them off the street.SUBN The company's bank reconciliation at June 30 included interest earned in the amount of $150. Complete the necessary journal entry by selecting the account names and dollar amounts from the drop-down menus. Which propaganda technique is being used in the following statement? "My opponent is much younger than I, and has not learned to be responsible enough to do this job." "Fine! Avery said, pushing a stack of books away and looking up at the clock on the wall. "But our papers due in three days and we still dont have topic. What are we going to do?"Its obvious, isnt it? Maritza asked. "You write why Rosa Parks is so great, and Ill do the same for Irene Morgan. And then well put it all together.Which best describes the relationship between character and conflict in the excerpt? What is the sum of the polynomials (-x^2 +9) + (-3x^2 - 11x + 4) What was the main goal behind the temperance movement? Calculate real rate if you have nominal rate is 12% and inflation rate is 7% Enter the answer in percentage format to two decimal place without the % sign -> 9.30 and not 9.3% or .093) A 20.0 mL solution of NaOH is neutralized with 24.1 mL of 0.200 M HBr. What is the concentration of the original NaOH solution If a jelly bean machine contains 16 pink jelly beans, 34 blue jelly beans, 24black jelly beans, and 26 purple jelly beans, what is the probability that a jellybean chosen at random will be pink? Need help with this really fast What is the standard form equation of the line shown below? Graph of a line going through negative 1, 5 and 2, 4 Using Euler's formula, howmany edges does a polyhedronwith 5 faces and 5 vertices have?[?] edgesEuler's Formula: F + V = E + 2 How many of you that how mom and dad are called in nepali. Item65eBookItem 65When managers identify a market trend that suggests a new opportunity and then devise a strategy to go after this new opportunity, they are involved in the function of (d) X(-12) = 132help me with equations Please help me I dont understand I have been working on this question for 14 minutes!!!m On Monday, 27 adults visited an amusement park. On Tuesday, 23 adults visited the amusement park. The enterance fee for the adults is Rs. 100. How much amount is collected from the adults in these two days? PLEASE TELL FULL SOLUTION. Bjr pouvez vous m'aider By converting to an exponential expression, solve log2 (x + 5) = 4 the growth of a fungal hyphae tip is?