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
Aleksandr [31]
3 years ago
8

Define a data type for representing complex numbers. (A complex number consists of 'real' and 'imaginary' parts. The real and im

aginary parts can represent the x and y coordinates of a point on a plane.) How can a complex data type be created? (pick correct choice in Illustration 2 )
Computers and Technology
1 answer:
qwelly [4]3 years ago
5 0

Answer:

A complex data type can be created by the use of class or structures.

#include <iostream>

using namespace std;

class complex{//creating a class complex to store a complex value.

public://defining all the values public.

int real;

int img;

complex(int real,int img)//parameterized constructor.

{

    this->real=real;

    this->img=img;

}

};

int main() {

   complex n1(1,2);//n1 is a complex number with real part 1 and imaginary part 2.

   cout<<n1.real<<" i"<<n1.img<<endl;

return 0;

}

Output

1 i2

Explanation:

I have created a class complex to store complex number with two integer parts real and imaginary.You can also declare them float if you wan to store decimal values and after that i have created a parameterized constructor with real and imaginary values.So we can assign the values at the time of declaration of the object of class complex.

You might be interested in
Under which of the following conditions will evaluating this boolean expression
zzz [600]
1.) 
<span>((i <= n) && (a[i] == 0)) || (((i >= n) && (a[i-1] == 0))) </span>

<span>The expression will be true IF the first part is true, or if the first part is false and the second part is true. This is because || uses "short circuit" evaluation. If the first term is true, then the second term is *never even evaluated*. </span>

<span>For || the expression is true if *either* part is true, and for && the expression is true only if *both* parts are true. </span>

<span>a.) (i <= n) || (i >= n) </span>

<span>This means that either, or both, of these terms is true. This isn't sufficient to make the original term true. </span>

<span>b.) (a[i] == 0) && (a[i-1] == 0) </span>

<span>This means that both of these terms are true. We substitute. </span>

<span>((i <= n) && true) || (((i >= n) && true)) </span>

<span>Remember that && is true only if both parts are true. So if you have x && true, then the truth depends entirely on x. Thus x && true is the same as just x. The above predicate reduces to: </span>

<span>(i <= n) || (i >= n) </span>

<span>This is clearly always true. </span>
3 0
3 years ago
When you hear the word “stress” what does it mean to you? How does stress affect you and what do you do to cope with stress
stepan [7]

   Ways to Cope with  Stress

  • Re-balance Work and Home.
  • Build in Regular Exercise.
  • Eat Well and drink lots of water.
  • Connect with Supportive People.
  • Carve out Hobby Time.
  • Practice Meditation, Stress Reduction or Yoga.
  • Sleep Enough.
  • Bond with Your Pet.

 

hope it helps! :)

3 0
3 years ago
Which LIKE operator would match a single character?<br><br> *<br> ?<br> []<br> #
algol [13]

Answer:

underscore hope that helps

Explanation:

4 0
3 years ago
Ryan is looking to buy a new HDTV set. He knows from friends that LCD set screens reflect less light than plasma set screens, bu
lbvjy [14]

Answer: Cognitive

Explanation:

 According to the question, the Ryan shows cognitive attitude towards the HDTV. The cognitive component basically refers to the three main components that are:

  • Thoughts
  • Beliefs
  • Attributes

The cognitive component is one of the type of attitude which basically consist of various types of thoughts, knowledge and the beliefs towards the any type of object. It is one of the belief and opinion of the attitude.  

3 0
3 years ago
QUICKLY PLEASE!!!
Elza [17]

Answer: As the conventional etiquette, which lays out rules of ethics in social contexts, the purpose of netiquette is to help create and sustain a friendly, relaxed and productive atmosphere for online contact, as well as to avoid putting pressure on the system and creating tension between users.

Explanation:

7 0
3 years ago
Other questions:
  • What is one concern associated with web-based applications?
    12·1 answer
  • Organisms are classified as producers or consumers acorrding to the way they
    11·2 answers
  • Jenny is working on a laptop computer and has notices that the computer is not running very fast. She looks and realizes that th
    6·2 answers
  • When someone registers a domain name that is a company's trademark, hoping to resell it to the company at an exorbitant profit,
    14·2 answers
  • Three of the most important jobs of security management are to ensure _____ are organized according to sensitivity, ensure that
    10·1 answer
  • Which of the following is true regarding a class and interface types? Group of answer choices You can convert from a class type
    9·1 answer
  • Machines may aid in making work easier over a longer distance. true or false.
    7·1 answer
  • While reviewing the Quick Access toolbar, Sarah notices that the Redo button is not there. This is because the Redo button only
    12·1 answer
  • A musical time measurer is a(an)
    10·1 answer
  • I will give brainyest
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!