Create a class complex which store real and imaginary part of a complex number. input
5 complex number & display it.
At the beginning of the program, the code will open and read values in from a file.
The file will have an unknown number of lines. The program is required to read this data, line by line, into a 2D dynamic array of strings.
The format of the line is :
1,a,b,c,d
Each line starts with an ID, which is an int, and then will be followed by an unknown
number of strings separated by commas. Each string in the line is associated with the ID
of the line.
The 2D dynamic array should be sized to exactly the size of the number of items in each
line. Each line will have at least the ID and 1 item.
Once the items are stored in the array you need to print out the array in ascending order
based on the order IDs in the following format:
ID,a,b,c
An example of this output is as follows (for 2 orders):
3,cat,dog,mice
4,black,red,blue
write a program to illustrate difference between static data members and non static data members.
WAP to illustrate difference between static data members and non static data members .
At the start of your program, your code will open and read values in from a le data.txt.
The le will have an unknown number of lines. You are required to read this data, line
by line, into a 2D dynamic array of strings.
The format of the line is as follows:
1,a,b,c,d
Each line starts with an ID, which is an int, and then will be followed by an unknown
number of strings separated by commas. Each string in the line is associated with the ID
of the line.
Your 2D dynamic array should be sized to exactly the size of the number of items in each
line. Each line will have at least the ID and 1 item.
Once the items are stored in the array you need to print out the array in ascending order
based on the order IDs in the following format:
ID,a,b,c
An example:
4,spanner,wrench,hammer
Terminate each line of output with a newline. Remember to deallocate any memory you have used at the end of your program.
The following libraries are allowed: iostream, fstream, string, sstream
Declare Static members as public and Show the behavior change of those members by writing relative member functions.Declare Static members as public and Show the behavior change of those members by writing relative member functions.