Here is my code and the error i get now is at the bottom.
Code:
#include <iostream.h>
#include <iomanip.h>
#include <fstream.h>
#include <sstream.h>
#include <string>
using namespace std;
int main()
{
char address[70];
char name[50];
char phone[20];
char description[200];
int zip;
int correct=2;
int id=0000;
int id2;
int option;
int quanf=1;
int quan46=1;
int qaun57=1;
int quan810=1;
int quanf57=1;
double pricef;
double price46;
double price57;
double price810;
double pricef57;
double product[10];
double cash_tend=0.00;
double change;
double total;
;
cout<<"Welcome to my first Register Program\n";
cout<<"*******Good Luck Today*******\n";
for (int i=0;i<100;i++)
{
cout<<"Please chose an option:\n";
cout<<"(1)New Customer\n(2)Previos Customer\n(3)Exit\n";
cin>>option;
switch(option)
{
case 1:
while(correct==2)
{
id++;
cin.ignore();
cout<<"Please enter name:\n";
cin.getline(name, 50, '\n');
cout<<"Please enter address:\n";
cin.getline(address, 70, '\n');
cout<<"Please enter zip code:\n";
cin>>zip;
cin.ignore();
cout<<"Please enter phone number:\n";
cin.getline(phone, 20, '\n');
cout<<"Please enter description:\n";
cin.getline(description, 200, '\n');
cout<<endl<<"Name: "<<name<<endl;
cout<<"Address: "<<address<<endl;
cout<<"Zip Code: "<<zip<<endl;
cout<<"Phone: "<<phone<<endl;
cout<<"Description: "<<description<<endl;
cout<<"\nIs this information correct?\n(1)Yes\n(2)No\n";
cin>>correct;
}
product[0]=10.00; //Product one: 4X6
product[1]=10.00; //Product two: Frame
product[2]=15.00; //Product three: 5X7
product[3]=15.00; //Product four: Frame with 5X7
product[4]=20.00; //Product five: 8X10
product[5]=0.00; //Product six: Other
correct=2;
while(correct==2)
{
cout<<"How many 4X6 were purchase:\n";
cin>>quan46;
cout<<"How many 5X7 were purchase:\n";
cin>>qaun57;
cout<<"How many 8X10 were purchase:\n";
cin>>quan810;
cout<<"How many FRAMES were purchase:\n";
cin>>quanf;
cout<<"How many FRAMES W/ 5X7 were purchase:\n";
cin>>quanf57;
cout<<"4X6: "<<quan46<<endl;
cout<<"5X7: "<<qaun57<<endl;
cout<<"8X10: "<<quan810<<endl;
cout<<"Frame(s): "<<quanf<<endl;
cout<<"Frames w/ 5X7: "<<quanf57<<endl;
cout<<"\nIs this Correct?\n(1)Yes\n(2)No\n";
cin>>correct;
}
price46=quan46*product[0];
price57=qaun57*product[2];
price810=quan810*product[4];
pricef=quanf*product[1];
pricef57=quanf57*product[3];
total=price46+price57+price810+pricef+pricef57;
cout<<"\nTotal Cost: "<<total<<endl;
cout<<"Cash Tended: \n";
cin>>cash_tend;
change=cash_tend-total;
cout<<"Change: "<<change<<endl;
break;
case 2:
cout<<"Please enter there ID number\n";
cin>>id2;
//Will then search for the id number in the output file.
break;
case 3:
cout<<"This is just a test case 3\n";
break;
default:
cout<<"Your entered an Invalid choice\n";
};
cout<<endl<<(char)id<<endl;
string s = "";
s += id;
ofstream a_file(s+".txt");
a_file<<id<<endl<<name<<endl<<address<<endl<<zip<<endl<<phone<<endl<<description<<endl<<quan46<<" 4X6"<<endl<<qaun57<<" 5X7"<<endl<<quan810<<" 8X10"<<endl<<quanf<<" Frames"<<endl<<quanf57<<" Frames w/ 5X7"<<endl<<"Total: "<<total<<endl<<"Cash Tended: "<<cash_tend<<endl<<"Change: "<<change<<endl<<endl<<endl;
a_file.close();
correct=2;
}
return 0;
}
Error : function call 'basic_ofstream(std::basic_string<char, std::char_traits<char>, std::allocator<char>>)' does not match
'std::basic_ofstream<char, std::char_traits<char>>::basic_ofstream()'
'std::basic_ofstream<char, std::char_traits<char>>::basic_ofstream(const char *, std::ios_base:penmode)'
'std::basic_ofstream<char, std::char_traits<char>>::basic_ofstream(const std::basic_ofstream<char, std::char_traits<char>> &)'
hello.cpp line 155 ofstream a_file(s+".txt");