Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C + + General requirements: No global variables No multiple return statements in one function Show how you have tested these functions cin and

In C++
General requirements:
No global variables
No multiple return statements in one function
Show how you have tested these functions
cin and cout are not allowed in these functions. They can only be in main() or testing functions.
It should return the values to the caller through the use of return type and pass-by-reference parameters.
Please do not use struct, tuple or pair class.
Please use only pass-by-reference parameters and return type to return values to the caller.
Please do not use string class
Please do not sort the array
Please do not use any string function such as strlen or string class and its methods.
Please do not use array notation (e.g. square bracket). This is an exercise using only pointers and pointer arithmetic.
Problem description:
Write a function named "isTheFirstThreeTheSameAsTheLastThree" that accepts a pointer to an array of integers and its size. The function will check the
list of numbers in the array and return the following info:
boolean indicates whether the first three numbers in the array are the same as the last three
boolean indicates whether those three numbers are special: the same value or a simple incremental value of 1.
For example, the following arrays with given the midpoint value of 20
int numListo[]={10};,?? will return false and false (not enough of 3 numbers)
int numlist1[]={10,20};,?? will return false and false (not enough of 3 numbers)
int numList2[]={10,20,30};?? will return true and false
int numList 3[]={10,10,10};?? will return true and true (same value)
int numList4[]={10,11,12};?? will return true and true (incremental value of 1)
int numList5[]={10,10,10,10};,?? will return true and true
int numList6[]={10,10,10,10,10};,?? will return true and true
int numList7[]={10,20,30,10,20,30};,?? will return true and false
int numList8[]={10,20,30,40,10,20,30};?? will return true and false
int numList9[]={10,11,12,13,10,11,12};?? will return true and true
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

What are the ethical scrutiny requirements of your centre?

Answered: 1 week ago