What is h(60)-h(45), given the definition of h below?
def h(n):
s = 0
for i in range(2,n):
if n%i == 0:
s = s+i
return(s)
11. We want to calculate the total marks of each student of a class in Physics, Chemistry and Mathematics and the average marks of the class. The number of students in the class is entered by the user. Create a class named Marks with data members for roll number, name and marks. Create three other classes inheriting the Marks class, namely Physics, Chemistry and Mathematics, which are used to define marks in individual subject of each student. Roll number of each student will be generated automatically.
On the first day of the month, 4 customers come to a restaurant. Afterwards, those 4 customers come to the same restaurant once in 2,4,6 and 8 days respectively.
a). On which day of the month, will all the four customers come back to the restaurant together?
Accept n Country (ccode, cname, population) information and perform the following
a. Display all country details
b. Search country by cname
c. Search country by ccode
d. Display all countries having population greater than 2500000
e. Display country details having maximum population
The placement session has begun in a college. There is N number of students standing outside an interview room in a line. It is given that the person who goes first has higher chances of selection.
Each student has a number associated with them representing their problem-solving capability. The higher the capability the higher the chances of selection. Now every student wants to know the number of students ahead of him with higher problem-solving capability.
monica has cooked n dishes and collected the data on the level of satisfaction for all the dishes from a guest. the guest returns an array, where the ith element of the array is the liking level of the ith dish. also, the time taken to cook the ith dish is i. like-to-time coefficient of a dish is calculated by multiplying the time taken to cook food with its liking level, i.e., input 2[i]. totally like-to-time coefficient is calculated by summing up all individual coefficients of dishes. you want the total like-to-time coefficient to be maximum. you can also remove some dishes, in which case, a new coefficient is calculated using the left dishes. find the maximum sum of all possible like-to-time coefficients.
Develop a class called Complex that represents a complex number. An example of a complex number is 5 + 10 i (5 is the real part and 10 is the imaginary part of a complex number). Use public integer values to represent the real and imaginary parts of a complex number.
A company wants to transmit data over the telephone, but it is concerned that its phones may be tapped. All of its data are transmitted as four-digit integers. It has asked you to write a program that will encrypt its data so that the data may be transmitted more securely. Your script should read a four-digit integer entered by the user in a prompt dialog and encrypt it as follows: Replace each digit by (the sum of that digit plus 7) modulus 10. Then swap the first digit with the third, and swap the second digit with the fourth. Then build the script that displays the encrypted integer.
To write a java program that reads a file name from the user, displays information about whether the file exists, whether the file is readable, or writable, the type of file and the length of the file in bytes.
The program will ask the user to enter Midterm grades and final grades. Student final grades is 30% of midterm and 70% of final grades