Include example Python code and output with your answers.
>>> 2++2
>>> 2--2
>>> 2+-2
>>> 2-+2
Create a class called Time that has separate int member data for hours, minutes, and seconds. One constructor should initialize this data to 0, and another should initialize it to fixed values. Another member function should display it, in 11:59:59 format. The final member function should add two objects of type time passed as arguments.
Mean, Median and Mode
Given a list of integers, write a program to print the mean, median and mode.
Mean - The average value of all the numbers.
Median - The mid point value in the sorted list.
Mode - The most common value in the list. If multiple elements with same frequency are present, print all the values with same frequency in increasing order.Input
The input will be a single line containing space-separated integers.Output
The first line of output should contain the mean, round off the value to 2 decimal places.
The second line of output should contain the median, round off the value to 2 decimal places.
The third line of output should contain the mode.
Mean should always be a float value.
Median should be a float value when there are even number of elements, otherwise should be an integer value.
Sample Input 1
2 4 5 6 7 8 2 4 5 2 3 8
Sample Output 1
Mean: 4.67
Median: 4.5
Mode: 2
Sum of Prime Numbers In the Input
Given a list of integers, write a program to print the sum of all prime numbers in the list of integers.
Note: One is neither prime nor composite number.Input
The input will be a single line containing space-separated integers..Output
The output should be a single line containing the sum of all prime numbers from 1 to N.Explanation
For example, if the given list of integers are
2 4 5 6 7 3 8As 2, 3, 5 and 7 are prime numbers, your code should print the sum of these numbers. So the output should be 17.
Sample Input 1
2 4 5 6 7 3 8
Sample Output 1
17
Sample Input 2
65 87 96 31 32 86 57 69 20 42
Sample Output 2
31
Sum of Prime Numbers from M to N
Given two integers M and N, write a program to print the sum of prime numbers from M to N. (Both M and N are inclusive).Input
The first line of input will contain a positive integer (M).
The second line of input will contain a positive integer (N).Output
The output should be a single line containing the sum of prime numbers from M to N.Explanation
For example, if the given M and N are 5 and 11, as all the prime numbers from 5 to 11 are 5, 7, and 11. So the output should be sum of these primes (5+7+11), which is 23.
Similarly, if the given numbers are M is 18 and N is 40, as all the prime numbers from 18 to 40 are 19, 23, 29, 31,and 37. So the output should be sum of these primes (19+23+29+31+37), which is 139.
Sample Input 1
5
11
Sample Output 1
23
Sample Input 2
18
40
Sample Output 2
139
Index of Last Occurrence
Write a program to print the index of the last occurrence of the given number N in the list.Input
The first line of input will contain space-separated integers.
The second line of input will contain an integer N.Output
The output should be the index of the last occurrence of the number N.Explanation
For example, if the given list of numbers and N are
2 4 5 6 7 8 2 4 5 2 3 8
2Number 2 present at index locations 0, 6, 9, as the last occurrence, is at index 9. So the output should be 9.
Sample Input 1
2 4 5 6 7 8 2 4 5 2 3 8
2
Sample Output 1
9
Sample Input 2
65 87 96 31 32 86 57 69 20 42 32 32
32
Sample Output 2
11
Write a program that uses an array of string objects to hold the five student names, an array of one character to hold the five students’ letter grades, and five arrays of doubles to hold each student’s set of test scores and average score. The program should allow the user to enter each student’s name and his or her four test scores. The program should store each student’s information in the arrays [20 points]. It should then calculate and display each student’s average test score [20 points] and a letter grade based on the average [20 points]. Input Validation: Do not accept test scores less than 0 or greater than 100 [10 points]
Write a program that uses an array of string objects to hold the five student names, an array of one character to hold the five students’ letter grades, and five arrays of doubles to hold each student’s set of test scores and average score. The program should allow the user to enter each student’s name and his or her four test scores. The program should store each student’s information in the arrays [20 points]. It should then calculate and display each student’s average test score [20 points] and a letter grade based on the average [20 points]. Input Validation: Do not accept test scores less than 0 or greater than 100 [10 points]
Produce an entity relationship model for the proposed database system for Domingo Roof Works. Use Integration Definition for Information Modeling (IDEF1X) standard.
create JavaScript program for both task in html coding
Assignment #10 – Arrays
Task#1 – Favourite Places
Ask the user to enter ten of their places they have visited in their life. Once they have entered there favourite places, display the results. Use an array to store the ten favourite places.
Task#2 – Favourite Actor
Ask the user to enter their favourite actor and the role that the actor played. Save the actors in one array and the roles in another array. Ask for four favourite actors. Then ask the user for one of their favorite actors. Find the role that the actor played and display it to the screen.