This is a C++ problem: Thank you so much!!! Suppose that our T/A is creating a v
ID: 3604203 • Letter: T
Question
This is a C++ problem:
Thank you so much!!!
Suppose that our T/A is creating a video game. In this game there are many "targets" that need to be displayed on the screen, and modern graphics engines need to know the distance from the viewer to quickly process the scene. So, for this project you will implement a class to help the T/A keep track of an ordered list of the targets in increasing distance from the viewer. Every item in the zDepthList will be given a unique integer "name" that is in the range 0..n. This name can be used as the index of an array to provide fast access. The class will be called zDepthList. The public methods of your class should be the following: zDepthList() zDepthList(int[], int) Constructor where the first parameter is an array and the second Default constructor. Should create an empty list. parameter is the length of the array. Should create a zDepthList containing all the items in the array. The items in the array are given in increasing distance to the source. The entry in the array is the index of that item in the zDepthList. Output method. Traverses the zDepthList in order of depth. The parameter indicates the direction. The default is 'f' indicating close to far, or forward. If the parameter is 'r', then the traversal should be far to near, or reverse. void out(char) void move(int, int, char) This method reorders thezDepthList. The first parameter is the index of the item to be moved. The second parameter is the number of steps, and the last parameter is the direction, where is the default and means to move the item "deeper" in the list and ‘r' means to move the item closer in the list. void movefront(int) Moves the item at the given index to the front of the zDepthList void moveback(int) Moves the item at the given index to the back of the zDepthList int at(int) returns the index of the item at position I in the zDepthList starting at O for the front of the list.Explanation / Answer
#include "des56.h"
#include
#include
#include
//Use these constants to specify ENCRYPT or DECRYPT in the fencrypt function call. (The middle parameter)
#define ENCRYPT 0
#define DECRYPT 1
/*This function takes the XOR of block A and block B and stores the result in block "result"*/
/*Note that it is possible that "result" is the same as "A" (or "B").*/
/*For example:
XORblock(block1,IV,block1);
Would XOR the first block with the IV and put the result in block1*/
void XORblock(char A[8],char B[8],char result[8])
{
int i = 0;
for(;i<8;i++)
result[i] = A[i]^B[i];
}
/*This function takes a block as input and prints the corresponding hex to the terminal*/
void printhex(unsigned char block[8])
{
int i=0;
for(;i<8;i++)
printf(" 0x%x ",block[i]);
puts("");
}
void cbc_enc_three_blocks(char block1[8],char block2[8], char block3[8], char IV[8],keysched *ks)
{
// You write this code
}
void cbc_dec_three_blocks(char block1[8],char block2[8], char block3[8], char IV[8],keysched *ks)
{
// You write this code
}
int main()
{
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.