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
What impact did congress declaration on copyrighting sound recordings have on home recording and record sales
cricket20 [7]

Answer:

By the late 1980s, several manufacturers were prepared to introduce read/write digital audio formats to the United States. These new formats were a significant improvement over the newly introduced read-only (at the time) digital format of the compact disc, allowing consumers to make perfect, multi-generation copies of digital audio recordings. Most prominent among these formats was Digital Audio Tape (DAT), followed in the early 1990s by Philips' Digital Compact Cassette (DCC) and Sony's Minidisc.

DAT was available as early as 1987 in Japan and Europe, but device manufacturers delayed introducing the format to the United States in the face of opposition from the recording industry. The recording industry, fearing that the ability to make perfect, multi-generation copies would spur widespread copyright infringement and lost sales, had two main points of leverage over device makers. First, consumer electronics manufacturers felt they needed the recording industry's cooperation to induce consumers – many of whom were in the process of replacing their cassettes and records with compact discs – to embrace a new music format. Second, device makers feared a lawsuit for contributory copyright infringement.[1]

Despite their strong playing hand, the recording industry failed to convince consumer electronics companies to voluntarily adopt copy restriction technology. The recording industry concurrently sought a legislative solution to the perceived threat posed by perfect multi-generation copies, introducing legislation mandating that device makers incorporate copy protection technology as early as 1987.[2] These efforts were defeated by the consumer electronics industry along with songwriters and music publishers, who rejected any solution that did not compensate copyright owners for lost sales due to home taping.[3]

The impasse was broken at a meeting in Athens in 1989, when representatives from the recording industry and the consumer electronics industry reached a compromise intended to enable the sale of DAT recorders in the United States. Device manufacturers agreed to include SCMS in all consumer DAT recorders in order to prevent serial copying. The recording industry would independently pursue legislation requiring royalties on digital audio recording devices and media.[4]

A year later the songwriter Sammy Cahn and four music publishers, unhappy with the absence of a royalties provision in the Athens agreement, filed a class action copyright infringement suit against Sony.[5] The plaintiffs sought declaratory and injunctive relief that would have prevented the manufacture, importation or distribution of DAT recorders or media in the United States. The suit brought Sony to heel. In July 1991, Sony, as part of larger agreement between the recording industry and consumer electronics makers, agreed to support legislation creating a royalty scheme for digital media. In exchange, Cahn and the publishers agreed to drop the suit.[6]

With all the major stakeholders satisfied, the bill easily passed both houses of Congress. President George H. W. Bush signed the AHRA into law in 1992 proclaiming " S. 1623 [AHRA] will ensure that American consumers have access to equipment embodying the new digital audio recording technology. It also protects the legitimate rights of our songwriters, performers, and recording companies to be fairly rewarded for their tremendous talent, expertise, and capital investment. This will be accomplished by fairly compensating these artists for the copying of their works and by creating a system that will prevent unfettered copying of digital audio tapes."

3 0
3 years ago
Read 2 more answers
Write a recursive function that calculates if two binary trees are similar?
ahrayia [7]

Answer:

bool identicaltrees(Node* root1,Node* root2)//function of type boolean true if idenctical false if not.

{

   if(root1==NULL&&root2==NULL)//both trees are null means identical.

   return true;

   if(roo1 && root2)

   {

       if(root1->data==root2->data)//condition for recursive call..

       {

           return (identicaltrees(root1->left,root2->right)&&identicaltrees(root1->right&&root2->right);

       }

   }

   else

   return false;

}

Explanation:

In this function it of type boolean returns true if both the trees are identical return false if not.First we are checking root node of both the trees if both are null then they are identical returning true.

If both root nodes are not null then checking their data.If data is same then recursively traversing on both trees and checking both trees.

else returning false.

5 0
3 years ago
What are the three general methods for delivering content from a server to a client across a network
Tju [1.3M]

Answer:

Answered below.

Explanation:

The three general methods consist of unicasting, broadcasting and multicasting.

Casting implies the transfer of data from one computer (sender) to another (recipient).

Unicasting is the transfer of data from a single sender to a single recipient.

Broadcasting deals with the transfer of data from one sender to many recipients.

Multicasting defines the transfer of data from more than one sender to more than one recipients.

8 0
2 years ago
Select the correct answer from each drop-down menu.
tia_tia [17]

Answer:

<dd> tag is used

Explanation:

The <dd> tag is used in HTML document to explain set of terms. The <dd> tag list is used in conjunction with the <dl> term. Inside a <dd> tag we can insert text, sentence, paragraph or links. There are 4 primary tags to build any website. Every HTML document begins and ends with HTML tag.

6 0
3 years ago
Which term describes the distinct number of colors a graphic contains? (1 point)?
laila [671]
Your answer would be "Hue".
4 0
3 years ago
Other questions:
  • To gain one pound of fat, how many extra calories would you need to consume?
    12·1 answer
  • Casual or informal group meetings are common. Here youcasually chat over tea, meet after work, or get together for purelysocial
    5·1 answer
  • Write the pseudocode for linear search, which scans through the sequence, looking for ν. Using a loop invariant, prove that your
    14·1 answer
  • "what should you do if the system continually reboots and you can't read the error message produced on a blue screen
    11·2 answers
  • This procedure protects against the loss of data
    5·1 answer
  • Do you really think our life applications and OSs will be open source at the end for everything?
    11·1 answer
  • Which type of CPU instruction performs arithmetic calculations and stores the results in memory?
    14·2 answers
  • What is human data,
    8·1 answer
  • Why was the pilgrim's first corn crop such as successful one??
    7·1 answer
  • For a parking payment app, what option would MOST likely connect a user to a third party/external gateway?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!