Write a program in C++ that creates a .txt file in the directory passed through at the…
Private research annotation
Sign in to add a private research label or note.
- User
Write a program in C++ that creates a .txt file in the directory passed through at the command line then fill the .txt file with 150 different game scores in the following format: opponentName,homeScore-opponentScore. opponentName should be a randomly generated name that is less then 40 characters, homeScore and opponentScore should be a randomly generated integer that is less than or equal to 150.
- Assistant
Here is a simple C++ program that fulfills your requirements. This program uses the
<random>,<string>,<fstream>, and<iostream>libraries.cpp
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.