Course Solutions Uncategorized (Solved) : Please Provide Pseudo Code Fineof Numpeople Getline Fin Name Read Name Name Namesubstr 0 Q38103521 . . . .

(Solved) : Please Provide Pseudo Code Fineof Numpeople Getline Fin Name Read Name Name Namesubstr 0 Q38103521 . . . .

 

please provide pseudo code for this.

while(!fin.eof())

{

numPeople++;

getline(fin,name); // READ name

name = name.substr(0,name.length()-1); // REMOVE ‘n’ from theend of name

// READ id and balance

fin>>id>>balance;

totalBalance += balance; // DETERMINE the smallBalance

if(smallName.length()==0)

{

smallName = name;

smallId = id;

largeId = id;

smallBalance = balance;

largeBalance = balance;

}

else

{

if(balance < smallBalance)

{

smallBalance = balance;

smallName = name;

smallId = id;

}

if(balance > largeBalance)

{

largeBalance = balance;

largeName = name;

largeId = id;

}

   }

fout<<left<<setw(10)<<id<<left<<setw(20)<<name<<left<<setw(6)<<“$”<<left<<setw(1)<<fixed<<setprecision(2)<<balance<<endl;

fin.ignore(std::numeric_limits<std::streamsize>::max(),’n’);//cin leaves n in the input so remove it

}

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

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

Related Post

(Answered) : Questions: Using consequential, rule-based, and character theories, evaluate Juanita’s options. What should Juanita do? Why?(Answered) : Questions: Using consequential, rule-based, and character theories, evaluate Juanita’s options. What should Juanita do? Why?

Questions: Using consequential, rule-based, and character theories, evaluate Juanita’s options. What should Juanita do? Why? Juanita Maxwell devotes a great deal of time and energy in getting to know her employees.