Question: Console Shell Markdown Preview of README.md at 97 Work in Repl.it Lab 4 checo pdf Task: Formatting & Parsing Shot 9.00 PM here The complex




Console Shell Markdown Preview of README.md at 97 Work in Repl.it Lab 4 checo pdf Task: Formatting & Parsing Shot 9.00 PM here The complex number is expressed in the form a +bi, where a and b are real numbers, and i represents the "imaginary unit". . Write a class that defines a complex number and use streaming operations for formatting string output and parsing. and 9 Details 2 ber. 1. pts 2 guments 1. Define a class Complex that will store 2 integer coefficients of the complex number. Add the default constructor that accepts 2 int- typed parameters with default arguments which set these parameters to zero. All data members must be private. 2. Write accessor methods re and in that provide read- only access to the real and imaginary part of the Complex object 3. Overload the stream extraction operator for the Complex class to output the string representation of the complex number, as where an is a real and is an imaginary coefficients of the complex number Shot 05 PM eat ] imaginary Shot 2:42 PM -ing > for the Complex class to output the string representation of the complex number, as " i" where is a real and is an imaginary coefficients of the complex number. See related tests in main.cpp. The operator declaration is provided. Hint: For formatting, use append method and += operator of std::basic_string, or std::ostringstream streaming operators. 4. Overload the stream insertion operator is an Bers 25 / sci272-sp21-lab4-e... C Run Console Shell Preview of READ Lab 4 Task: Formatt ad I main.cpp 1 // 2 // DO NOT MODIFY NEXT LINE 3 // 4 #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
