In tabular form the data is displayed in a table layout following a continuous series of records. In this almost all the records are displayed in a single layout. While in columnar form the data is displayed one record at a time.
Answer: Hello your question is poorly written attached below is the well written question
answer:
a) Determine ( compute ) the difference between the max and minimum value. determine the Min and max values using 1.5n comparisons
time efficiency = θ( n )
b) A(n-1) - A(0)
time efficiency = θ( 1 )
Explanation:
a) An unsorted array
To find the maximum and minimum values scan the array of elements , then determine ( compute ) the difference between the max and minimum value. to determine the range. Alternatively determine the Min and max values using 1.5n comparisons
Algorithm's time efficiency = θ( n )
b) A sorted array
To determine the range, we will determine the difference between the first and last element i.e. A(n-1) - A(0)
time efficiency = θ( 1 )
Answer:
Explanation:
#include <iostream>
using namespace std;
int main ()
{
int responses[30],count[6];
int score = 0;
string resp = " ";
for (int i = 0; i < 30; i++)
{
responses[i] = 0;
}
for (int i = 0; i < 6; i++)
{
count[i,1]=0;
count[i,2]=0;
count[i,0]=0;
}
while ((resp != "Y") && (resp != "y"))
{
for (int i = 0; i < 30; i++)
{
while ((score > 5) || (score < 1))
{
cout << "Student " << (i+1)<< " please enter a value (1-5):";
cin >> score;
}
responses[i] = score;
if((score > 5)||(score<1))
{
if(score==1) count[1]++;
if(score==2) count[2]++;
if(score==3) count[3]++;
if(score==4) count[4]++;
if(score==5) count[5]++;
}
score = 0;
}
cout<< "Response Frequency Percentage"<<endl;;
cout<< " 1 "<<count[1]<<" "<<(count[1]/30)<<"%"<<endl;
cout<< " 2 "<<count[2]<<" "<<(count[2]/30)<<"%"<<endl;
cout<< " 3 "<<count[3]<<" "<<(count[3]/30)<<"%"<<endl;
cout<< " 4 "<<count[4]<<" "<<(count[4]/30)<<"%"<<endl;
cout<< " 5 "<<count[5]<<" "<<(count[5]/30)<<"%"<<endl;
cout<< "Do you want to exit? Press Y to exit any other key to continue: ";
cin>> resp;
}
return 0;
}
Answer:
def get_middle_ten(sentence):
ind = (len(sentence) - 12) // 2
return sentence[ind:ind + 12]
# Testing the function here. ignore/remove the code below if not required
print(get_middle_twelve("abcdefghijkl"))
print(get_middle_twelve("abcdefghijklmnopqr"))
print(get_middle_twelve("abcdefghijklmnopqrst"))