Answer:
Following is the code for filter:
public class filter
{ public static void main(String[] args)
{ int x = StdIn.readInt();
System.out.print(" " + x + " ");
while(!StdIn.isEmpty())
{ int y = StdIn.readInt();
if(y != x)
System.out.print(" " + y + " ");
x = y;
}
}
}
Explanation:
- A public class filter is used.
- The main function will accept a single argument as string[], it is also known as java command line argument.
- Now the Stdln.readInt is used to read the integers in the sequence and store it in integer x.
- The value stored in variable x will be printed using System.out.print
- Now unless the Stdln.readInt gets an empty value, check each value of sequence and store in variable y.
- If y is not equal to previous value x, print it and shift the value of y into x.
- Repeat the loop again.
i hope it will help you!
Answer:
// program in Python to check perfect number
#function to find number is perfect or not
def is_Perfect_Number(n):
#total variable
tot = 1
i = 2
#sum of all divisor of number
while i*i<=n:
if n%i==0:
tot = tot + i + n/i
if tot == n and n != 1:
return 1
i = i+1
return 0
#read until user enter a perfect number
while True:
#read integer
num = int(input("Input an integer: "))
#call the function
if(is_Perfect_Number(num)):
print(num,"is perfect number")
#if perfect number break
break
else:
print(num,"is not a perfect number")
#ask again
print("try again.")
Explanation:
Read number from user and then call the function is_Perfect_Number() with parameter "num".This will find the sum of all divisor of number.If sum is equal to number then it will return 1 else return 0.If the number is not perfect then it will again ask to enter a number until user enter a perfect number.
Output:
Input an integer: 24
24 is not a perfect number
try again.
Input an integer: 28
28 is perfect number
Answer:
Technology has profoundly changed education in many ways. Technology has greatly expanded access to education. In medieval times, books were rare and only an elite few had access to educational opportunities. Individuals had to travel to centers of learning to get an education. Today, massive amounts of information (books, audio, images, videos) are available at one’s fingertips through the Internet, and opportunities for formal learning are available online worldwide through online learning, podcasts, traditional online degree programs, and more. Access to learning opportunities today is unprecedented in scope thanks to technology.
Technology is a gift of God. After the gift of life, it is perhaps the greatest of God's gifts. It is the mother of civilizations, of arts, and sciences. Technology has certainly changed the way we live. It has impacted different facets of life and redefined living. Undoubtedly, technology plays an important role in every sphere of life. Several manual tasks can be automated, thanks to technology. Also, many complex and critical processes can be carried out with ease and greater efficiency with the help of modern technology. Thanks to the application of technology, living has changed and it has changed for the better. Technology has revolutionized the field of education. The importance of technology in schools cannot be ignored. In fact, with the onset of computers in education, it has become easier for teachers to impart knowledge and for students to acquire it. The use of technology has made the process of teaching and learning all the more enjoyable.
Technology has also begun to change the roles of teachers and learners. In the traditional classroom, the teacher is the primary source of information, and the learners passively receive it. This model of the teacher as the “sage on the stage” has been in education for a long time, and it is still very much in evidence today. However, because of the access to information and educational opportunity that technology has enabled, in many classrooms today we see the teacher’s role shifting to the “guide on the side” as students take more responsibility for their learning using technology to gather relevant information. Schools and universities across the country are beginning to redesign learning spaces to enable this new model of education, foster more interaction and small group work, and use technology as an enabler.
Explanation:
Answer:
Is it related to technology and computers?
B.Interact more with people from different backgrounds. this is correct because that would help people get to know each other better.
Hope this helps:)