1. Open and read the countrycities.csv file.
2. Count and display the number of cities per country.
3. Count and display the country which is a member of the EU (EU = yes) and not a member of the EU (EU = no).
4. Find and display the country with the highest and lowest total population.
5. Count and display the country with a coastline (coastline = yes) and without a coastline (coastline = no).
THIS IS THE LINK OF countrycities if you can help me with this i badly need this, i am just a student : https://drive.google.com/drive/folders/1dFoUHbPrBo3hiOJY_PTccdlQXSM4YJ4s?usp=sharing
Discuss how an operating system protects computer
hardware, processor, main memory, and input-output
devices of a computer system; and provide
appropriate practical examples to illustrate your
answer.
Write a program in C++ that uses a structure to store the following product data in a file (File
Name: product.txt):
Product ID
Product Name
Quantity
Wholesale Cost
Retail Cost
Date Added to Product
The program should have a menu that allows the user to perform the following tasks:
• Add new records to the file.
• Display any record in the file.
The program should calculate and display the following data:
• The total wholesale value of the product
• The total retail value of the product
Input Validation: The program should not accept quantities, or wholesale or retail costs, less
than 0. The program should not accept dates that the programmer determines are unreasonable.
Control Structures: As a build up from the previous question, consider 3 possible scenario of input : A character, number or word. You program should the do the following: In case the input is a character it should indicate if it’s a vowel or not, when a number is entered then it’s should check if it’s a prime and finally if a word is entered the system should check if it’s a palindrome or not. Sample Run1 Sample Run3 Enter a character, number or word: c Enter a character, number or word: 7 Output1: C is not a vowel Output3: 7 is a prime number Sample Run2 Enter a character, number or word: programming Output2: Programming is not a palindrome
Given a positive number, create an array with that number as a size and populate it with the items/names provided. Additionally, the program should print out the longest name in the array. Sample Run1 3 Apple Banana Kiwi Output1: Banana is the longest name
Input three random characters and make sure they are inputted on different lines.
Print out the three characters in order, each on a different line, using only 1 printf() statement and newline characters (\n).
An initial code with the one printf() is provided for you, just complete the missing items inside it. Do not add any other printf()'s
Instructions:
Sample:
Enter a small letter: a
Uppercase = AEnter a small letter: f
Uppercase = FWrite a python function Write_String(fname, *list) which take a list containing string elements and write them in a file myfile.txt until the string “finish” (not case sensitive) occur. The function then returns the contents written in file as a string. Before writing list elements in file, you also need to make a separate python function to check whether input list contains "Finish" or not. If not, then it should return error as shown in example.
Write the program in function definition?
myfile.txt:
Python
Java
C
C++
Ruby
.Net
Example-1
Example-2
Example-3
Input:
myfile.txt
["Python", "Java", "C", "C++", "Finish"]
Output:
PythonJavaCC++
Input:
myfile.txt
["Python", "Java", "C", "C++", "Finish",".Net", "Rubby"]
Output:
PythonJavaCC++Input:
myfile.txt
["Python", "Java", "C", "C++"]
Output:
Error: List does not contain Finish
Write a python function Read_Prime(fname, list) which takes a list of numbers as an input, use this number to write them in a file "primes.txt" . The function then read the file and return a list containing only prime numbers as shown in the example. Also, write the exception handling code to show the proper message.
def Read_Prime(fname, list_1):
#write your code here
return
#Call your function from main
list_1=[1,2,3,4,5,6,7]
fname = "primes.txt"
res = Read_Prime(fname, list_1)
print(res)
Example-1
Example-2
Example-2
Input:
primes.txt
[1,2,3,4,5,6,7]
Output:
[1,2,3,5,7]
Input:
primes.txt
[3,6,5,13,18,21]
Output:
[3,5,13]
Input:
primes.txt
[2,4,6,8,10]
Output:
[2]
Write a code on even and odd numbers