560931 projectc++
N/A
Publicado há quase 12 anos
#include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <iomanip>
//#include "products.h"
using namespace std;
void clrscr()
{
system("cls");
}
class product
{
private:
string proName;
string proModel;
float proPrice;
public:
void readRecord(ifstream&);
void createProduct(string,string,float);
void getPrice();
void displayDetails();
void getName();
};
int const MAXPRO = 10;
product products[MAXPRO];
void product::readRecord(ifstream& file)
{
int count = 0, i = 0;
while (![login to view URL]())
{
file >> products[count].proName
>> products[count].proModel
>> products[count].proPrice;
count++;
}
[login to view URL]();
cout <<setw(15)<<"Product Name"<<setw(15)<<"Model Number"<<setw(15)<<"Price"<<endl;
cout<<"\n";
for (i=0; i<count; i++)
cout <<setw(15) << products[i].proName
<<setw(15) << products[i].proModel
<<setw(15) << products[i].proPrice<<endl;
}
class customer
{
private:
string name;
string password;
public:
//customer();
void createCust();
void getName(string);
};
//customer::customer(string fName,string pass)
//{
//
// name = fName;
// password = pass;
// address = add;
//
//}
void customer::createCust()
{
string username , password;
do {
cout<<"Please enter your username :"<<" ";
getline(cin,username);
if(username == "admin");
{
cout<<"\n";
cout<<setw(15)<<"Please enter your password :"<<" ";
getline(cin,password);
if(password !="password")
{
cout<<"\n";
cout<<"Invalid password or username. try again"<<endl;
cout<<"\n";
}
}
}while (password !="password");
}
class order
{
private:
customer cust;
int productList[];
int numProducts;
public:
};
int main()
{
//int const MAXPRO = 10;
//product products[MAXPRO];
product proDetails;
customer custDetails;
ifstream infile;
[login to view URL]("[login to view URL]");
if ([login to view URL]())
cout << "File doesn't exist ";
[login to view URL](infile);
cout<<"\n";
cout<<"\n";
cout<<"\n";
[login to view URL]();
system("pause");
return 0;
}
ID do Projeto: 2306886
Sobre o projeto
Projeto remoto
Ativo há 12 anos
Quer ganhar algum dinheiro?
Benefícios de ofertar no Freelancer
Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
É grátis para se inscrever e fazer ofertas em trabalhos