Explain the impact of diffusion process on the speed of Rijndael algorithm?
In: Computer Science
In: Computer Science
Here is assignment 11 and it must be completed and submitted by Sunday july 26 at 11:59pm Pacific Time. Start early and follow the instructions. Please note, no late assignment will be accepted. The assignment’s grade will be available in your Gradebook by the following Tuesday.
This assignment is mainly to practice Selection programming structure with creating a project in VB. That is IF ... THEN ... ELSE ... END IF and IF ... THEN ... ELSEIF ... ELSEIF .... END IF
9. Double-click on Compute Button; declare variables you need to store entered intNumber and calculated intNumber. Both variables data type is Integer . Then type the Selection structure code from Assignment 7 #3. Run the program and test it for intNumber values of 50, 500 and 1000. For each test the result should be: 100, 500, and 3000 respectively.
Screenshots for creating a new project in VB:
2. In the next screen, Create a new project, you choose the correct project template. Since you created a VB project in Week 4, then the correct template: "VB Windows Forms App (.NET Framework)" will display in Recent Project Templates list, you will see a similar screenshot below, Just make sure you open VB Windows Forms App (.NET Framework) and not the one for C++. Click on Next button to continue:
3. Type project name: yourlastname-firstname-SelectionVBProgram in Project and select the VB folder that you will save VB project files in Location box. NOTE: your VB project will be saved in a folder with the project name you type in Project Name box. This will create a folder and a file with SLN extension. Both have the same project name. see below screenshot for where you enter Project name and Location:
4. To change the Location, click on three dots (...), locate the CS3 folder you created earlier for this class. in Project Location window, you should see VB folder that you created earlier in this assignment. Click once to select VB folder(do not double-click) and then click on Select Folder button. This will take you back to "Configure your new project" window. See below screenshot for selecting VB folder. Note that if you have selected VB folder to save the first VB Project, then it will automatically becomes the default folder. You will see the above screenshot. Click on Create to continue to VB Editor window.
5. Upon clicking on Create, you will be placed in VB editor window, see below:
6. From here on, click on View menu to activate Toolbox menu, expand Common Controls, Then add two Label controls, one TextBox and one Button controls on the form. Follow the instructions to name each control and add necessary text properties for each control. See below:
7. Then double-click on the Button which now should read “computer” to see the VB coding area, Form1.vb. type the code for the criteria in #9 such that when the program runs, you enter 50 for intNumber (textbox) and in the Label2 you see 100 displays, when you enter 500, result is 500 and when you enter 1000, the result is 3000. You have code in assignment 7.
Assignment 7 #3 Use the following selection structure to answer the next three questions:
If intNumber<= 100 Then
intNumber = intNumber * 2
ElseIf
intNumber> 500 Then
intNumber = intNumber * 3
End If
In: Computer Science
Turn Ins:
Source code of two programs and a short report on to answer the following question:
input.txt looks like below
55 59 56 23 93 9 39 76 27 81 46 99 35 11 93 43 10 22 29 89 8 10 11 86 48 34 39 3 54 4 76 2 35 52 58 92 75 15 48 51 29 81 96 25 46 90 67 40 55 67 44 76 3 48 31 61 48 9 64 68 78 4 17 26 63 64 92 11 58 54 71 51 11 16 27 76 91 8 77 35 12 84 87 93 71 14 5 36 16 35 30 47 85 81 78 34
In: Computer Science
Using C language, and describe the algorithm
design
All the sample is correct
Tim was born in a leap year, so he would like to know when he could have his birthday party. Could you tell him? Given a positive integers Y indicating the starting year, and a positive integer N, your task is to tell the N-th leap year from year Y. Note: if year Y is a leap year, then the 1st leap year is year Y.
The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow. Each test case contains two positive integers Y and N(1<=N<=10000). For each test case, you should output the Nth leap year from year Y.
3
2005 25
1855 12
2004 10000
2108
1904
43236
In: Computer Science
3. What does mystery2 compute on an input n? Please explain how you found this. thanks!
public static int problem1(int n) {
int begin = 0;
int end = n+1;
while (begin+1 < end){
int mid = (begin+end)/2;
if(112*mid <= n){
begin = mid;
}
else{
end = mid;
}
}
return begin;
}
In: Computer Science
What does the following PHP code accomplish?
1. function validateInput ( $data ) {
2. $data = trim ( $data );
3. $data = stripslashes ( $data );
4. $data = htmlspecialchars ($data , ENT_QUOTES | ENT_HTML5 ,'UTF -8 ');
5. return $data ;
6. }
In: Computer Science
GAMEMODE(gamemode_id, gamemode_name,
gamemode_type)
GAME(game_id, game_time, game_results, game_date,
gamemode_id)
ACTIVEPLAYER(player_online_status, game_id,
hero_level)
PLAYERHERO(hero_level, hero_id, player_id)
HERO(hero_id, hero_role, hero_price, hero_name,
hero_speciality)
SKIN(skin_id, skin_price, skin_name, hero_id)
PLAYER(player_email, player_username,
player_id)
PLAYER
ACCOUNT(player_id,player_username,player_onlinestatus,player_battle_point,player_global_level,player_diamonds)
Normalise this to 3NF
In: Computer Science
In mathematics, the notation n! represents the factorial of the nonnegative integer n. The factorial of n is the product of non-negative numbers from 1 to n.
Design a program that asks the user to enter a nonnegative integer and then displays the factorial of that number.
Module main. Asks the user to enter a non-negative integer. A loop is used to require user input until a nonnegative number is entered. Once a nonnegative number is entered, the integer is passed to Module factorial.
Module factorial. Accepts a non-negative integer from Module main and uses a loop to calculate the factorial of that number. The number resulting from each step of the calculation will be written to an output file products.dat. The following numbers would be written to the output file for 7!
42
210
840
2520
5040
Module readFactorial. Changes the status of products.dat to an input file. Reads and displays all numbers in the file. The final number should be labeled as the solution to the problem.
Expected Input/Output
Your results should be similar to the following:
Please enter a non-negative integer: -5
The number must be non-negative.
Please enter a non-negative integer: 0
The number must be non-negative.
Please enter a non-negative integer. 7
Following are intermediary calculations for 7 factorial:
42
210
840
2520
5040
7 factorial is 5040.
Please use java to generate the program. And must have these modules and use these guidelines!!!
In: Computer Science
Please answer ASAP
Database
Consider the following relation scheme:
Players = {name, position, year, team, manager}
We use the following abbreviations:
Players = {n, p, y, t, m}
with the following FDs
n --> p
n, y --> t
t, y --> m
(3.a) Is Players in BCNF? Explain why.
(3.b) Find all candidate keys of Players. Show your work.
(3.c) Obtain a decomposition of players using the 3NF decomposition
algorithm. Assume the
given FDs are a minimal (canonical) cover. Show your work.
(3.d) Assume the following FD also holds in players (in addition to
the FDs listed above).
t, m ! y
Find all candidate keys of Players for this case. Show your
work.
In: Computer Science
Using C language, and describe the algorithm design
n (n is odd) people sitting around a round table playing a game. In this situation, everyone has a left neighbour and a right neighbour. At the beginning, each of them is holding a whiteboard with an integer number. Now, they are playing a game consisting of several rounds. In each round, everyone will first look at the numbers of his/her left neighbour and right neighbour, then calculate the average of the two numbers, replace the number on his/her whiteboard with the average finally. The game terminates when any one has to write a non-integer number on his/her whiteboard.
Given the number of people, the number of passed rounds and the integer numbers on their whiteboards at this moment, you are asked the integer numbers on their whiteboards at the very beginning. The number of rounds increases by 1 when changing the number on the whiteboard and new numbers are all integers.
Input the number of people n and the number of rounds t on the first line. On the next line are numbers on their whiteboards after t rounds.
Output the integer numbers on their whiteboards at the very beginning.
3 2
3 1 2
6 -2 2
In: Computer Science
Write a program to ask three options to the user and continue until user selects option 3.
The first two options prompt a user to enter a string of numbers separated by spaces which is a 2by2 matrix. Do addition and subtraction on the input matrices when user selects 1 and 2.
You must write functions for matrix addition, subtraction and print. You may use the following function str_to_mlist to convert string to a list.
code example is given:
def str_to_mlist(m_str):
"""Converts a string separated by spaces to a list
Parameters
----------
m_str : str, required
Input string separated by spaces
Returns
-------
list
Numbers
"""
return m_str.split()
A sample run of the code looks like this:
Enter an option
1.Add two matrices
2.Subtract two matrices
3.Quit
1
Enter four numbers separated by spaces and press enter:3 4 -10
3
3 4
-10 3
Enter four numbers separated by spaces and press enter:8 9 0
-2
8 9
0 -2
Your result is:
11 13
-10 1
Enter an option
1.Add two matrices
2.Subtract two matrices
3.Quit
2
Enter four numbers separated by spaces and press enter:1 0 0
1
1 0
0 1
Enter four numbers separated by spaces and press enter:0 -1 -1
0
0 -1
-1 0
Your result is:
1 1
1 1
Enter an option
1.Add two matrices
2.Subtract two matrices
3.Quit
3
In: Computer Science
Determine the running time of each of the algorithms below. For questions 2a. and 2b., you may determine the running time line-by-line (see Lecture 2, slide No. 8). For questions 2c – 2f, you may determine the running time by focusing on the basic operation of the algorithm.
a,sum = 0; for (i=1; i<=n; i++) sum += n;
b. Algorithm maxVal (numbers, n) currentVal ← numbers [0] for i ← 1 to n − 1 do if numbers [i] > currentVal then currentVal ←A[i] { increment counter i } return currentVal
c. Algorithm prefix1(X, n) //Input array X of n integers //Output array A of prefix averages of X A ← new array of n integers for i ← 0 to n − 1 do s ←X[0] for j ← 1 to i do s ←s + X[j] A[i] ←s / (i + 1) return A
d. Algorithm prefix2(X, n) //Input array X of n integers //Output array A of prefix averages of X A ← new array of n integers s ← 0 for i ← 0 to n − 1 do s ←s + X[i] A[i] ←s / (i + 1) return A
e. Algorithm SumTripleArray(X, n) //Input triple array X[][][] of n by n by n integers //Output sum of elements of X s ← 0 for i ← 0 to n − 1 do for j ← 0 to n − 1 do for k ← 0 to n − 1 do s ←s + X[i][j][k] return s
f. sum = 0; for( i = 0; i < n; i++) for( j = 0; j < n * n; j++) sum++;
In: Computer Science
Revisit Shneiderman’s 8 Golden Rules and answer the following questions.
PreviousNext
In: Computer Science