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

Step 1: Enter A Step 2: Enter B Step 3: Enter C Step 4: Enter D Step 5: Enter E

ID: 3632907 • Letter: S

Question

Step 1: Enter A
Step 2: Enter B
Step 3: Enter C
Step 4: Enter D
Step 5: Enter E
Step 6: If A < Lowest
Step 7: Lowest=A
Step 8: If B < Lowest
Step 9: Lowest =B
Step 10: If C < Lowest
Step 11: Lowest = C
Step 12: If D < Lowest
Step 13: Lowest = D
Step 14: If E < Lowest
Step 15: Lowest = E
Step 16: Display Lowest
Step 17: If A > Highest
Step 18: Highest = A
Step 19: If B > Highest
Step 20: Highest = B
Step 21: If C > Highest
Step 22: Highest = C
Step 23: If D > Highest
Step 24: Highest = D
Step 25: If E > E
Step 26: Highest = E
Step 27: Display Highest
Step 28: Find sum (A+B+C+D+E)
Step 29: Divide sum by 5
Step 30: Display Average
Step 31: STOP

Explanation / Answer

Algorithm 1:
#include <iostream>
using namespace std;
int main()
{
    int A, Q, D, N, P;
    cout << "Enter A: ";
    cin >> A;
    if(A > 0 && A < 99)
    {
      Q = A / 25;
      A = A % 25;
      D = A / 10;
      A = A % 10;
      N = A / 5;
      A = A % 5;
      P=A;
      cout<<"Q = "<<Q<<", D = "<<D<<", N = "<<N<<", P = "<<P<<endl;
    }   
    else
    {
        cout<<"Invalid Input";
    }
    return 0;
}

Algorithm 2:
#include <iostream>
using namespace std;
int main()
{
   int A,B,C,D,E, Lowest=0, Highest=0;

   cout<<"Enter A"<<endl;
   cin>>A;
   cout<<"Enter B"<<endl;
   cin>>B;
   cout<<"Enter C"<<endl;
   cin>>C;
   cout<<"Enter D"<<endl;
   cin>>D;
   cout<<"Enter E"<<endl;
   cin>>E;
   Lowest = A;
   if (A < Lowest)
       Lowest = A;
   if (B < Lowest)
       Lowest = B;
   if (C < Lowest)
       Lowest = C;
   if (D < Lowest)
       Lowest = D;
   if (E < Lowest)
       Lowest = E;

   cout<<"Lowest is : "<<Lowest<<endl;

   if (A > Highest)
       Highest = A;
   if (B > Highest)
       Highest = B;
   if (C > Highest)
       Highest = C;
   if (D > Highest)
       Highest = D;
   if (E > Highest)
       Highest = E;

   cout<<"Highest is : "<<Highest<<endl;

   int sum = 0;
   sum = A+B+C+D+E;
   sum = sum/5;
   cout<<"Average is : "<<sum<<endl;
   return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote