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
Dmitrij [34]
3 years ago
10

Define a class Complex to represent complex numbers. All complex numbers are of the form x + yi, where x and y are real numbers,

real numbers being all those numbers which are positive, negative, or zero.
Computers and Technology
1 answer:
Ksenya-84 [330]3 years ago
7 0

Answer:

The program in C++ is as follows:

#include<bits/stdc++.h>

using namespace std;

class Complex {

public:

 int rl, im;

Complex(){ }

Complex(int Real, int Imaginary){

 rl = Real;  im = Imaginary;

}

};

int main(){

   int real, imag;

   cout<<"Real: ";    cin>>real;

   cout<<"Imaginary: ";    cin>>imag;

Complex ComplexNum(real, imag);

cout<<"Result : "<< ComplexNum.rl<<" + "<<ComplexNum.im<<"i"<<endl;

}

Explanation:

See attachment for explanation

Download cpp
You might be interested in
Noi needs to send some documents to a client in another company. Which device can she use to make digital copies of the paper fi
soldier1979 [14.2K]
D scanner She can scan the files and email a digital copy.
4 0
2 years ago
Read 2 more answers
You have many drugs that you want to store electronically along with their purchase dates and prices, what kind of software woul
Doss [256]

Answer:

Database

Explanation:

To store a variety of drugs electronically, along with displaying their purchase dates and prices, the kind of software that would be used is database.

5 0
3 years ago
Define function print_popcorn_time() with parameter bag_ounces. If bag_ounces is less than 3, print "Too small". If greater than
Oxana [17]

Answer:

def print_popcorn_time(bag_ounces):

 if bag_ounces<3:

    print("Too Small")

 elif bag_ounces>10:

   print("Too Large")

 else:

   total = 6*bag_ounces

   print('{} seconds'.format(total))

Explanation:

Using Python programming language

The function is defined to accept a single parameter

Using a combination of if/elif/else statements, the approprite message is displayed when the function is called

6 0
3 years ago
C2.5 - A group of four pirates has a treasure chest and one unique lock and key for each pirate. Using hardware that is probably
slavikrds [6]

Answer:

Explanation:

All the pirates uses their individual key and lock for the locking down of each the four sides of the lid of to the chest. Among the pirates, if three of them decides to open their latches, they can be able to lift the top by essentially using the fourth (locked) latch as a hinge to open the top. (We have several solutions or ways to do this.)

3 0
3 years ago
What is the mode of 18, 18, 15, 18, 18, 24, 21, 21, 24, and 14?<br> 18<br> 18.5<br> 21<br> 22.3
OLga [1]

Answer: 18

Explanation:

7 0
3 years ago
Other questions:
  • Which of the following correctly orders the investments from LOWER risk to HIGHER risk?
    7·2 answers
  • The author of ""Cyber-psychopathy: What Goes On in a Hacker’s Head"" states that a crucial component of computer hacking lies in
    6·1 answer
  • Hydraulic systems use liquids because _____.
    14·2 answers
  • a rule that states each foreign key value must match a primary key value in the other relation is called the
    5·1 answer
  • Explain 3 categories of plagiarism​
    14·2 answers
  • Erewrxdnnefwn q wedsvd
    6·1 answer
  • What is the largest value that can be represented by 6 binary digits? .
    5·1 answer
  • I need some help with this assignment. I'm having difficulty trying come up ideas to use here. Can I get any help?
    5·1 answer
  • Define input hardware​
    12·1 answer
  • write a program that prompts the user to input the length of a string as an integer, followed by the string and outputs the stri
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!