1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
saw5 [17]
4 years ago
8

Create a DisplayBox application that prompts the user for a height and width and then displays a box of that size. The DisplayBo

x application should include a method named drawBox() that has two parameters and makes calls to the drawBar() method.
Computers and Technology
1 answer:
zhenek [66]4 years ago
4 0

Explanation:

vhyhvhjhuhghhhvvvji

You might be interested in
Implement the RC4 stream cipher in C++. User should be able to enter any key that is 5 bytes to 32 bytes long. Be sure to discar
gladu [14]

Answer:

Explanation:

#include <iostream>

#include <string>

#include<vector>

using namespace std;  

vector<int> permute(vector<int>, vector<int>);

string encrypt(vector<int>s1 , vector<int> t1, string p);

string decrypt(vector<int>s1, vector<int> t1, string p);

int main() {

  string plaintext = "cryptology";

  string plaintext2 = "RC4";

  vector<int> S(256);

  vector<int> T(256);

  int key[] = { 1,2,3,6 };

  int key2[] = { 5,7,8,9 };

  int tmp = 0;

  for (int i = 0; i < 256;i++) {

      S[i] = i;

      T[i] = key[( i % (sizeof(key)/sizeof(*key)) )];

  }

  S = permute(S, T);

  for (int i = 0; i < 256 ;i++) {

      cout << S[i] << " ";

      if ((i + 1) % 16 == 0)

          cout << endl;

  }

  cout << endl;

  string p = encrypt(S, T, plaintext);

  cout << "Message: " << plaintext << endl;

  cout << "Encrypted Message: " << " " << p << endl;

  cout << "Decrypted Message: " << decrypt(S, T, p) << endl << endl;

  tmp = 0;

  for (int i = 0; i < 256;i++) {

      S[i] = i;

      T[i] = key2[(i % (sizeof(key) / sizeof(*key)))];

  }

  S = permute(S, T);

  for (int i = 0; i < 256;i++) {

      cout << S[i] << " ";

      if ((i + 1) % 16 == 0)

          cout << endl;

  }  

  cout << endl;

  p = encrypt(S, T, plaintext2);

  cout << "Message: " << plaintext2 << endl;

  cout << "Encrypted Msg: " << p << endl;

  cout << "Decrypted Msg: "<<decrypt(S, T, p) << endl << endl;

  return 0;

}

string decrypt(vector<int>s1, vector<int> t1, string p) {

  int i = 0;

  int j = 0;

  int tmp = 0;

  int k = 0;

  int b;

  int c;

  int * plain = new int[p.length()];

  string plainT;

  for (int r = 0; r < p.length(); r++) {

      i = (i + 1) % 256;

      j = (j + s1[i]) % 256;

      b = s1[i];

      s1[i] = s1[j];

      s1[j] = b;

      tmp = (s1[i] + s1[j]) % 256;

      k = s1[tmp];

      c = ((int)p[r] ^ k);

      plain[r] = c;

      plainT += (char)plain[r];

  }

  return plainT;

}  

string encrypt(vector<int>s1, vector<int> t1, string p) {

  int i = 0;

  int j = 0;

  int tmp = 0;

  int k = 0;

  int b;

  int c;

  int * cipher = new int [p.length()];

  string cipherT;

  cout << "Keys Generated for plaintext: ";

  for (int r = 0; r < p.length(); r++) {

      i = (i + 1) % 256;

      j = (j + s1[i]) % 256;

      b = s1[i];

      s1[i] = s1[j];

      s1[j] = b;

      tmp = (s1[i] + s1[j]) % 256;

      k = s1[tmp];

      cout << k << " ";

      c = ((int)p[r] ^ k);

      cipher[r] = c;  

      cipherT += (char)cipher[r];

  }

  cout << endl;

  return cipherT;

}

vector<int> permute(vector<int> s1, vector<int> t1) {

  int j = 0;

  int tmp;

  for (int i = 0; i< 256; i++) {

      j = (j + s1[i] + t1[i]) % 256;

      tmp = s1[i];

      s1[i] = s1[j];

      s1[j] = tmp;

  }

  return s1;

}

6 0
3 years ago
Below you will find the requirements to identify the Account Diversity Grade of a user. Read the requirements carefully and iden
igomit [66]

The technique I used to test the requirement is equivalence partitioning.

<h3>Equivalence Partitioning-</h3>

Generic test data is considered where all the test data satisfies the conditions provided in the problem. Such that,

- ADGrade A --> TA=25 LC=5

- ADGrade B --> TA=20, LC=3

- ADGrade C --> TA=8 LC=2

- ADGrade D --> TA=2, LC=1

- ADGrade null (n/a)—> TA=0, LC=0

Where:

  • TA represents totalAccounts,
  • LC represents loanTypeCount,
  • ADGrade represents accountDiversityGrade

If we are to combine the test data collected above, we would obtain the entire set of test data.

With this in mind, the minimum number of users that are required for testing the requirement is 5.

Read more about requirement testing here:

brainly.com/question/16147055

#SPJ1

8 0
1 year ago
Write an if/else statement that adds 1 to the variable minors if the variable age is less than 18, adds 1 to the variable adults
Mama L [17]

Answer:

Explanation:

data is a statement like

data 10,20, 30 , 40 , 50, 60 , 70, 80

\\the numbers represent ages.

For x := 1 to end of data do a[x]:=read(data)

\\ This is a comment. You could do this much easier if you just use three if statements rather than the if then else.

minor:=0;adult:=0;senior:=0;

while a[x] <> 0 do begin

age:= a[x]

if age < 19 then minor:=minor + 1;

If age > 18 then if age < 65 the adult:=adult + 1;

if age > 64 then senior := senior + 1;

end;

I have not declared the variables anywhere. That depends on what language you are using. The key step you  want are the three if statements. How you find out what's in them is another matter.

6 0
3 years ago
Davingould1115...................answer 1​
erma4kov [3.2K]

wt ...

I didn't get u..

is it a I'd

8 0
3 years ago
Read 2 more answers
2. Can you see any pitfalls or disadvantages to using Feedly to organize your online content sources?
Sergio039 [100]

Answer:

I think the disadvantages of using feedly is that people might now like switching over to use that or might not understand it.

8 0
3 years ago
Other questions:
  • Who is the inventor of cpu?
    5·1 answer
  • What is the Matlab command to create a vector of the even whole numbers between 29 and 73?
    11·1 answer
  • Which of the following statements is true of satellite internet access?
    13·1 answer
  • Help
    13·1 answer
  • ) Which of these will not select all the cells in a document?
    13·1 answer
  • Consider the following code segment, where num is an integer variable.
    6·1 answer
  • What are some example of popular music for teenagers
    8·2 answers
  • 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
    6·1 answer
  • The pH scale is_____ ?
    5·1 answer
  • Carmen has met new people online that she enjoys talking to. One of these people has asked her to meet at the park in person and
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!