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
Is the hacker group project zorgo real or fake
Charra [1.4K]

It is real I hoped this help you

4 0
3 years ago
Read 2 more answers
Which of these statements regarding mobile games is true?
telo118 [61]
I have a feelings it’s the one that’s about playing for long lengths of time
8 0
3 years ago
Read 2 more answers
A.Create the logic for a program that calculates and displays the amount of money you would have if you invested $5000 at 2 perc
lianna [129]

Answer:

see explaination

Explanation:

a)

amount = 5000

rate = 2

year = 1

interest = calculateInterest(amount, rate, year);

finalAmount = amount + interest

###### function ######

calculateInterest(amount, rate, year):

interest = (amount*rate*year)/100;

return interest

b)

amount <- enter amount

rate = 2

year = 1

interest = calculateInterest(amount, rate, year);

finalAmount = amount + interest

###### function ######

calculateInterest(amount, rate, year):

interest = (amount*rate*year)/100;

return interest

c)

#include <iostream>

using namespace std;

// function defination

double calculateInterest(double amount, double rate, int year);

int main(){

double amount, rate;

int year = 1;

cout<<"Enter amount: ";

cin>>amount;

cout<<"Enter rate: ";

cin>>rate;

// calling method

double interest = calculateInterest(amount, rate, year);

cout<<"Amount after 1 year: "<<(amount+interest)<<endl;

return 0;

}

// function calculation

double calculateInterest(double amount, double rate, int year){

return (amount*rate*year)/100.0;

}

7 0
3 years ago
I have a small business with only two computers. These computers are connected directly together and share resources. What type
kap26 [50]

Hello

For that case, the network is LAN or Local Area Network.

Best regards

4 0
3 years ago
Read 2 more answers
Determine which careers you can enter after completing a training program and which careers require a college degree.
KonstantinChe [14]

Answer: statistician automotive engineer customer service specialist data modeler broadcast technician video systems technician

Explanation:

8 0
3 years ago
Other questions:
  • What are chemical manufacturers required to provide to anyone who purchases or uses their chemicals for a work purpose? Select a
    8·2 answers
  • You connect three 0.5 volt lights in series. Each light has a resistance of 25ohms. Answer the following.
    9·1 answer
  • _______ technology is used in many hospitals to verify that the correct medication is being dispensed to the applicable patient.
    15·1 answer
  • A database design where certain data entities are combined, summary totals are carried in the data records rather than calculate
    5·1 answer
  • Write a function shampoo_instructions() with parameter num_cycles. If num_cycles is less than 1, print "Too few.". If more than
    15·1 answer
  • Paula needs to ensure that an animation she has created is repeated. Which option should she use to achieve this?
    8·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
  • Write. true or false​
    5·2 answers
  • The USGS and National Weather Service have many sensors collecting data about natural events.
    8·2 answers
  • What is the purpose of a web server? What is the purpose of a web browser?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!