The Drive Rite Insurance Company provides automobile insurance policies for

The drive rite insurance company provides automobile

This preview shows page 38 - 43 out of 96 pages.

7.The Drive-Rite Insurance Company provides automobile insurance policies for drivers. Design a flowchart or pseudocode for following:a. A program that accepts insurance policy data, including a policy number, customer last name, customer first name, age, premium due date (month, day, and year), and number of driver accidents in the last three years. If an entered policy number is not between 1000 and 9999 inclusive, set the policy number to 0. If the month is not between 1 and 12 inclusive, or the day is not correct for the month (for example, not between 1 and 31 for January or 1 and 29 for February), set the month, day, and year to 0. Display the policy data after any revisions have been made.
Programming Logic and Design, 8e Solutions 4-39 Pseudocode: start Declarations
Programming Logic and Design, 8e b. A program that continuously accepts policy holders’ data until a sentinel value hasbeen entered, and displays the data for any policy holder over 35 years old.
Programming Logic and Design, 8e Solutions 4-41 Pseudocode: start Declarations num policyNumber num age num dueMonth num dueDay num dueYear num accidents string lastName string firstName
Programming Logic and Design, 8e Solutions 4-42 housekeeping() while not eof detailLoop() endwhile finish() stop housekeeping() output “Insurance program” input policyNumber, lastName, firstName, age, dueMonth, dueDay, dueYear, accidents return detailLoop() if age > 35 then validateData() output policyNumber, lastName, firstName, age, dueMonth, dueDay, dueYear, accidents endif input policyNumber, lastName, firstName, age, dueMonth, dueDay, dueYear, accidents return validateData() if policyNumber < 1000 OR policyNumber > 9999 then policyNumber = 0 endif if dueMonth < 1 OR dueMonth > 12 OR dueDay < 1 OR dueDay > 31 then dueMonth = 0 dueDay = 0 dueYear = 0 else if (dueMonth = 2 AND dueDay > 29) OR ((dueMonth = 4 OR dueMonth = 6 OR dueMonth = 9 OR dueMonth = 11) AND dueDay > 30) then dueMonth = 0 dueDay = 0 dueYear = 0 endif endif return finish() output “End of program” return

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture