Write a Python program that does the following.
Create your own example of a function that modifies a list passed in as an argument. Describe what your function does in terms of arguments, parameters, objects, and references.
Create a simple text-based console game that implements at least three (3) interfaces.
Describe the relationship between objects, references, and aliasing. Again, create your own examples with Python lists
Describe the difference between objects and values using the terms “equivalent” and “identical”. Illustrate the difference using your own examples with Python lists and the “is” operator.
Write a program that reads the prices of a shop’s products continuously until the user enters −1. The program should display the minimum price, the maximum, and the average of those within [5,30], before it terminates. Assume that none of the product’s costs more than $100.
Which is the output of the below code fragment:
System.out.print(“The result is: “ + (3+2))
System.out.println(“You did a great job!”)
A. The result is + (3+2)You did a great job!
B. The result is + 5You did a great job!
C. The result is 5You did a great job!
D. The result is 5 You did a great job
5. In the following code, what is the final value of b
int a =0, b;
for (int i = 20; i>0; i=i-5)
{
b=a++;
}
a. 3
b. 4
c. 5
d. 20
Write a program to calculate the voltage when the value of electric current and resistance
Consider the following program, what is the output? (2 marks)
class overload
{
int x;
double y;
void prod(int n)
{
for (int i=1;i<n;i++)
x=x*i
}
void prod(int n, int m)
{
for (int i=n;i<m;i++)
y=y*i
}
overload()
{
this.x = 1;
this.y = 1;
}
}
class Overload_methods
{
public static void main(String args[])
{
overload obj = new overload();
int n = 2;
int m = 4;
obj.prod(n);
obj.prod(n,m);
System.out.println(obj.x + " " + obj.y);
}
}