write a python program to replicate this for the n*n matrix
expected output:
enter the matrix and no of tasks: 3 2
intial matrix ([0 0 0] [0 0 0] [0 0 0])
task1: row and column 2 2
[[0 1 0] [1 1 1] [0 1 0]]
['0,0', '0,2', '2,0','2,2'] count 4
task2: row and column 1 1
[[1 1 1] [1 1 1] [1 1 0]]
['2,2'] count:1
Ans:['4','1']
You are a Technology Specialist in your organisation. You have been tasked to run a workshop on network system design specifically looking into the requirements and constraints. You have decided to approach the task by studying the components that make up a network system and then the relationship between network systems and related areas. Thus far, you have realised that you will base your workshop on the exhibit extracted from Serpanos and Wolf (2011). Exhibit: Requirements and constraints for network system design
Identify a suitable network scenario/case that can be used to explain and discuss the relationship of concepts in the exhibit. Ensure that you provide details of the following aspects of the scenario: • Description of the scenario; • Why the scenario is considered a network system.
(Tic-Tac-Toe) Create a class Tic-Tac-Toe that will enable you to write a program to play Tic-Tac-Toe. The class contains a private 3-by-3 two-dimensional array. Use an enumeration to represent the value in each cell of the array. The enumeration’s constants should be named X, O and EMPTY (for a position that does not contain an X or an O). The constructor should initialize the board elements to EMPTY. Allow two human players. Wherever the first player moves, place an X in the specified square, and place an O wherever the second player moves. Each move must be to an empty square. After each move, determine whether the game has been won and whether it’s a draw. Also, allow the player to specify whether he or she wants to go first or second.
Currently, XYZ Company decided to have a computer program that will automate the
computation and display the salary (net income) of their employees every payday. To
compute the salary of an employee, the company requires the following input data
such as: rate per hour, number of hours per day, number of days per week, and
number of weeks per month. In addition, the company also requires the obligatory
deduction of each employee which allocated for SSS contribution, Philhealth
contribution, Tax contribution, and Pagibig contribution. For pagibig contribution,
the deduction is fixed to P100.00 and the rest of each deduction value are coming
from the data entry or inputs of the user. In order compute the salary of the employee,
the company provide a certain formula such as:
(Pseudocoding and Flowcharting)
Q1. Determine the growth function and order of the following code fragment:
for (int count=0; count < n; count++)
{
for (int count2=0; count2 < n; count2=count2*2)
{
System.out.println(count, count2);
}
}
Q2. What is the order of the following growth functions?
a. 10n2 + 100n + 1000
b. 10n3 – 7
c. 2n + 100n3
d. n2 log n
Q3. Arrange the growth functions of Q4 in ascending order of efficiency for n=10 and again for n = 1,000,000.
Q1. Write the code necessary to find the largest element in an unsorted array of integers. What is the time complexity of this algorithm?
Q2. Determine the growth function and order of the following code fragment:
for (int count=0; count < n; count++)
{
for (int count2=0; count2 < n; count2=count2+2)
{
System.out.println(count, count2);
}
}
DEI Manufacturing company plans to give a year-end bonus to each of their employees. Draw a flowchart which will compute the bonus of an employee. Consider the following conditions: If the employee`s monthly salary is less than P2000.00, the bonus is 50% of the salary; for employees with salary greater than P2000.00, the bonus is P1500.00. Print the name and the corresponding bonus for each employee. Write the equivalent algorithm. (Pseudocoding and Flowcharting)
write a functoin that given a three digit integer n and an integer
k return the maximum possible three digit value that can be obtained
by performing at most k increase by 1 of any digit in n
Shaded Diamond
Given an integer value
The first line of input is an integer
In the given example
N = 5. Therefore, the output should be
*
* *
* * *
* * * *
* * * * *
* *
* *
* *
*
Sample Input 1
6
Sample Output 1
*
* *
* * *
* * * *
* * * * *
* * * * * *
* *
* *
* *
* *
*
Sample Input 2
5
Sample
Armstrong numbers between two intervals
Write a program to print all the Armstrong numbers in the given range
The first line has an integer
Print all Armstrong numbers separated by a space.
If there are no Armstrong numbers in the given range, print -1.
For
A = 150 and B = 200For example, if we take number 153, the sum of the cube of digits
1, 5, 3 is 13 + 53 + 33 = 153.
So, the output should be
153.
Sample Input 1
150
200
Sample Output 1
153
Sample Input 2
1
3
Sample Output 2
1 2 3