Student Needing help

I am writing a program for class and i need help. The instructions say; Design a class called Heading that has data members to hold the company name and the report name. A two-parameter default constructor should allow these to be specified at the time anew Heading object is created. If the user creates a Heading object without passing any arguments , "ABC Industries" should be used as a default value for the company name and "Report" should be used as a default for the report name. The class should have member functions to print a heading.
Can someone please tell me if I am heading in the correct direction and if not, then straighten me out, please.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 #include <iostream>

using namespace std;
 
class Heading
	public:
		{
		name (string company)                                         //Constructor 1 parameter
		{companyName  = company;
		}
		name((string report)                                          // Construtor with 1 paramneter
		{reportName = report
		}
		name()                                                        // Default constructor.
		{companyName= "ABC Industries" << endl;
		reportName = "Report" << endl;
		}
		};
Last edited on
http://www.cplusplus.com/forum/articles/40071/#msg216269

> A two-parameter default constructor should allow
1
2
name (string company) //Constructor 1 parameter
name (string company) //Constructor 1 parameter 

2 != 1
Also, ¿how do you expect to distinguish those two constructors?
i named the second report not company.
Heading foo("bar");
¿is `bar' a report or a company?

hint: it is an string.
i dont understand what you are getting at.
closed account (iAk3T05o)
You put two (( after name.
I corrected that in my program after I saw it in my post but forgot to edit it here.
Topic archived. No new replies allowed.