Answer: (A) Fixed interval
Explanation:
The fixed interval schedule is the type of schedule of the reinforcement in the operand conditioning in which the the initial response are rewarded by some specific amount of the time.
The main issue with the fixed interval schedule is that the people have to wait until the reinforcement schedule get occur and start their actual response of interval. This type of reinforcement schedule occur as the output value does not posses constant value all the time.
Therefore, Option (A) is correct.
Answer:
Honestly I believe its $1
Explanation:
It just stays on $1 don't know how tho
Given an array of integers (both odd and even), sort them in such a way that the first part of the array contains odd numbers sorted in descending order, rest portion contains even numbers sorted in ascending order.
Explanation:
- Partition the input array such that all odd elements are moved to left and all even elements on right. This step takes O(n).
- Once the array is partitioned, sort left and right parts individually. This step takes O(n Log n).
#include <bits/stdc++.h>
using namespace std;
void twoWaySort(int arr[], int n)
{
int l = 0, r = n - 1;
int k = 0;
while (l < r) {
while (arr[l] % 2 != 0) {
l++;
k++;
}
while (arr[r] % 2 == 0 && l < r)
r--;
if (l < r)
swap(arr[l], arr[r]);
}
sort(arr, arr + k, greater<int>());
sort(arr + k, arr + n);
}
int main()
{
int arr[] = { 1, 3, 2, 7, 5, 4 };
int n = sizeof(arr) / sizeof(int);
twoWaySort(arr, n);
for (int i = 0; i < n; i++)
cout << arr[i] << " ";
return 0;
}
Answer:
void mn(int m, int n){
int sum = 0;
int count = 0;
if(m<n){
for(int i = m;i<=n;i++){
sum+=i;
}
}
else{
for(int i = n;i<=m;i++){
sum+=i;
}
}
count = abs(m - n)+1;
cout<<"Sum: "<<sum<<endl;
cout<<"Average: "<<(float)sum/count;
}
Explanation:
This line defines the method
void mn(int m, int n){
This initializes sum and count to 0
int sum = 0;
int count = 0;
This checks if m is less than n
if(m<n){
This iterates from m to n and calculates the sum of numbers between this interval
<em> for(int i = m;i<=n;i++){</em>
<em> sum+=i;</em>
<em> }</em>
<em> }</em>
If otherwise,
else{
This iterates from n to m and calculates the sum of numbers between this interval
<em> for(int i = n;i<=m;i++){</em>
<em> sum+=i;</em>
<em> }</em>
<em> }</em>
This calculates the range from m to n using absolute function
count = abs(m - n)+1;
This prints the calculated sum
cout<<"Sum: "<<sum<<endl;
This calculates and prints the average
cout<<"Average: "<<(float)sum/count;
}
<em>See attachment for complete program that includes the main (in c++)</em>