Hey, Im getting two C2660 Errors even though I have defined all my variables and such, and Im not sure why it isnt working, can anyone help me out? -
//Program Project 5
-
#include<iostream>
-
#include<iomanip>
-
#include<fstream>
-
#include<string>
-
void print_title(float TotNew, float TotOwed, int NumBasic, int NumPremium, int NumUltra);
-
void print_ending(char Month[10]);
-
using namespace std;
-
int main()
-
{
-
ofstream prn ("PRN");
-
int NumEmp, ServCode, ctr=1, NumBasic=0, NumPremium=0, NumUltra=0;
-
char Month[10];
-
string Name, SrvCode;
-
float New_Charge[4] = {0, 45, 75, 100};
-
float PrevBal, FinChrg, AmtOwed, TotNew=0, TotOwed=0, NewChrg;
-
const double FINCHRG=0.1;
-
cout<<"Enter the Month\n";
-
cin>>Month;
-
cout<<"Enter Number of Employees\n";
-
cin>>NumEmp;
-
-
print_title (Month); //One error Happening here
-
-
for(ctr=1; ctr<=NumEmp; ctr++)
-
{
-
cout<<setprecision(2)<<fixed<<showpoint<<endl;
-
cout<<"Enter Customers Name\n";
-
cin.ignore();
-
getline(cin,Name);
-
cout<<"Enter Service Code\n";
-
cin>>ServCode;
-
cout<<"Enter Previous Balance\n";
-
cin>>PrevBal;
-
if (ServCode==1);
-
New_Charge[1];
-
SrvCode= "Basic";
-
NumBasic++;
-
if (ServCode==2);
-
New_Charge[2];
-
SrvCode= "Premium";
-
NumPremium++;
-
if (ServCode==3);
-
New_Charge[3];
-
SrvCode= "Ultra";
-
NumUltra++;
-
FinChrg=PrevBal * FINCHRG;
-
AmtOwed=PrevBal + FinChrg + NewChrg;
-
TotNew+=NewChrg;
-
TotOwed+=AmtOwed;
-
cout<<setw(20)<<Name<<setw(8)<<SrvCode<<setw(10)<<PrevBal<<setw(10)<<FinChrg<<setw(9)<<NewChrg<<setw(10)<<AmtOwed<<endl;
-
}
-
-
print_ending (TotNew, TotOwed, NumBasic, NumPremium, NumUltra); //And the other here
-
-
return 0;
-
}
-
-
void print_title(char Month[10])
-
{
-
cout<<setw(50)<<"COBY CABLE MONTHLY REPORT FOR "<<Month<<endl<<endl;
-
cout<<setw(29)<<"SERVICE"<<setw(20)<<"FINANCE"<<setw(6)<<"NEW"<<setw(10)<<"AMT"<<endl;
-
cout<<setw(20)<<"CUSTOMER NAME"<<setw(8)<<"TYPE"<<setw(11)<<"BALANCE"<<setw(10)<<"CHARGE"<<setw(8)<<"CHARGE"<<setw(8)<<"OWED"<<endl;
-
cout<<setw(20)<<"-------- ----"<<setw(8)<<"----"<<setw(11)<<"-------"<<setw(10)<<"------"<<setw(8)<<"------"<<setw(8)<<"----"<<endl;
-
}
-
void print_ending(float TotNew, float TotOwed, int NumBasic, int NumPremium, int NumUltra)
-
{
-
cout<<setw(57)<<"-------"<<setw(10)<<"-------"<<endl;
-
cout<<setw(53)<<"$ "<<TotNew<<setw(3)<<"$ "<<TotOwed<<endl;
-
cout<<endl<<setw(50)<<"Number of Basic: "<<NumBasic<<endl;
-
cout<<setw(50)<<"Number of Premium: "<<NumPremium<<endl;
-
cout<<setw(50)<<"Number of Ultra: "<<NumUltra<<endl;
-
}
6 1811
Well, let's look at this: -
print_title (Month); //One error Happening here
-
-
So where is that declared? -
// includes here
-
-
//function definition
-
void print_title(float TotNew, float TotOwed, int NumBasic, int NumPremium, int NumUltra);
-
-
//main function here
-
// . . .
-
print_title (Month); //One error Happening here
-
// . . . (end of main)
-
-
-
//function implementation
-
void print_title(char Month[10])
-
{
-
cout<<setw(50)<<"COBY CABLE MONTHLY REPORT FOR "<<Month<<endl<<endl;
-
cout<<setw(29)<<"SERVICE"<<setw(20)<<"FINANCE"<<setw(6)<<"NEW"<<setw(10)<<"AMT"<<endl;
-
cout<<setw(20)<<"CUSTOMER NAME"<<setw(8)<<"TYPE"<<setw(11)<<"BALANCE"<<setw(10)<<"CHARGE"<<setw(8)<<"CHARGE"<<setw(8)<<"OWED"<<endl;
-
cout<<setw(20)<<"-------- ----"<<setw(8)<<"----"<<setw(11)<<"-------"<<setw(10)<<"------"<<setw(8)<<"------"<<setw(8)<<"----"<<endl;
-
}
So do you see anything out of place there?
EDIT. Oh Wow, thanks, just caught it. I accidently reversed my call ins, All fixed. Thanks a bunch for the help.
Glad I could help - was that the case with the second error as well?
Yea, it was a logic error on my part, when I went through at the top, I identified the right variables to the wrong function. Thanks Again.
Good, glad you got it. Feel free to post again if you run into anything else.
Well, I acutally ran into another problem on this one. When I was trying to print, I had
in main, and then it wouldnt build, so I added
to each of the functions, and when i printed, it printed on 3 pages, each function on a different page, Is there something Im doing wrong, or is there a way to get it to print all on one page?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Gregory |
last post by:
Hi,
One of the disadvantages of using error handling with error codes
instead of exception handling is that error codes retuned from a
function can be forgotten to check thus leading to...
|
by: Richard |
last post by:
Hi All,
I am using Visual C++ .Net to create a windows forms application and I am
getting the following errors when I do a MessageBox::Show in my Form1.cpp
file:
Form1.cpp(19): error C2653:...
|
by: Andreas Poller |
last post by:
Hello,
I have the following problem:
I have a class deriving from ICustomTypeDescriptor:
public __gc class TPropertyBag : public ICustomTypeDescriptor
{
private: ...
|
by: Child |
last post by:
Hi, I am getting the error: "Procedure or function spAddActivity has too
many arguments specified. " on a stored procedure insert. I compared the
number of parameters in the function and the SP...
|
by: raveneros |
last post by:
error C2660: 'checkF' : function does not take 1 parameters
this is the error.
void checkF(char s,char dStr)
{
for (int i=0; i<count; ++i)
if (strcmp(s, list.getId())==0) ...
|
by: Minx |
last post by:
This seems like a cool site, I wish I could have found this sooner.
Can someone pls help me with this line of code? I get an error C2660 telling me the function does not take an argument ( The...
|
by: yalbizu |
last post by:
#include <iostream>
#include <string>
#include <fstream>
#include <iomanip>
using namespace std;
const int NO_OF_STUDENTS=20;
struct studentType
{
string studentFName;
string studentLName;
|
by: denxx |
last post by:
Hi, I am new in C++ and was trying to run a programme where I found an error using the pow statement. Error showed is error C2660: 'pow' : function does not take 1 parameters. As I have a square on...
|
by: charmeda103 |
last post by:
My program keeps getting me and error and i dont why
here is the error message
error C2061: syntax error: identifier 'infile'
error C2660: 'ReadDate' : function does not take 6 arguments...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |