Question: in C++ please The code should be well structured and has correct logic. It should follow programming best practices. The code should be well indented

in C++ please

in C++ please The code should be well structured and has correctlogic. It should follow programming best practices. The code should be wellindented and commented. PART 1 Write a program that will: 1. Call

The code should be well structured and has correct logic. It should follow programming best practices. The code should be well indented and commented.

PART 1 Write a program that will: 1. Call a function to input temperatures for consecutive days in an array. The temperatures are to be integer numbers. 2. The user will input the number of temperatures. There will be no more than 10 temperatures. 3. Call a function to sort the array by ascending order. You can use any sorting algorithm you wish as long as you can explain it. 4. Call a function that will return the average of the temperatures. The average should be displayed to two decimal places. Part 2 Tic-Tac-Toe Game Write a program that allows two players to play a game of tic-tac-toe. Use a twodimensional char array with three rows and three columns as the game board. Each element of the array should be initialized with an asterisk. (). The program should run a loop that - Displays the contents of the board array - Allows player 1 to select a location on the board for an X. The program should ask the user to enter the row and column number. - Allows player 2 to select a location on the board for an O. The program should ask the user to enter the row and column number. - Determines whether a player has won, or a tie has occurred. If a player has won, the program should declare that player the winner and end. If a tie has occurred, the program should say so and end. Part 3 Modify the following program so pin1, pin2, and pin3 are vectors instead of arrays // This program is a driver that tests a function comparing the // contents of two int arrays. \#include using namespace std; // Function Prototype bool testPIN(const int [], const int [], int); int main () \{ const int NUM_DIGITS =7; // Number of digits in a PIN int pin1[NUM_DIGITS] ={2,4,1,8,7,9,0};// Base set of values. int pin2[NUM_DIGITS] ={2,4,6,8,7,9,0};// Only 1 element is // different from pin1. int pin3[NUM_DIGITS] ={1,2,3,4,5,6,7};// All elements are // different from pin 1. if (testPIN(pin1, pin2, NUM_DIGITS)) cout "ERROR: pin 1 and pin2 report to be the same. \ n"; else cout "SUCCESS: pin1 and pin2 are different, n "; if (testPIN(pin1, pin3, NUM_DIGITS)) cout "ERROR: pin1 and pin3 report to be the same. "; else cout "SUCCESS: pin1 and pin3 are different. ; if (testPIN(pin1, pin1, NUM_DIGITS)) cout "SUCCESS: pin1 and pin1 report to be the same. nn "; else Cout "ERROR: pin1 and pin1 report to be different. "; return 0 ; \} bool testPIN(const int custPIN[], const int databasePIN[], int size) \{ for (int index =0; index

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!