Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

please include the report i haven't recieved them for the last 2 assignments. You MUST upload 2 files for your assignment: A PDF (preferred)/DOCX of your report including test tables,...

1 answer below »
Microsoft Word - Homework 4.docx
1
Homework 4

1. (10 pts) For the following program, explain the interesting elements related to threads. Focus on
explaining the output of the program.

1 public class TaskThreadDemo {
2 public static void main (String args []) {
3 String [] sa = {"a", "X", "+", "."};
4 for (String s: sa) {
5 Runnable ps = new PrintChar (s, 200);
6 Thread ts = new Thread (ps, s);
7 ts.start ();
8 }
end for each character
9 }
end main
10 }
end class TaskThreadDemo
11
12 class PrintChar implements Runnable {
13 String ch;
14 int times;
15
16 public PrintChar (String c, int n) {
17 ch = c;
18 times = n;
19 }
end constructor
20
21 public void run () {
22 for (int i = 0; i < times; i++) {
23 System.out.print (ch);
24 }
end for loop
25 }
end method run
26 }
end class PrintChar

2. (10 pts) What is changed if the method called on line 7, start(), is replaced with run()? Explain (of
course). Focus on explaining the output of the program.

3. (10 pts) What is changed if the method Thread.yield() is added between lines 23 and 24? Explain.
Focus on explaining the output of the program.

4. (10 pts) Modify the above program so that the Thread.sleep method is called after each character has
een printed causing it to sleep for 500 milliseconds. Describe how that modification has altered the
output and explain why the change had the effect that you described.

5. (10 pts) Modify the above program so that the Thread.sleep method is called after each thread is
created in the main method causing it to sleep for 500 milliseconds. Describe how that modification has
altered the output and explain why the change had the effect that you described.
2
Grading Ru
ic:

Attribute Meets Does not meet
Problem 1 10 points
Explains the interesting elements
elated to threads. Focuses on
explaining the output of the program.
0 points
Does not explain the interesting elements
elated to threads. Does not focus on
explaining the output of the program.
Problem 2 10 points
Explains what is changed if the
method called on line 7, start(), is
eplaced with run().Focuses on
explaining the output of the program.
0 points
Does not explain what is changed if the
method called on line 7, start(), is replaced
with run(). Does not focus on explaining
the output of the program.
Problem 3 10 points
Explains what is changed if the
method Thread.yield() is added
etween lines 23 and 24. Focuses on
explaining the output of the program.
0 points
Does not explain what is changed if the
method Thread.yield() is added between
lines 23 and 24. Does not focus on
explaining the output of the program.
Problem 4 10 points
Explains how the output is changed if
the Thread.sleep method is called
after each character has been
printed.
0 points
Does not explain how the output is
changed if the Thread.sleep method is
called after each character has been
printed.
Problem 5 10 points
Explains how the output is changed if
the Thread.sleep method is called
after each thread is created in the
main method.
0 points
Does not explain how the output is
changed if the Thread.sleep method is
called after each thread is created in the
main method.
Answered 2 days After Dec 03, 2024

Solution

Bhaumik answered on Dec 06 2024
3 Votes
Lab [X] report
Executive Summary
1. Code Implementation
a. Password Update Form
The form is a new Flask app route allowing logged-in users to update their passwords. It checks the password against NIST SP 800-63B criteria, including against a list of commonly used passwords.
. Authentication Functions
Functions Handle:
1. Password Complexity Validation.
2. Comparison against a CommonPasswords.txt list.
c. Logging
A log file captures failed login attempts, including date, time, and IP Address.
2. Application Results and Testing Decrypting Secret Messages
Message 1:
Encrypted Message: -
- .... .. ... / ... -.. . ...- / ...-- ----- ----- / -.-. .-.. .- ... ... / .... .- ... / ... --- -- . / ... - .-. .- -. --. . / .-. . --.- ..- . ... - ... .-.-.-
Decryption process:
a) This message is written in Morse code.
) A Morse code decoder like Rumkin Morse Code Decoder was used.
c) Input the message and decode it.
Decoded Message: -
This Dev 300 Class has some strange requests.
Cipher used: Morse Code
Message 2:
Encrypted Message: -
U28gdGhpcyBpcyBiYXNlNjQuIE5vdyBJIGtub3cu
Decryption process:
a) This message is encoded in Base64.
) A Base64 decoder like Rumkin Base64 Decoder was used.
c) Input the message and decode it.
Decoded Message: -
So this is base64. Now I know.
Cipher used: Base64
Message 3:
Encrypted Message: -
--- Psuwb Ysm ----
W oa gc qzsjsf. Bc cbs qcizr dcggwpzm twuifs hvwg...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Looking For Homework Help? Get Help From Best Experts!

Copy and Paste Your Assignment Here