Strengths and weakness of case study, ethnography, ground theory, narrative inquiry and phenomenology
Which is the most suitable graph representation scheme for a dense graph
Activity:
Create a program that accepts birth year and current year. Define a function that has 2 parameters: birthyear
and presentyear then it will calculate and returns the age. Define another function that will determine if the
age is minor or legal age.
FINISHED CODE:
def getAge():
def validateAge():
byear = int(input("Enter Birth Year:"))
pyear = int(input("Enter Present Year:"))
age = getAge()
validatedAge = validateAge()
print(f "Your age is {age} and it is {validatedAge}")
sample output:
Enter Birth Year: 1992
Enter Present Year:2021
Your age is 29 and it is legal
Dear Sir/Mam,
I want to display only current hours, Minutes and Seconds through cpp Computer graphics program. ctime function produces the current time with date day etc. Is there any CPP function, which gives me results only the current time in form HH:MM:SS?
How tick tick sound can be generated through CPP program?
Rotate Matrix Rings
Given a matrix of order M*N and a value K, write a program to rotate each ring of the matrix clockwise by K elements. If in any ring has less than or equal to K elements, then don’t rotate that ring
M, N = input().split()
M, N = int(M), int(N)
matrix = []
for _ in range(M):
row = [int(x) for x in input().split()]
matrix.append(row)
K = int(input())
values = matrix[0][:-1] + [x[-1] for x in matrix][:-1] + matrix[-1][::-1][:-1] + [x[0] for x in matrix][::-1][:-1]
values = values[-K:] + values[:-K]
output = matrix
idxs = [(0, j) for j in range(N)][:-1] + [(i, N - 1) for i in range(M)][:-1] + [(M - 1, j) for j in range(N)][::-1][:-1] + [(i, 0) for i in range(M)][::-1][:-1]
idx = 0
for i, j in idxs:
output[i][j] = values[idx]
idx += 1
for i in output:
pass
print(i)Input:
4 4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
3
Output:
[13, 9, 5, 1]
[14, 6, 7, 2]
[15, 10, 11, 3]
[16, 12, 8, 4]
Here the inner ring is not rotating the given times sir
The Saffir-Sampson Hurrican Scale classifies hurricanes into 5 categories numbered 1 to 5. Write a program that asks the user to input the wind speed. Pass the wind speed to a method that determines and returns the hurricane category. Your Main() method must display the relevant category. The different categories is classified as follows: Category Sustained wind speed in km/h 5 252 or higher 4 209 - 251 3 178 - 208 2 154 - 177 1 119 - 153 Any storm with wind speed of less than 119 km/h is not a hurricane.
Create a program for a library whose Main() method asks the user to input the number of books checked out and the number of days they are overdue. Pass those values to a method that calculates and displays the library fine, which is 20 cents per book per day for the first seven days a book is overdue, then 50 cents per book per day for each additional day.
Write a program that reads in 5 marks. Your program must use the getMark method to ensure that valid marks are processed. You need to calculate the sum and the average of the marks. Your program must also use the isPass method to determine the number of pass marks entered. When the 5 marks have been processed you need to display the sum, average and number of passes (from these marks).
Write a user defined method named isPass that can be used to determine whether a mark is a pass mark (greater or equal to 50). The method must take as input a mark, and return a boolean, indicating whether the mark was a pass mark.