D. A technology-and creativity-driven world
Answer:
// here is code in C++.
#include <bits/stdc++.h>
using namespace std;
// recursive function to find sum from 1 to n
int recur_Sum(int n)
{ // base condition
if (n <= 1)
return n;
// recursive call
return n + recur_Sum(n - 1);
}
// main function
int main()
{
// variables
int n;
cout<<"Enter a number:";
// read the number
cin>>n;
// print the sum
cout<<"Sum of first "<<n<<" integer from 1 to "<<n<<" is:"<<recur_Sum(n);
return 0;
}
Explanation:
Read a number from user and assign it to variable "n".Call function recur_Sum() with parameter "n".This function will recursively call itself and find the Sum of first n numbers from 1 to n.Then function will return the sum.
Output:
Enter a number:10
Sum of first 10 integer from 1 to 10 is:55
Answer:
The solution code is written in Python:
- def square(num):
- if type(num).__name__ == 'int':
- sq_num = num * num
- return sq_num
- else:
- return "Invalid input"
-
- print(square(5))
- print(square("Test"))
Explanation:
To ensure only certain type of operation can be applied on a input value, we can check the data type of the input value. For example, we define a function and name it as <em>square</em> which take one input number, <em>num </em>(Line 1).
Before the <em>num</em> can be squared, it goes through a validation mechanism in by setting an if condition (Line 2) to check if the data type of the input number is an integer,<em> int.</em> If so, the<em> num </em>will only be squared otherwise it return an error message (Line 6).
We can test our function by passing value of 5 and "Test" string. We will get program output:
25
Invalid input
Answer:
Collaborative filtering
Explanation:
This is one out of five on the Recommender system apart from most popular items, Association and Market Basket based Analysis, Content-based analysis, self and hybrid analysis where we use both content-based and collaborative based approach together. And the Recommender system is a very important topic in Data science. For this question, remember that Collaborative filtering focuses on user and various other user's choices which are mathematically alike to concerned users, and which we find with the study of a large data set. Thus, we can predict from our above study that what are going to be likes of concerned users, and at the item level, whether that item will be liked by the concerned user or not. And this is prediction, and we use this approach in Machine learning these days. For this question, and as mentioned in question the requirements, answer is Collaborative filtering.
<span>the one that would have the greatest impact on my credit score would be :
B. II and III
If you had a troublesome payment history, it would be very likely that you'll end up with credit score because you make yourself became untrustworthy and if you have a low Debt, people will trust your current financial condition and you will be more likely to earn high credit score</span>