elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Introducción a Git (Primera Parte)


  Mostrar Temas
Páginas: [1]
1  Seguridad Informática / Seguridad / El Antivirus, es efectivo? en: 28 Mayo 2015, 16:41 pm
Quisiera aclarar unas dudas acerca del antivirus. El mismo es costoefectivo usarse en una PC ?

Cual es su funcion?

Que bloquea, que no bloquea ?

Cual es su fin ?

O el antivirus es una forma de vender un "tipo de proteccion" ?

2  Programación / Programación C/C++ / Ayuda de Arreglos y Organizar Un File en orden Alfabetico!! HELP en: 14 Mayo 2015, 05:30 am
Como meto datos de una estructura en un arreglo ?

Como puedo organizar un file por orden alfabetico. Quizas con un bubble sort ?
3  Programación / Programación C/C++ / Porque No Me Deja Crear El File(OPCION 3) AYUDA!!! en: 12 Mayo 2015, 03:27 am
EN LA OPCION 3 NO ME DEJA CREAR EL FILE! SIN EMBARGO CUANDO HAGO ESO MISMO EN UN MAIN SOLO SI ME DEJA!

Código:
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
#include <iomanip>
using namespace std;

struct costumerInfo
{
string name;
string addr;
string city;
string state;
string zip;
string phoNum;
};

int main()
{
int menupri = 0; //contador del do while(menupri)
int choicemp; //variable que elige la opcion en el menu principal
string filenamemov = "dataMovies.dat";
string line;

do //menu principal
{
cout << "------ MOVIE DATABASE SYSTEM -------" << endl;
cout << "------------------------------------" << endl;//menu header

cout << "Select Your Choice:                 " << endl;
cout << "1. Edit Costumer Info               " << endl;
cout << "2. Add Movie Record To A Costumer   " << endl;
cout << "3. Create New Costumer              " << endl;
cout << "4. Search Costumer Record           " << endl;
cout << "5. Delete Costumer Record                             " << endl;
cout << "------------------------------------" << endl;
cout << "Please Enter Your Choice: ";
cin >> choicemp;

system("cls");

switch (choicemp)//opciones del menu principal
{
case 1://presenta la opcion 1
{
//EDIT COSTUMER INFO

system("pause");
system("cls");
break;
}

case 2://presenta la opcion 2
{
//ADD MOVIE RECORD TO A COSTUMER

system("pause");
system("cls");
break;
}

case 3://presenta la opcion 3 *FILE NO SE CREA VERIFICAR!!!
{
//cout << "--- CREATE NEW COSTUMER RECORD ---" << endl;
//cout << "----------------------------------" << endl;

ofstream newcostFile, movFile;
costumerInfo infoCost;

cout << "\nEnter New Costumer Name: ";
getline(cin, infoCost.name);

newcostFile.open(infoCost.name);

if (newcostFile.fail())
{
cout << "\nThe File Cannot Be Created Correctly." << endl;
system("pause");
exit(1);
}

cout << "\nAddress: ";
getline(cin, infoCost.addr);

cout << "\nCity: ";
getline(cin, infoCost.city);

cout << "\nState: ";
getline(cin, infoCost.state);

cout << "\nZIP Code: ";
cin >> infoCost.zip;

cout << "\nPhone Number: ";
getline(cin, infoCost.phoNum);

newcostFile << "Name\t" << infoCost.name << endl
<< "Address \t" << infoCost.addr << endl
<< "City \t" << infoCost.city << endl
<< "State \t" << infoCost.state << endl
<< "ZIP Code \t" << infoCost.zip << endl
<< "Phone Number \t" << infoCost.phoNum << endl;

movFile.open(infoCost.name + "Movies");

if (movFile.fail())
{
cout << "\nThe File Cannot Be Create Correctly.";

system("pause");
exit(1);
}

newcostFile.close();
movFile.close();

system("pause");
system("cls");
break;
}

case 4:
{
//SEARCH COSTUMER RECORD

system("pause");
system("cls");
break;
}

case 5:
{
//DELETE COSTUMER RECORD

system("pause");
system("cls");
break;
}

default://cierra el programa
{
return 0;
break;
}
}

} while (menupri != 6);

system("pause");
return 0;
}
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines