CS 3304 University of Houston Data and Information Structures Worksheet

CS 3304 – Data and Information StructuresAssignment 1
Due: 09/13/2022, 23:59
Submission: Submit your solutions as a single .zip file through Blackboard. .zip file will contain
– Q123.cpp file including the functions and struct for the Questions 1, 2, and 3. It should also
include a main function calling those functions.
– Circle.cpp and Circle.h files for the Question 4 and CircleDriver.cpp file that contains the main
function where Circle objects are created and the methods are called.
Q1 (20 pts). Write a C++ function named isOrdered that accepts an integer array and the
number of elements in the array as a parameter. The function should return 1 if the numbers
are in non-decreasing order, 2 if the numbers are in non-increasing order, and returns 0
otherwise. For instance, running the following code in the main function should print 0, 1, 2, and
0.
int a[] = { 3,7,9,12,4,6 };
int b[] = { 3,7,9,12,12,13 };
int c[] = { 8,8,6,6,4,3 };
int d[] = { 9,7,7,6,2,3 };
cout

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER