Answer:
An online company wants to conduct real-time sentiment analysis about its products from its social media channels using SQL. The solution which has lowest cost and operational burden is as follow:
B. Configure the input stream using Amazon Kinesis Data Streams. Use Amazon Kinesis Data Analytics to write SQL queries against the stream.
Explanation:
- The option A is not correct as this solution doesn't have lowest cost and operational burden as set up a streaming data ingestion application on Amazon EC2 and connect it to a Hadoop cluster for data processing will have more cost and operational burden.
- The lowest cost and operational burden solution is that we configure input stream using Amazon Kinesis Data Streams. We can use Amazon Kinesis Data Analytics to write SQL queries against the stream.
- The option c and d are also more pricey in terms of cost and operational burden as compared to Amazon Kinesis Data stream and analytics.
Answer:
Explanation:
The following code is written in Java and creates the necessary code so that two int inputs are read and looped through all the numbers between them to find all the primes. These primes are counted and summed. Finally, printing out the sum and the number of primes found to the console.
import java.util.ArrayList;
import java.util.Scanner;
class SumPrimes{
public static void main(final String[] args) {
Scanner in = new Scanner(System.in);
ArrayList<Integer> primes = new ArrayList<>();
int num1, num2, numPrime = 0;
System.out.println("Enter number 1:");
num1 = in.nextInt();
System.out.println("Enter number 2:");
num2 = in.nextInt();
for (int x = num1; x <= num2; x++) {
if (isPrime(x) == true) {
primes.add(x);
numPrime += 1;
}
}
System.out.println("There are " + numPrime + " primes in the array.");
System.out.println("Their sum is " + sumArray(primes));
}
public static int sumArray(ArrayList<Integer> arr) {
int sum = 0;
for (int x: arr) {
sum += x;
}
return sum;
}
static boolean isPrime(int n) {
if (n <= 1)
return false;
for (int i = 2; i < n; i++)
if (n % i == 0)
return false;
return true;
}
}
Apple and Adobe are in disagreement about the use of using Adobe Flash Player on iOS devices such as the iPhone and iPad
Answer:
A switch statement is a set of different outputs depending on the number of criteria asked to follow.
Given an integer number as a variable status, the algorithm would state as the following:
int num
switch (num) {
case 200:
printf(OK);
break;
case 403:
printf(Fobidden);
break;
case 404:
printf(Not Found);
break;
case 500:
printf(Server Error);
break;
default:
printf(Not a proper value);
break;
}
Depends on the value of hte variable "num", it will fall in one of the options above. If the variable has a different value that doesn't fit in any of the options above, it will prompt the default message.