Menu

[Solved]Create New File Dev C Modify Program Use Vector Instead Array Header Comments Must Present Q37232136

Create a new file (in Dev C++)

Modify program above to use a vector instead ofan array.

  • Header comments must be present
  • Prototypes must be present if functions are used
  • Hello and goodbye messages must be shown
  • Vector(s) must be used for implementation
  • Use comments and good style practices

======================================================================================================#include <iostream>using namespace std;int main() {cout<<“Welcome! This program will find the minimum and maximum numbers in an array.”<<endl;cout<<“You will be asked to enter a number ten times. Then, the program will display”<<endl;cout<<“the numbers back to you and indicate which is the smallest and which is the largest.”<<endl<<endl;int arr[10],min=1000,max=-1;for(int i=0;i<10;i++){cout<<“Please enter a number: “;cin>>arr[i];if(min>arr[i])min=arr[i];if(max<arr[i])max=arr[i];}cout<<“nValues: “;for(int i=0;i<10;i++)cout<<arr[i]<<” “;cout<<“nMinimum: “<<min<<endl;cout<<“Maximum: “<<max<<endl;cout<<“nExiting program. Goodbye!”;}

Expert Answer


Answer to Create a new file (in Dev C++) Modify program above to use a vector instead of an array. Header comments must be present… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *