Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

n 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
2
0
int numListo
[
]
=
{
1
0
}
;
,
/
will return false and false
(
not enough of
3
numbers
)
int numlist
1
[
]
=
{
1
0
,
2
0
}
;
,
/
will return false and false
(
not enough of
3
numbers
)
int numList
2
[
]
=
{
1
0
,
2
0
,
3
0
}
;
/
will return true and false int numList
3
[
]
=
{
1
0
,
1
0
,
1
0
}
;
/
will return true and true
(
same value
)
int numList
4
[
]
=
{
1
0
,
1
1
,
1
2
}
;
/
will return true and true
(
incremental value of
1
)
int numList
5
[
]
=
{
1
0
,
1
0
,
1
0
,
1
0
}
;
,
/
will return true and true int numList
6
[
]
=
{
1
0
,
1
0
,
1
0
,
1
0
,
1
0
}
;
,
/
will return true and true int numList
7
[
]
=
{
1
0
,
2
0
,
3
0
,
1
0
,
2
0
,
3
0
}
;
,
/
will return true and false int numList
8
[
]
=
{
1
0
,
2
0
,
3
0
,
4
0
,
1
0
,
2
0
,
3
0
}
;
/
will return true and false int numList
9
[
]
=
{
1
0
,
1
1
,
1
2
,
1
3
,
1
0
,
1
1
,
1
2
}
;
/
will return true and true

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

Step: 3

blur-text-image

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

Database Processing

Authors: David J. Auer David M. Kroenke

13th Edition

B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions