This C++ program converts text from a standard file into the NATO phonetic alphabet. It contains functions to determine the size of the source and converted files, create a new conversion file, and output the file names and sizes. The main function calls the other functions, determines the source file size, creates the conversion file, and outputs both file sizes and names.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online from Scribd
This C++ program converts text from a standard file into the NATO phonetic alphabet. It contains functions to determine the size of the source and converted files, create a new conversion file, and output the file names and sizes. The main function calls the other functions, determines the source file size, creates the conversion file, and outputs both file sizes and names.
This C++ program converts text from a standard file into the NATO phonetic alphabet. It contains functions to determine the size of the source and converted files, create a new conversion file, and output the file names and sizes. The main function calls the other functions, determines the source file size, creates the conversion file, and outputs both file sizes and names.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online from Scribd
This C++ program converts text from a standard file into the NATO phonetic alphabet. It contains functions to determine the size of the source and converted files, create a new conversion file, and output the file names and sizes. The main function calls the other functions, determines the source file size, creates the conversion file, and outputs both file sizes and names.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online from Scribd
Download as txt, pdf, or txt
You are on page 1of 2
//Program to turn standard txt into the NATO phonetic alphabet and back again
#include <iostream> //using the standard input and output stream
#include <fstream> // ising the file manipulation stream #include <string> // using the string stream #include <sstream> // so we can manipulate strings like streams using namespace std; //using the standard namespace int a; long sourceFileSize; long convertionFileSize; string convertionFile; string sourceFile; int findSourceFileSize () //function to determind the filesize of the original f ile { char filename[16]; //this will allow the file name be 16 in length cout << "Enter the name of an existing file: "; cin.getline (filename,16); cout << "\nThe name of your file is: " << filename << endl; long begin, end; //initializing the variabls that will hold the value fo r our beging and end value of bytes ifstream myfile; myfile.open(filename); //bind the file to our input file stream begin = myfile.tellg(); //find the value for the beginning. myfile.seekg(0, ios::end); //navigate to the end of the file end = myfile.tellg(); //find the value for the end myfile.close(); //stop dealing with this file sourceFileSize = end-begin; return (sourceFileSize); //finish the function } int findConvertionFileSize () //funtion to determind filesize of the converted f ile. { long begin, end; ifstream myfile; myfile.open ("Convertion.txt"); begin = myfile.tellg(); //find the value for the beginning. myfile.seekg(0, ios::end); //navigate to the end of the file end = myfile.tellg(); //find the value for the end myfile.close(); //stop dealing with this file convertionFileSize = end-begin; return (convertionFileSize); //finish the function } int createConvertionFile () { ofstream myfile; myfile.open ("Convertion.txt"); myfile << "============================================================= =\n"; myfile << "======Thankyou=For=Using=NAME's=Text=->=NATO=Converter======\ n"; myfile << "============================================================= =\n" << endl << endl << endl << endl << "--->" << endl; myfile.close(); convertionFile = "Convertion.txt"; return 0; } int main() //start the program { cout << "WELCOME TO NAME'S STANDARD TEXT TO NATO PHONETIC ALPHABET CONVE RTER" << endl; findSourceFileSize (); cout << "Source File Size Is: " << sourceFileSize << " Bytes." << endl; cout << sourceFile << endl; createConvertionFile (); //Analyze Source File //Convert File findConvertionFileSize (); cout << "Your Convertion File Is Named: " << convertionFile << endl; cout << "Converted File Size Is: " << convertionFileSize << " Bytes." << endl; cin >> a; return 0; }
Ethereum Concise: Ethereum for Beginners: The Basics on History, Present and Future, on Ethereum and Ethereum Classic, Ether, Ethereum Tokens, DApps, Smart Contracts, and Ethereum Wallets