Answer:
// here is code in c++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main() {
// variables to read birth month and year
int birthMonth,birthYear;
cout<<"Enter the birth month:";
// read the birth month
cin>>birthMonth;
cout<<"Enter the birth Year:";
// read the birth year
cin>>birthYear;
// print the output
cout<<birthMonth<<"-"<<birthYear<<endl;
return 0;
}
Explanation:
Declare two variables "birthMonth" and "birthYear". Read the value of birthMonth and birthYear from user. Then print the birth month and birth year and a dash(-) in between them.
Output:
Enter the birth month:1
Enter the birth Year:2000
1-2000
Enter the birth month:5
Enter the birth Year:1950
5-1950
Answer:
The complete method is as follows:
public static int divBySum(int[] arr, int num){
int sum = 0;
for(int i:arr){
if(i%num == 0)
sum+=i;
}
return sum;
}
Explanation:
As instructed, the program assumes that arr has been declared and initialized. So, this solution only completes the divBySum method (the main method is not included)
This line defines the method
public static int divBySum(int[] arr, int num){
This line declares and initializes sum to 0
int sum = 0;
This uses for each to iterate through the array elements
for(int i:arr){
This checks if an array element is divisible by num (the second parameter)
if(i%num == 0)
If yes, sum is updated
sum+=i;
}
This returns the calculated sum
return sum;
}
Answer:
Correct answer is option (2) that is "return".
Explanation:
In any programming language, a variable name can be made up of letters (lower and upper case) and digits. we can also use "_" underscore character for declaring the variables but we cannot use any special character like “$”.We cannot use digits in the beginning of variables name. And we also cannot use reserved keywords of the language like "new","return","while" etc. There should not be space between the variable names. Options 1, 3 and 4 are not violating any of these properties. But in option (2), "return" is a reserved keyword. That is why it is not a valid variable name.
Some example of valid variables name:
foo
BAZ
Bar
_foo42
foo_bar
Some example of invalid variables name:
$foo ($ not allowed)
while ( keywords )
2foo (started with digit)
my foo (spaces )
Answer:
Following are the solution to this question:
Explanation:
Please find the complete question in the attached file.
It will obtain as much information about this matter as necessary even before the conference. It includes its gravity or probability of risk, various cases in the entire event, the possible solutions to the issues, as well as the consequences for parties involved in each potential answer, and Only at conferences, it may clarify to my boss that the explanation for the problem and also in details. It will be doing everything possible and try not to conceal the details but highlight the problem.