Answer:
public class print{
public static void fillArray(int[] arr, int initialValue){
int n = arr.length;
for(int i=0;i<n;i++){
arr[i] = initialValue++;
}
for(int i=0;i<n;i++){
System.out.print(arr[i]+" ");
}
}
public static void main(String []args){
int[] array = new int[5];
int initialValue =3;
fillArray(array,initialValue);
}
}
Explanation:
Create the function with two parameter first is array and second is integer.
Then, declare the variable and store the size of array.
Take the for and fill the array from the incremented value of initialValue by 1 at every run of loop.
After loop, print the element of the array.
Create the main function which is used for calling the function and also declare the array with size 5 and initialValue with 3. After that, call the function with this argument.
Answer:
Explanation:
bool isPalindrome(string str)
{
int length = str.length();
for (int i = 0; i < length / 2; i++) {
if (str [i] != str [length – 1 – i]) {
return false;
}
}
cout << str << "is a palindrome";
return true;
}
Answer:
The answer to this question is given below in the explanation section.
Explanation:
STEM is a curriculum based on the idea of educating students in four specific disciplines — science, technology, engineering, and mathematics — in an interdisciplinary and applied approach. The students who graduated in STEM-based education getting more paid and jobs than students who did not study the STEM-based education.
As in this question that John is considering his STEM education choices, and he wants to begin working in the technology field as soon as possible. He should pursue bachelor (graduate) degree in technology. Because after, passing out, he can begin working in technology easily.