Answer:
The method in Java is as follows:
public static int numUnique(int list[]) {
int unique = 1;
for (int i = 1; i < list.length; i++) {
int j = 0;
for (j = 0; j < i; j++) {
if (list[i] == list[j])
break;
}
if (i == j)
unique++;
}
return unique;
}
Explanation:
This line defines the numUnique method
public static int numUnique(int list[]) {
This initializes the number of unique elements to 1
int unique = 1;
This iterates through the list
for (int i = 1; i < list.length; i++) {
The following iteration checks for unique items
int j = 0;
for (j = 0; j < i; j++) {
if (list[i] == list[j]) If current element is unique, break the iteration
break;
}
if (i == j)
unique++;
}
This returns the number of unique items in the list
return unique;
}
Gamification and virtual reality is the future of education
Answer:
Education is expected to be the fourth largest sector for VR investment. VR in education is predicted to be a $200 million industry by 2020, and a $700 million industry by 2025. 97% of students would like to study a VR course.
Explanation:
How to do brainliest
What email program would you suggest and why?
Answer:
An email program
Explanation:
And why?
Answer:
I would suggest g m a i l.
Explanation:
I use G m a i l all the time and I think it is easy to use! A lot of people think it is great too! :)
Write a program that reads an integer between o and 1000 and adds all the digits in the integer. For example, if an integer is 932, the sum of all the digits is 14. Hint: Use the % operator to extract digits, and use the / operator to remove the extracted digit. For instance, 932 % 10=2 and 932/10 =93. Here is a sample run:
Enter a number between 0 and 1000 : 999
The sum of digits is 27.
Answer:
Answered below
Explanation:
#Program is written in Python programming language
digit = 0
sum = 0
num = int(input("Enter a number between 0 and 1000: ")
#Check that number is within the valid range
if num > 0 and num <= 1000:
while num != 0:
#Isolate each digit
digit = num % 10
sum = sum + digit
#Remove isolated digit from number
num = num/10
else:
print("Number is not within valid range")
#print total sum of digits
print(sum)