expand icon
book Programming Logic and Design, Introductory 7th Edition by Joyce Farrell cover

Programming Logic and Design, Introductory 7th Edition by Joyce Farrell

Edition 7ISBN: 1285225562
book Programming Logic and Design, Introductory 7th Edition by Joyce Farrell cover

Programming Logic and Design, Introductory 7th Edition by Joyce Farrell

Edition 7ISBN: 1285225562
Exercise 9

The Drive-Rite Insurance Company provides automobile insurance policies for drivers. Design a flowchart or pseudocode for the 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.

b. A program that continuously accepts policy holders’ data until a sentinel value has been entered, and displays the data for any policy holder over 35 years old.

c. A program that accepts policy holders’ data and displays the data for any policy holder who is at least 21 years old.

d. A program that accepts policy holders’ data and displays the data for any policy holder no more than 30 years old.

e. A program that accepts policy holders’ data and displays the data for any policy holder whose premium is due no later than March 15 any year.

f. A program that accepts policy holders’ data and displays the data for any policy holder whose premium is due up to and including January 1, 2014.

g. A program that accepts policy holders’ data and displays the data for any policy holder whose premium is due by April 27, 2013.

h. A program that accepts policy holders’ data and displays the data for anyone who has a policy number between 1000 and 4000 inclusive, whose policy comes due in April or May of any year, and who has had fewer than three accidents.

Step-by-step solution
Verified
like image
like image

Step 1 of 59

a)

Pseudo code:

The following is the required pseudo code to read the insurance policy data such as policy number, customer last name, first name, age, premium due date and number of driver accidents in the last three years. It displays the data after validating the policy number and date.

start

Declarations

num policyNumber

string customerLastName

string customerFirstName

num age

num dueMonth

num dueDay

num dueYear

num accidentsNumber

num tmpMonth

readData()

displayData()

stop


Step 2 of 59


Step 3 of 59


Step 4 of 59


Step 5 of 59


Step 6 of 59


Step 7 of 59


Step 8 of 59


Step 9 of 59


Step 10 of 59


Step 11 of 59


Step 12 of 59


Step 13 of 59


Step 14 of 59


Step 15 of 59


Step 16 of 59


Step 17 of 59


Step 18 of 59


Step 19 of 59


Step 20 of 59


Step 21 of 59


Step 22 of 59


Step 23 of 59


Step 24 of 59


Step 25 of 59


Step 26 of 59


Step 27 of 59


Step 28 of 59


Step 29 of 59


Step 30 of 59


Step 31 of 59


Step 32 of 59


Step 33 of 59


Step 34 of 59


Step 35 of 59


Step 36 of 59


Step 37 of 59


Step 38 of 59


Step 39 of 59


Step 40 of 59


Step 41 of 59


Step 42 of 59


Step 43 of 59


Step 44 of 59


Step 45 of 59


Step 46 of 59


Step 47 of 59


Step 48 of 59


Step 49 of 59


Step 50 of 59


Step 51 of 59


Step 52 of 59


Step 53 of 59


Step 54 of 59


Step 55 of 59


Step 56 of 59


Step 57 of 59


Step 58 of 59


Step 59 of 59

close menu
Programming Logic and Design, Introductory 7th Edition by Joyce Farrell
cross icon