Results 1 to 11 of 11
Thread: C++
Hybrid View
-
11th December 2020 02:59 #1Registered User
Join Date: Dec:2020
Location:
Posts: 3
C++
,
++, , , :
, , ;
, , " ".
, , , .
.
--------------------------------
- . :
, ;
1 , ;
2 ;
3 , , ;
4 ;
-------------------------------
#include <iostream>
#include <fstream>
using namespace std;
string nameGame;
int genreGame,processor,ram,numAvailable;
char multiplayer;
double price;
int main()
{
cout << "Please, choose your function: " << endl;
cout << " [1] Create a new file and add product details." << endl;
cout << " [2] Open an existing file." << endl;
// cout << " [3] " << endl;
cout << " [4] Add new record." << endl;
cout << "\n Number of function: ";
short nSign;
cin >> nSign;
switch( nSign ){
{
case 1:
cout << " Function 'Create a new file with product details': " << endl;
string sFileName;
cout << "\n Enter a file name: ";
cin >> sFileName;
sFileName += ".txt";
ofstream newFile;
newFile.open( sFileName.c_str() );
cout << " Enter details: ";
for(int k = 0; k < 7; k++){
string line;
cin >> line,
newFile << line + " ";
}
newFile.close();
break;
}
{
case 2:
cout << " Function 'Open an existing file': " << endl;
cout << "\n Enter the full file name: ";
string line;
cin >> line;
ifstream myfile (line);
if (myfile.is_open()){
while ( getline (myfile,line) ){
cout << "\n " + line << '\n';
}
myfile.close();
}
else cout << "Unable to open file";
break;
}
{
case 4:
ofstream outfile;
outfile.open("input.txt",ios_base::app);
if(!outfile){
cout << "Error Opening File" << endl;
return -1;
} else {
for(int k = 0; k < 7; k++){
string line;
cin >> line,
outfile << line + " ";
}
outfile.close();
}
break;
}
default:
cout << "\nFunction "" << nSign << "" does not exist." << endl;
break;
}
return 0;
}
-
11th December 2020 09:34 #2
-
11th December 2020 09:42 #3
-
11th December 2020 11:15 #4Registered User
Join Date: Jan:2010
Location: localhost:502
Posts: 153
CSV (- !) -
Cyrix 486DLC@33MHz,WD 80MB Caviar,8MB RAM,SVGA ISA,Tatung14"mono
-
11th December 2020 12:36 #5
, ,
.1 - 7 "", . .
.3 - "" , .Last edited by lindroos1; 11th December 2020 at 12:39. Reason: .
Those who abjure violence can only do so because others are committing violence on their behalf. - Orwell
-
11th December 2020 13:43 #6
-
11th December 2020 16:55 #7Registered User
Join Date: Dec:2020
Location:
Posts: 3
2. - :
0 : | | ... ( )
1: Call of Duty | FPS | Yes ....
2: League of Legends | MOBA | Yes ...
....
: ( , ), .
-----------------------------
, , .
.
.
- - - - - -
.
- - - - - -
-------------------
7 "" , 3.
:
, :
();
( , );
( GHz|);
RAM ( );
(Y/N);
();
.
1.
2. .
3. ( ) - ( - ).
-------------------------
.Last edited by KristinaDim; 11th December 2020 at 16:51.
-
11th December 2020 17:07 #8
, . , .
Those who abjure violence can only do so because others are committing violence on their behalf. - Orwell
-
16th December 2020 13:18 #9
, , ++, .

.1, .2, 4 , .3 .
:
string makeLine();// .2
friend istream& operator>>(istream& in, Games& data); //.1,.4
friend ostream& operator<<(ostream& out, Games& data);// .3
map, .Last edited by mitkohr; 16th December 2020 at 13:23.
Gigabyte X570 Aorus Elite, AMD Ryzen 7 5800X@PBO+200, Noctua NH-D15, 2x16GB G.Skill F4-3600C17D-32GTZR, Palit GeForce RTX 4070 Ti GameRock Classic, 2x Sandisk Extreme II 240GB (not in RAID)+WD 320GB AAKS + WD40EZRZ + Toshiba X300 6GB, Cooler Master HAF 922, CORSAIR 750W CX




Reply With Quote

Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in