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

Looping Problem with If/Then/Else A country club dues report is to be prepared.

ID: 3850035 • Letter: L

Question

Looping Problem with If/Then/Else

A country club dues report is to be prepared. Pseudocode only using modules and the auto EOF DOWHILE loop.

Inputs consist of records containing the Country Club member’s name, the type of membership, and the years the member has belonged. The value F in the individual membership type field indicates a family membership. The value I indicates an individual membership. The input data is illustrated below.

                       

           NAME

MEMBERSHIP TYPE

              YEARS

Harvey Hanley

                  F

                   9

Wilma Litt

                  F

                   7

Eugene Mitter

                  F

                   2

Wall Pitt

                  I

                   6

Eunice Ponnir

                  I

                   8

Output is a list of the country club members containing the member’s name, the membership type (FAMILY or INDIVIDUAL), the years the member has belonged, and the country club dues. The dues are calculated as follows: If the member is a family member and has been a member more than six years, the dues are $1,200.00. If the member is a family member and has been a member six years or less, the dues are $1,600.00. If the member is an individual member and has been a member longer than 6 years, the country club dues are $800.00. If the member is an individual member and has been a member 6 years or less, the dues are $1,100.00. After all records have been printed, totals for the number of members, the number of family members, the number of individual members, and the total dues are to be printed.

           NAME

MEMBERSHIP TYPE

              YEARS

Harvey Hanley

                  F

                   9

Wilma Litt

                  F

                   7

Eugene Mitter

                  F

                   2

Wall Pitt

                  I

                   6

Eunice Ponnir

                  I

                   8

Explanation / Answer

The answer is as follows:

The pseudocode is as follows:
  
   count_number_of_members = 0
   count_number_of_family_members = 0
   count_number_of_individual_members = 0
   total_dues = 0
   Do {
       read firstname, lastname, membership type, years belonged
       increment count_number_of_members by 1
       if (membership type== 'F'){
          increment count_number_of_family_members by 1
          if (years belonged > 6)
             dues = 1200.00
          if (years belonged <= 6)
             dues = 1600.00
       }
       if (membership == 'I') {
          increment count_number_of_individual_members by 1
          if (years belonged > 6)
             dues = 800.00
          if (years belonged <= 6)
             dues = 1100.00
       }
       increment total_dues by dues
       print firstname, lastname, membership type, years belonged, dues
   } while not EOF
   print count_number_of_members
   print count_number_of_family_members
   print count_number_of_individual_members
   print total_dues

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