Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ please Now for Part 2 we are going to modify project1.txt and upload a second additional file called processor2.txt What used to be in

C++ please

image text in transcribedimage text in transcribedimage text in transcribed

Now for Part 2 we are going to modify project1.txt and upload a second additional file called processor2.txt What used to be in data.txt, will now come from two files. The first group of chars, the 'Z's and 'V's will come from a file called memory.txt, and instead of 'Z' and 'V' we will use the letters 'O' and 'T' respectively. The letters 'R', 'L', 'A', 'S' and additional letters 'C', 'P', 'a', 'b' will come from a second file called code.txt. Instead of one array called accum[8] we will be using 2 arrays called accumA, and accumB, both of size 8 and both initialized to '?'s The program will start by reading from code.txt, act on each character read, output the content of the two arrays on two lines and keep on reading and processing until it reads an 'S' and Stops. If the char from code.txt is 'R', as before, it shifts the arrayA elements to the Right (accumA[i+1]=accumA[i]) and stores a letter 'O' in accumA[O] If the char is 'L', as before, it shifts the arrayA elements to the Left and stores an 'O' in accumA[7] If the char is 'A' as before, it acts like an 'R'except instead of an 'O' leaves accumA[O] as it was ('O' or T'). This called an Arithmetic shift right. If the char is 'a' it reads 8 chars from memeory.txt and stores it in accumA If the char is 'b' it reads 8 chars from memeory.txt and stores it in accumB If the char is 'C' it Complements accumA by converting every 'O' to an 'I' and every 'l' to an 'O' If the char is 'Pit stores accumA Plus accumB in accumA. ro SA O HAUADA code.txt memory.txt 0000 000000IO 00000010 00000001 0000IOIO Now for Part 2 we are going to modify project1.txt and upload a second additional file called processor2.txt What used to be in data.txt, will now come from two files. The first group of chars, the 'Z's and 'V's will come from a file called memory.txt, and instead of 'Z' and 'V' we will use the letters 'O' and 'T' respectively. The letters 'R', 'L', 'A', 'S' and additional letters 'C', 'P', 'a', 'b' will come from a second file called code.txt. Instead of one array called accum[8] we will be using 2 arrays called accumA, and accumB, both of size 8 and both initialized to '?'s The program will start by reading from code.txt, act on each character read, output the content of the two arrays on two lines and keep on reading and processing until it reads an 'S' and Stops. If the char from code.txt is 'R', as before, it shifts the arrayA elements to the Right (accumA[i+1]=accumA[i]) and stores a letter 'O' in accumA[O] If the char is 'L', as before, it shifts the arrayA elements to the Left and stores an 'O' in accumA[7] If the char is 'A' as before, it acts like an 'R'except instead of an 'O' leaves accumA[O] as it was ('O' or T'). This called an Arithmetic shift right. If the char is 'a' it reads 8 chars from memeory.txt and stores it in accumA If the char is 'b' it reads 8 chars from memeory.txt and stores it in accumB If the char is 'C' it Complements accumA by converting every 'O' to an 'I' and every 'l' to an 'O' If the char is 'Pit stores accumA Plus accumB in accumA. ro SA O HAUADA code.txt memory.txt 0000 000000IO 00000010 00000001 0000IOIO

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Carlos Coronel, Steven Morris

14th Edition

978-0357673034

More Books

Students also viewed these Databases questions