Question

Need help writing a program that meets pseudocode and criteria . Txt File below input.txt file...

Need help writing a program that meets pseudocode and criteria . Txt File below

cbff785f60a39749e0b9ba6beeb1ea35.png

8e3d9f7a77eaa0349bba25b88569c83f.png

9d34b21ccbc089c3ead2aab7601d877c.png

a3a1cd017dc3573514879f3896158304.png

input.txt file data

05 11/30/16
03 12/07/16
05 12/07/16
05 12/08/16
01 12/10/16
07 12/11/16
07 12/14/16
06 12/15/16
02 12/21/16
05 12/21/16
06 12/22/16
07 12/22/16
08 12/23/16
07 12/23/16
07 12/23/16
07 12/23/16
08 12/24/16
08 12/24/16
07 12/24/16
03 12/26/16
05 12/26/16
07 12/28/16
04 12/29/16
07 01/01/17
06 01/03/17
07 01/03/17
08 01/05/17
05 01/10/17
04 01/17/17
08 01/17/17
07 01/18/17
07 01/18/17
08 01/18/17
08 01/18/17
08 01/18/17
07 01/18/17
04 01/18/17
05 01/18/17
06 01/19/17
10 01/20/17
08 01/21/17
10 01/21/17
09 01/21/17
09 01/21/17
10 01/21/17
07 01/21/17
07 01/21/17
06 02/21/17
09 02/22/17
09 02/22/17
09 02/22/17
07 02/25/17
09 02/26/17
08 02/28/17
07 03/03/17
10 03/03/17
10 03/04/17
09 03/05/17
07 03/10/17
09 03/15/17
09 03/20/17
10 03/22/17
07 03/30/17
09 03/30/17
09 03/31/17
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer: #include <iostream> #include <cstalǐb> #include <string> #include <fstream> using namespace std; string earliestDateelse cout << \t\tTUSCAN GARDEN CUSTOMER RATING REPOR cout <<tRating tlt\tTotal tEarliest Date\ tLatest Date\n\n; while (grl[il] - line. substr (3, 8) if(line . sub str (0,2) 04) 03 Il line . substr (0,2) -= r2 [12] = line . substr (3,8) ; i2++cout << 1-2 {Unacceptable) \t\t << İ1 << \t << endl; cout << 3-4 (Poor)\t\t\t くく 12 << \t くく endl cout << 5-6 (AverOutput: cAUsers Manikandan Documents Visual Studio 20081ProjectstQAA Debug QAA.exe TUSCAN GARDEN CUSTOMER RATING REPORT Ratin

Editable code:

#include <iostream>

#include <cstdlib>

#include <string>

#include <fstream>

using namespace std;

string earliestDate(const string arr[], int noOfElements)

{

     return arr[0];

}

string latestDate(const string arr[], int noOfElements)

{

     return arr[noOfElements - 1];

}

int main()

{

     string r1[30], r2[30], r3[30], r4[30], r5[30];

     int i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0;

     string line;

     ifstream myfile ("input.txt");

     if(myfile.eof())

     {

          cout << "The input file is empty";

     }

     else

     {   

cout << "\t\tTUSCAN GARDEN CUSTOMER RATING REPORT\n\n";

cout << "\tRating\t\t\tTotal\tEarliest Date\tLatest Date\n\n";

     }

    

     while (getline(myfile, line))

     {

if(line.substr(0,2) == "01" || line.substr(0,2) == "02")

          {

              r1[i1] = line.substr(3,8);

              i1++;

          }

if(line.substr(0,2) == "03" || line.substr(0,2) == "04")

          {

              r2[i2] = line.substr(3,8);

              i2++;

          }

if(line.substr(0,2) == "05" || line.substr(0,2) == "06")

          {

              r3[i3] = line.substr(3,8);

              i3++;

          }

if(line.substr(0,2) == "07" || line.substr(0,2) == "08")

          {

              r4[i4] = line.substr(3,8);

              i4++;

          }

if(line.substr(0,2) == "09" || line.substr(0,2) == "10")

          {

              r5[i5] = line.substr(3,8);

              i5++;

          }

     }

     myfile.close();

cout << "1 - 2 (Unacceptable)\t\t" << i1 << "\t" << earliestDate(r1, i1) << "\t" << latestDate(r1, i1) << endl;

cout << "3 - 4 (Poor)\t\t\t" << i2 << "\t" << earliestDate(r2, i2) << "\t" << latestDate(r2, i2) << endl;

cout << "5 - 6 (Average)\t\t\t" << i3 << "\t" << earliestDate(r3, i3) << "\t" << latestDate(r3, i3) << endl;

cout << "7 - 8 (Above average)\t\t" << i4 << "\t" << earliestDate(r4, i4) << "\t" << latestDate(r4, i4) << endl;

cout << "9 - 10 (Very good)\t\t" << i5 << "\t" << earliestDate(r5, i5) << "\t" << latestDate(r5, i5) << endl;

     system("pause");

}

Add a comment
Know the answer?
Add Answer to:
Need help writing a program that meets pseudocode and criteria . Txt File below input.txt file...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT