in.java
Write a program that reads an integer from the user and prints a rectangle of starts of width 5 3 and height N.
Sample run 1: Enter N: 5 *** *** *** *** *** Bye Sample run 2: Enter N: 8 *** *** *** *** *** *** *** *** Bye Sample run 3: Enter N: 2 *** *** Bye Sample run 4: Enter N: -2 Bye
In: Computer Science
Consider the following simple script incorporating a for loop:
#!/bin/bash
RED='\033[0;31m'
NC='\033[0m'
clear; cd /home
for DIR in $HOME; do
#for DIR in *;do
CHK=$(grep -c "/home/$DIR" /etc/passwd)
if [ $CHK -ge 1 ]
then
echo -e "${NC}$DIR is good"
else
echo -e "${RED}ALERT! $DIR is NOT good!"
fi
done
What kind of script is presented above? How did you make your determination? What is the purpose of the script?
In lines #5/6, what is the type of $DIR?
In line #7, what is the value of $CHK?
In line #8, what are the instructions contained with the brackets known as?
Why are there two lines containing the word "for"? Which line will execute? Will that line execute correctly?
What should you do before running the script?
How could the script be factored into your duties as a sysadmin?
In: Computer Science
Write a java program MyCalendar that outputs a monthly calendar
for a given month and year.
the output should be looks like this one at the bottom:( I don't
know why it doesn't show right but the first day of the month is
not Sunday it starts from Wednesday)
F. Last’s My Calendar
Enter month year? 10 2019
10/2019
Sun Mon Tue Wed Thu Fri Sat
---------------------------------
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
In: Computer Science
PYTHON
Search for an element in a 2D sorted matrix using the binary
search technique. Your code should run in O(m + n) where m is the
number of rows and n is the number of columns
The python file should have a function named binarysearch
The function should take two arguments. The first argument of
the function will be the element to search for. Second argument of
the function will be the matrix as a List[List].
The function should return the row and column of the matrix if the
element is found. Use a tuple to return the row and column. Return
"Not Found" if the element is not found.
Sample values for input and output :
Sample Input:
Case 1: binarysearch(4, [[1, 2, 3],[4, 5, 6],[7, 8, 9]] )
Case 2: binarysearch(10,[[2, 3, 4],[5, 7, 9],[11, 12, 13],[20, 22,
24]]
Sample Output :
Case 1: (1 , 0)
Case 2: Not Found
In: Computer Science
Docker containers can be considered a new era of virtualization that has fundamentally changed the IT industry. For this discussion question, provide a brief response that describes a Docker container and how a container differs from a hypervisor. What potential do you see in Docker containers?
In: Computer Science
The decimal number 210 expressed in binary is ____.
11010011
11011011
11010010
11010111
____ is the most important layer 3 security protocol.
ARP
NAT
DNS
IPSec
In: Computer Science
In pumping lemma I know how to prove 0^n 1^n is not regular but what changes when I have 0^n 1^n 2^n (three variables). Do I need to check 6 variations
of 0,1 and 2 instead of only 3 in 0^n 1^n?
thanks.
In: Computer Science
Developing a set of classes demonstrating inheritance - in class work
In: Computer Science
Write and run SQL statements to complete the following tasks
You are required to answer
1. The SQL statements for each query, which should be copied and pasted into word.
2. tell all the sql command for each question?
tables: -
VENDOR TABLE
|
V_CODE |
V_NAME |
V_CONTACT |
V_ARAECODE |
V_PHONE |
V_STATE |
V_ORDER |
PRODUCT TABLE
|
P_CODE |
P_DESCRIPT |
P_INDATE |
P_QOH |
P_MIN |
P_MIN |
P_DISCOUNT |
V_CODE |
CUSTOMER TABLE:
|
CUS_CODE |
CUS_LNAME |
CUS_FNAME |
CUS_INITIAL |
CUS_AREACODE |
CUS_PHONE |
CUS_BALANCE |
INVOICE TABLE:
|
INV_NUM |
CUS_CODE |
INV_DATE |
INV_SUBTOTAL |
INV_TAX |
INV_TOTAL |
LINE TABLE:
|
INV_NUMBER |
LINE_NUMBER |
P_CODE |
LINE_UNITS |
LINE_PRICE |
LINE_TOTAL |
EMPLOYEE TABLE:
|
EMP_NUM |
EMP_TITLE |
EMP_LNAME |
EMP_FNAME |
EMP_INITIAL |
EMP_DOB |
EMP_HIRE_DATE |
EMP_AREACODE |
EMP_PHONE |
EMP_MGR |
In: Computer Science
Discuss in details the applications and challenges of Mobile Database in Public and Private Sector
In: Computer Science
P-3.40 Implement a class, SubstitutionCipher, with a constructor that takes a string with the 26 uppercase letters in an arbitrary order and uses that as the encoder for a cipher (that is, A is mapped to the first character of the parameter, B is mapped to the second, and so on.) You should derive the decoding map from the forward version.
P-3.41 Redesign the CaesarCipher class as a subclass of the SubstitutionCipher from the previous problem.
P-3.42 Design a RandomCipher class as a subclass of the SubstitutionCipher from Exercise P-3.40, so that each instance of the class relies on a random permutation of letters for its mapping.
In: Computer Science
Explain what OS hardening is and why it is important? In addition, explain what could happen if OS Hardening is not done properly.
In: Computer Science
What is meant by best evidence? What are some examples? What is hearsay? When arriving at a crime scene, is it better to shut down the computer immediately or insure it stays on? What are the tradeoffs?
In: Computer Science
●In this task, the quick sort algorithm selects the first element in the list as the pivot. Revise it by selecting the median among the first, middle, and last elements in the list.
● Write the algorithm for searching for entries using linear probing.
● Write the algorithm for removing entries using linear probing.
● Create a diagram similar to the one above that shows the hash table of size 11 after entries with the keys 34, 29, 53, 44, 120, 39, 45, and 40 are inserted, using separate chaining.
I am very confused, this task involves algorithms , hashing and sorting.
THANK YOU IN ADVANCE
In: Computer Science
R-Studio (R Programming Language)
4. Let the data x be given by
`x <- c(1, 8, 2, 6, 3, 8, 5, 5, 5, 5)`
Use R to compute the following functions. Note, we use X1 to denote
the first element of x (which is 1) etc.
1. `(X1 + X2 + . . .+ X10)/10` (use sum)
2. Find log10(Xi) for each i. (Use the log function which by
default is base e)
3. Find `(Xi - 4.4)/2.875` for each i. (Do it all at once)
4. Find the difference between the largest and smallest values of
x. (This is the range. You can use `max` and
`min` or guess a built in command.)
```{r}
#insert your code
```
In: Computer Science