Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you please help me debug this program I think the error starts on line 333 in Void Modify(). If you have anymore questions I

Can you please help me debug this program I think the error starts on line 333 in Void Modify(). If you have anymore questions I can try to answer them. Thank you so much!! Also any changes you think will make it better and not cause errors is greatly welcomed! The program specs are at the bottom.

333 43 C++ Final Project.cpp [Warning] ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:, bold below.

void DisplayAll()

192 7 C:\Program Files (x86)\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\bits\postypes.h [Note] candidate 1: std::fpos<_statet> std::fpos<_statet>::operator-(std::streamoff) const [with _StateT = int; std::streamoff = long long int]

333 43 C:\Users\Nick\Documents\West Ga Tech\Spring 2017\CIST 2361\Final Project\Nick Noles C++ Final Project.cpp [Note] candidate 2: operator-(std::streamoff {aka long long int}, long long unsigned int)

class file

40 0 C:\Program Files (x86)\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++\iosfwd In file included from C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++/iosfwd

I will bold all lines that is giving an error. Thank you!

#include #include #include #include #include #include

using namespace std;

class file { private: int cId; char ssNumber[100]; char fName[100]; char lName[100]; char address[100]; char phone[100];

public: void input(); void show(); char *getfn() { return fName; } char *getn() { return lName; } int getcId() { return cId; } char *getssn() { return ssNumber; } }; <<--- HERE Line 40

file fileobj;

void file::input() { cout<<"Enter your Customer Id : "; cin >> cId; cout << "Enter your S.S.Number : "; cin >> ssNumber; cout << "Enter your First Name : "; cin >> fName; cout << "Enter your Last Name : "; cin >> lName; cout << "Enter your Address : "; cin >> address; cout << "Enter your Phone Number : "; cin >> phone; }

void file::show() { cout<<"Customer Id ==> "<< cId< "<< ssNumber< "<< fName<" << lName<< endl; cout << "Address ==>" << address<< endl; cout << "Phone Number ==>"<< phone<< endl; }

void Create(); void Add(); void DisplayAll(); void DisplayP(); void Modify(); void Delete(); void DisplayByCustomerId(); void DisplayBySSN(); void DisplayByLName();

fstream fil;

int main() { int opt; while(1) { cout<<"1.Create Data File "<>opt; switch(opt) { case 1: { Create(); cout<<"Display Main Menu"<

void Create() //Function to Create Data File { char ch='y'; fil.open("customer.txt",ios::out| ios::binary); while(ch=='y' || ch =='Y') { fileobj.input(); fil.write((char*)&fileobj, sizeof(fileobj)); cout<>ch; } fil.close(); }

void Add() //Function to Add New Record in Data File { char ch='y'; fil.open("customer.txt",ios::app| ios::binary); while(ch=='y' || ch =='Y') { fileobj.input(); fil.write((char*)&fileobj, sizeof(fileobj)); cout<>ch; } fil.close(); }

void DisplayAll() //Function to Display All Record from Data File { <<--- HERE Line 192 fil.open("customer.txt",ios::in| ios::binary); if(!fil) { cout<<"File not Found"; exit(0); } else { fil.read((char*)&fileobj, sizeof(fileobj)); while(!fil.eof()) { fileobj.show(); cout<<"Press Any Key For Next Record"<

void DisplayByLName() //Function to Display particular Record from Data File on the basis of Last name { char n[100]; cout<<"Enter Last Name that should be searched : "; cin >> n; fil.open("customer.txt",ios::in| ios::binary); if(!fil) { cout<<"File not Found"; exit(0); } else { fil.read((char*)&fileobj, sizeof(fileobj)); while(!fil.eof()) { if(strcmp(n,fileobj.getn())==0) { fileobj.show(); cout<<"Press Any Key...."<

void DisplayByCustomerId() //Function to Display particular Record from Data File on the basis of customer id { int n; cout<<"Enter Customer Id that should be searched : "; cin >> n; fil.open("customer.txt",ios::in| ios::binary); if(!fil) { cout<<"File not Found"; exit(0); } else { fil.read((char*)&fileobj, sizeof(fileobj)); while(!fil.eof()) { if(n == fileobj.getcId()) { fileobj.show(); cout<<"Press Any Key to Quit"<

void DisplayBySSN() //Function to Display particular Record from Data File on the basis of SSN { char n[100]; cout<<"Enter S.S.Number that should be searched : "; cin >> n; fil.open("customer.txt",ios::in| ios::binary); if(!fil) { cout<<"File not Found"; exit(0); } else { fil.read((char*)&fileobj, sizeof(fileobj)); while(!fil.eof()) { if(strcmp(n,fileobj.getssn())==0) { fileobj.show(); cout<<"Press Any Key...."<

void Modify() //Function to Modify Particular Record from Data File { char n[100]; cout<<"Enter First Name that should be searched : "; cin >> n; fil.open("customer.txt",ios::in| ios::out|ios::binary); if(!fil) { cout<<"File not Found"; exit(0); } else { fil.read((char*)&fileobj, sizeof(fileobj)); while(!fil.eof()) { if(strcmp(n,fileobj.getfn())==0) { fil.seekg(0,ios::cur); cout<<"Enter New Record.."<HERE--> fil.seekp(fil.tellg() - sizeof(fileobj)); <<---- HERE Line 333 fil.write((char*)&fileobj, sizeof(fileobj)); } else { cout<<"Press Any Key For Search"<

void Delete() //Function to Delete Particular Record from Data File { char n[100]; cout<<"Enter First Name that should be Deleted : "; cin >> n; ofstream o; o.open("new_customer.txt",ios::out|ios::binary); fil.open("customer.txt",ios::in| ios::binary); if(!fil) { cout<<"File not Found"; exit(0); } else { fil.read((char*)&fileobj, sizeof(fileobj)); while(!fil.eof()) { if(strcmp(n,fileobj.getfn())!=0) { o.write((char*)&fileobj, sizeof(fileobj)); } else { cout<<"Press Any Key For Search"<

Serendipity Engineering, Inc.

Software Development Project

Program Specifications:

Serendipity Engineering, Inc. is a small engineering company located in a commercial park. The project manager wants you to develop a customer software package that will allow the company enter the customer information in the computer to keep a customer database. The software will perform the following tasks:

Enter Customer Information

Display Customer Information

Search Customer Information

Organize (Sort) Customer Information

Add, Delete, Modify, and Look Up Customer Records

Save Customer Information in a Database File

Display various reports

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Makers And Takers The Rise Of Finance And The Fall Of American Business

Authors: Rana Foroohar

1st Edition

0553447238, 978-0553447231

Students also viewed these Databases questions

Question

dy dx Find the derivative of the function y=(4x+3)5(2x+1)2.

Answered: 1 week ago

Question

Draw and explain the operation of LVDT for pressure measurement

Answered: 1 week ago