Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8985207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:16:52+00:00 2026-06-15T21:16:52+00:00

I got this assignment where I have linked list with Complex numbers and the

  • 0

I got this assignment where I have linked list with Complex numbers and the task is to imput and print these numbers with help of linked list. Several years ago i studied the basics of complex numbers but the assignment is really confusing for me now and I don’t know where to start, the only given information is the one above and the following .h file:

#ifndef COMPLEX_H
#define COMPLEX_H
#include <iostream>
struct Complex
{
  int real, imag;
};
void read(Complex &, std::istream &);
void print(const Complex &, std::ostream & os=std::cout);
bool operator<(const Complex & lhs, const Complex & rhs);
bool operator>(const Complex & lhs, const Complex & rhs);
bool operator==(const Complex & lhs, const Complex & rhs);

#endif

I would be rally thankful for some initial guidance with this assignment, what should the print and read functons contain (except the given arguments) in order to use?? bool operators above? I googled for couple of hours but could not find any good relevance between complex numbers tutorials and my task, furthermore i have deadline for this and contacting my teachers with questions about this will take days.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:16:53+00:00Added an answer on June 15, 2026 at 9:16 pm

    The print function should display the number on the indicated output stream. Conventionally, complex numbers are displayed like this: 1+2i or this: (1+2i) or even this: (1,2). You might accomplish this through operator chaining:

    os << "(" << c.real << "+" << c.imag << "i)";
    

    The equality check should return true if both components of lhs are equal to their counterparts in rhs:

    return lhs.real == rhs.real && lhs.imag == rhs.imag;
    

    The details of read, operator< and operator> will vary according to your exact assignment. Re-read your assignment, paying close attention to any definition of what those functions are required to do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is part of a homework assignment. I've got several questions asking find the
I have got this assignment question on HMM and I have solved it. I
I got this question as an assignment: Packages/Naming We have created lot of packages
I'm pretty new to C# and got this assignment. I have a class called
I´ve got this on the parent object @OneToMany(mappedBy=idUser, cascade = CascadeType.MERGE) public List<Directions> directions;
I have an assignment and i got a library including an interface class. [InfoItem]
Recently I have done an assignment, on overloading basic functionalists(+,-,conjugate...) of complex class using
I have this complex iterations program I wrote in TI Basic to perform a
So I have this University assignment in which I have to create a trigger
There I have this assignment where I am suppose to emulate the hexdump function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.