Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Please!!! code.txt memory.txt Now for Part 2 we are going to modify project1.txt and upload a second additional file called processor2.txt What used to

C++ Please!!!

image text in transcribed

code.txt

image text in transcribed

memory.txt

image 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 'l' and every 'l' to an 'o' If the char is 'P' it stores accumA Plus accumB in accumA. b P b S OIOIO000 10000000 O1000000 O1000000 IOI00000

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

More Books

Students also viewed these Databases questions

Question

6. Discuss the steps involved in conducting a task analysis.

Answered: 1 week ago

Question

8. Explain competency models and the process used to develop them.

Answered: 1 week ago