Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

varaouie uu eure 32-bit integer (including the resultofinteger division) and a c

ID: 3804734 • Letter: V

Question

varaouie uu eure 32-bit integer (including the resultofinteger division) and a char variable to host the decoded character (result of modulo). An ASCII art picture usually contains the newline character Vn'. The input data for this assignment uses the value 0x0A (decimal 10) to represent the newline character. This is a UNIX/Mac convention. On Windows computers, this does not work. To make DataDecoder 0x0A to the output to mean the newline character. We need to add a test: if the value of the decoded character is equal to 0x0A, then we output In' (or endl) Otherwise, we output just the decoded character. Tasks Follow the design and development steps: 1. Perform a problem analysis and identify the functional and non-functional requirements to build DataDecoder. (on paper) 2. Create and study a test scenario using the sample data (rectangular box). In the test scenario, you should experiment and study how a 32-bit integer can be split into four ASCII characters. Please remember that ASCII is a coding standard for characters. It states, for example, that the value 64 maps to character A'. (on paper) 3. Outline, identify, and design the main building blocks of the application. You should develop the algorithm in pseudo-code, ifpossible. (on paper) 4. Implement the solution and test it with the file Input Data-txt. (printed program code and result from test run) DataDecoder is a Win32 console application that reads an input text file and produces another text file as output. The names of these files are given as command line arguments. The solution requires simple control structures and using integers as characters. Your application also needs to produce a production maker This information must be written to the output file (and be part of the program). For example, DataDecoder has to convert the input 757935403 544999979 175906848 538 976 380 757795452 170601773 into the ASCII art picture Prepared by StudentName (StudentID) where StudentName is you name and StudentID is your student id The implementation requires less than 100 lines of code. The file InputData.txt encodes an ASCII art picture of a well-known movie character. Submission deadline: Wednesday, March 29, 2017, 10:30. Submission procedure: on paper (printed solution and cover sheet).

Explanation / Answer

              int main(int argc,char **argv)
           {
   FileInput theInput;
   if(theInput.Open(argv[1])<0) {
       cerr << "Could not open file " << argv[1] << endl;
       exit(1);
       }

   X8MovieWindow *myMovieWindow = new X8MovieWindow;
   Ditherer *myDitherer = new Ordered2Dither(myMovieWindow);

   BitStream *bs = new BitStream(&theInput);
   MPEGDecoder *theDecoder =
       new MPEGDecoder(bs, myMovieWindow, myDitherer);
   try {
       theDecoder->PrepareToShowMovie();
       theDecoder->ShowMovie();
   }
   catch (MPEG_Exception e) {
       e.ErrPrint();
       }
                 delete bs;
   delete theDecoder;
   delete myDitherer;
   delete myMovieWindow;
      }