1. Data Structures and Algorithms (Project 1)
INSTRUCTIONS:
Create a program using the following features:
* Array
* Class
* Specific Sorting Algorithm
* Specific Searching Algorithm
What is "Specific Sorting Algorithm" and "Specific Searching Algorithm"?
* sorting code that uses a specific sorting process, here is the list of sorting algorithms that you will use
Bubble
Selection
Insertion
Merge
Shell
* searching code that uses a specific searching process, here is the list of searching algorithms that you will use
Linear
Binary
Fibonacci
Jump
Count the vowels and consonants in string without including spaces.
class User :
def __int__(self, user_id, username):
self.id = user_id
self.username = username
user_1 = User("001", "allobang")
print(user_1.username)
user_2 = User("002", "Jack")
print(user_2.username)
ACTIVITIES:
1. Finish this code by adding a password attribute.
2. Assign passwords on user_1 and user_2 of your choice.
3. Create 3rd user object.
a. The value of the id should be your student ID number.
b. The value of username should be your first name.
c. Assign the value of the password attribute of your choice.
4. Print the username of 3rd user object.
Find latitude and longitude of first 20 countries with a population greater than or equal to the population limit given below. Use the country details from this dataset(https://cdn.jsdelivr.net/gh/apilayer/restcountries@3dc0fb110cd97bce9ddf27b3e8e1f7fbe115dc3c/src/main/resources/countriesV2.json).
Your task is to find the sum of the length of all lines (in kms) that can be drawn between co-ordinates of these countries.
Assume radius of earth: 6371 km
Round length of each line and final result to 2 decimal points
If co-ordinates are missing for any country use 0.000 N 0.000 E
Population limit: 28875
Note: Population limit will change at random intervals. So please make sure answer is computed for the correct population limit
Given an integer number N as input,write a program to print the right angled triangular pattern of N lines..
Note:There is space after each asterisk (*) character.
Create a class called Numbers, which has a single class attribute called MULTIPLIER, and a constructor which
takes the parameters x and y (these should all be numbers).
(a) Write a method called add which returns the sum of the attributes x and y.
(b) Write a class method called multiply, which takes a single number parameter a and returns the product
of a and MULTIPLIER.
(c) Write a static method called subtract, which takes two number parameters, b and c, and returns b - c.
(d) Write a method called value which returns a tuple containing the values of x and y. Make this method
into a property, and write a setter and a deleter for manipulating the values of x and y.
Create a program wherein the library system should be able to collect fines for books returned after the due date.
Radioactive decay of radioactive materials can be modeled by the equation 𝐴 = 𝐴0𝑒
−𝑡(ln 2⁄ℎ), where
A is the amount of the material at time t, A0 is the amount at time 0, and h is the half-life.
Technetium-99 is a radioisotope that is used in imaging of the brain. It has a half-life of 6
hours. Your program should display the relative amount A/A0 in a patient body every hour for 24
hours after receiving a dose.
Note: With the aid of formatting techniques documented in your note, ensure your program output
matches that given below
Find latitude and longitude of first 20 countries with a population greater than or equal to the population limit given below. Use the country details from this dataset.
Your task is to find the sum of the length of all lines (in kms) that can be drawn between co-ordinates of these countries.
Assume radius of earth: 6371 km
Round length of each line and final result to 2 decimal points
If co-ordinates are missing for any country use 0.000 N 0.000 E
Population limit: 300
Note: Population limit will change at random intervals.
Answer:
finding difference