- Write a program that will generate four(4) types of printable random objects and store them in a single file, each object will be separated by a ",". These are the 4 objects: alphabetical strings, real numbers, integers, alphanumerics. The alphanumerics should contain a random number of spaces before and after it (not exceeding 10 spaces). The output should be 10MB in size.
Sample extracted output :
hisadfnnasd, 126263, assfdgsga12348fas, 13123.123, lizierdjfklaasf, 123192u3kjwekhf, 89181811238,122, nmarcysfa900jkifh , 3.781, 2.11, ....
- Create a program that will read the generated file above and print to the console the object and its type. Spaces before and after the alphanumeric object must be stripped.
Sample output :
youruasdifafasd - alphabetical strings 127371237 - integer asdfka12348fas - alphanumeric 13123.123 - real numbers asjdfklasdjfklaasf - alphabetical strings 123192u3kjwekhf - alphanumeric
- Run
npm install
- Run
npm start
and wait for awhile for it to generate the output inoutput/output.txt
- Set the
OUTPUT_SIZE (in line 6: writer/program.js)
to10485760 (10MB), 1048576 (1MB), or 1024 (1KB)
if desired. - Run
npm run reader
and it will evaluate every results from before intooutput/result.txt