Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

// HM.cpp : Defines the entry point for the console application. // #include #in

ID: 3617041 • Letter: #

Question

// HM.cpp : Defines the entry point for the console application.

//

#include

#include

#include

#include

#include

using

#define

struct

string last;

int

double

char

} unit[MAX];

void

void

void

int

{

int

ifstream in;

char

int

cout<<

cin>>filename;

in.open(filename);

if

{ cout<<

system(

return

}

getinfo(unit,in,count);

sortfunction();

cout<<

cin>>num;

while

{

while

{cout<<

cout<<

cin>>num;

}

search(unit,count,num);

cout<<

cin>>num;

}

system(

return

0;

}

void

{in>>unit[count].last;

while

{in>>unit[count].space>>unit[count].rent>>unit[count].size;

count++;

in>>unit[count].last;

}

return

;

}

void

{

int

max--;

while

{mid=(low+max)/2;

if

low = mid + 1;

else

{

if

max = mid - 1;

else

{cout<<

"unit: "

cout<<

"Customer Name: "

cout<<

"Rent: "

cout<<

"Size: "

Explanation / Answer

please rate - thanks // HM.cpp : Defines the entry point for the consoleapplication. // #include "stdafx.h" #include #include #include #include using namespace std; #define MAX 100 struct rental { string last; int space; double rent; char size; } unit[MAX]; void getinfo(rental[],ifstream &,int&); void search(rental[],int,int); void sortfunction(rental[],int); int main() { int num; ifstream in; char filename[15]; int count=0; coutfilename; in.open(filename); if(in.fail()) //is it ok? { cout>unit[count].rent>>unit[count].size; count++; in>>unit[count].last; } return ; } void search(rental unit[],int max,int key) { int i,j,low=0,mid; max--; while(low