1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Allushta [10]
3 years ago
13

Write the definition of a function isSenior, that receives an integer parameter and returns true if the parameter's value is gre

ater or equal to 65, and false otherwise. So, if the parameter's value is 7 or 64 or 12 the function returns false. But if the parameter's value is 69 or 83 or 65 the function returns true.
Computers and Technology
1 answer:
ohaa [14]3 years ago
6 0

Answer:

The function definition for this question can be given as:

Function Definition:

bool isSenior(int x )  //function

{  

//function body Or function definition.

//conditional statement

//if statement

if (x >=65)  

{

return true;   //return value true.

}

else  //else statement

{

return false;    //return value false.

}

}

Explanation:

In the above function definition firstly we define a function that isSenior. This function return Boolean value that is true or false in this function we pass the value as the parameter in that function we use the if statement that check the pass value is greater then equal to 65. If the condition is true it return true.else it will return false.

You might be interested in
What is computer ????
LekaFEV [45]

Answer:

Explanation:

A computer is a device that manipulates information, or data accrding to the instructions given to it and give us an output. It has the ability to store, retrieve, and process data.

6 0
4 years ago
Data Structure in C++
agasfer [191]

The code .cpp is available bellow

#include<iostream>

using namespace std;

//declaring variables

void merge(int* ip, int sz, int* opt, bool opt_asc); //merging

int* mergesort(int* ip, int sz);

void mergesort(int *ip, int sz, int* opt, bool opt_asc);

void merge(int* ip, int sz, int* opt, bool opt_asc)

{

  int s1 = 0;

  int mid_sz = sz / 2;

  int s2 = mid_sz;

  int e2 = sz;

  int s3 = 0;

  int end3 = sz;

  int i, j;

   

  if (opt_asc==true)

  {

      i = s1;

      j = e2 - 1;

      while (i < mid_sz && j >= s2)

      {

          if (*(ip + i) > *(ip + j))

          {

              *(opt + s3) = *(ip + j);

              s3++;

              j--;

          }

          else if (*(ip + i) <= *(ip + j))

          {

              *(opt + s3) = *(ip + i);

              s3++;

              i++;

          }

      }

      if (i != mid_sz)

      {

          while (i < mid_sz)

          {

              *(opt + s3) = *(ip + i);

              s3++;

              i++;

          }

      }

      if (j >= s2)

      {

          while (j >= s2)

          {

              *(opt + s3) = *(ip + j);

              s3++;

              j--;

          }

      }

  }

  else

  {

      i = mid_sz - 1;

      j = s2;

      while (i >= s1 && j <e2)

      {

          if (*(ip + i) > *(ip + j))

          {

              *(opt + s3) = *(ip + i);

              s3++;

              i--;

          }

          else if (*(ip + i) <= *(ip + j))

          {

              *(opt + s3) = *(ip + j);

              s3++;

              j++;

          }

      }

      if (i >= s1)

      {

          while (i >= s1)

          {

              *(opt + s3) = *(ip + i);

              s3++;

              i--;

          }

      }

      if (j != e2)

      {

          while (j < e2)

          {

              *(opt + s3) = *(ip + j);

              s3++;

              j++;

          }

      }

  }

   

  for (i = 0; i < sz; i++)

      *(ip + i) = *(opt + i);

}

int* mergesort(int* ip, int sz)

{

  int* opt = new int[sz];

   

  mergesort(ip, sz, opt, true);

  return opt;

}

void mergesort(int *ip, int sz, int* opt, bool opt_asc)

{

  if (sz > 1)

  {

      int q = sz / 2;

      mergesort(ip, sz / 2, opt, true);

      mergesort(ip + sz / 2, sz - sz / 2, opt + sz / 2, false);

      merge(ip, sz, opt, opt_asc);

  }

}

int main()

{

  int arr1[12] = { 5, 6, 9, 8,25,36, 3, 2, 5, 16, 87, 12 };

  int arr2[14] = { 2, 3, 4, 5, 1, 20,15,30, 2, 3, 4, 6, 9,12 };

  int arr3[10] = { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 };

  int *opt;

  cout << "Arays after sorting:\n";

  cout << "Array 1 : ";

  opt = mergesort(arr1, 12);

  for (int i = 0; i < 12; i++)

      cout << opt[i] << " ";

  cout << endl;

  cout << "Array 2 : ";

  opt = mergesort(arr2, 14);

  for (int i = 0; i < 14; i++)

      cout << opt[i] << " ";

  cout << endl;

  cout << "Array 3 : ";

  opt = mergesort(arr3, 10);

  for (int i = 0; i < 10; i++)

      cout << opt[i] << " ";

  cout << endl;

  return 0;

}

4 0
4 years ago
Assume a computer that has 32-bit integers. Show how each of the following values would be stored sequentially in memory, starti
finlep [7]

Answer:

Adresses                          Big endian                                    Little Endian

0x100                                  AB                                                 56

0x101                                   12                                                  34

0x102                                  34                                                  12

0x103                                  56                                                 AB

0x104                                  00                                                 76

0x105                                  2B                                                 F8

0x106                                  F8                                                 2B

0x107                                 76                                                 00

0x108                                00                                                 A1

0x109                                08                                                B0  

0x10A                                B0                                                08

0x10B                                A1                                                 00

0x10C                               00                                                  01

0x10D                               00                                                 00  

0x10E                               00                                                  00

0x10F                                01                                                   00

0x110                                FE                                                   34

0x111                                 DC                                                  12

0x112                                12                                                    DC  

0x113                                34                                                   FE

Explanation:

As, it is mentioned that all the integers have 32 bits and all the data given in the question is in Hexadecimal. In Hexadecimal each number consists of 4 bits.

Each memory location contains 1 byte = 8 bits of data. So we store 2 digits of Hexadecimal number each location from each number in given data. If any number contains less than 32 bits in binary, we will add zeros to complete the number in 32 bits.

In big endian order, data is stored from upper most bit to lower most bit in sequential order and in Little Endian order it is vise versa.

6 0
3 years ago
Integrated circuits are made up of _____ that carry the electrical current.
timama [110]
The answer is conductors
5 0
3 years ago
A bank wants to reject erroneous account numbers to avoid invalid input. Management of the bank was told that there is a method
netineya [11]

Answer:

validity check

Explanation:

validity check

4 0
3 years ago
Other questions:
  • The Law of Increasing Opportunity Costs requires greater ______ of one good in order to produce ______ of another good.
    11·2 answers
  • Where does the computer store instructions and data that are needed frequently by the cpu?
    11·1 answer
  • NEED HELP ASAP! BRAINLIEST AND 20 PTS TO CORRECT ANSWER!
    14·1 answer
  • Dwight <br> d. eisenhower was impressed with germany's network of highways and how it __________.
    15·1 answer
  • To create nested lists within each of these topical areas that would contain links to specific pages on the AllStyles website. I
    15·1 answer
  • Match each of the following steps of SDLC development to its position in the development process.
    15·1 answer
  • What questions do they ask for the 08.03 Discussion- Based Assesment in Drivers Ed?? Thanks.
    11·1 answer
  • Which of the following tasks will save a file over top of itself, using the same filename? A. Reload B. Save C. Save As D. Expor
    13·1 answer
  • Kyle has a notebook for each of his 5 classes. He puts 6 stickers on each notebook. There are 10 stickers on each sheet. How man
    11·2 answers
  • Data files whose records are always retrieved in sequence from the beginning of the file are known as
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!