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

write a pseudocode for a program that continuously accepts dogs\' data until a s

ID: 3637668 • Letter: W

Question

write a pseudocode for a program that continuously accepts dogs' data until a sentinel value is entered, and displays billing data for each dog.

Explanation / Answer

Design a Pseudocode and Flowchart for the following:

a. A program that accepts insurance policy holder data including a policy number, customer last name, customer first name, age, premium due month, day and year, and the number of accidents in which the driver has been involved in the last three years. If a policy number entered 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 or the day is not correct for the month (that is, between 1 and 31 for January, 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 a policy holder’s 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 a policy holder’s data and displays the data for any policy holder who is at least 21 years old.

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

e. A program that accepts a policy holder’s 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 a policy holder’s data and displays the data for any policy holder whose premium is due up to and including January 1, 2012.

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

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

This maybe how they want it done? Example from a simular problem.

4. The Summerville Telephone Company charges 10 cents per minute for all calls outside the customer’s area code that last over 20 minutes. All other calls are 13 cents per minute. Design a flowchart or pseudocode for following:

a. A program that accepts data about one phone call: customer area code (three digits), customer phone number (seven digits), called area code (three digits), called number (seven digits), and call time in minutes (four digits). Display the calling number, called number, and price for the call.

Exercises

1

2. Chocolate Delights Candy Company manufactures several types of candy. Design a flowchart or pseudocode for the following:

a. A program that accepts a candy name (for example, "chocolate-covered blueberries"), price per pound, and number of pounds sold in the average month, and displays the item's data only if it is a best-selling item. Best-selling items are those that sell more than 2,000 pounds per month.

Answer: A sample solution is as follows:

a. Flowchart:

Pseudocode:

start

string name

num pricePerPound

num poundsSold

num POUNDS_MIN = 2000

get name, pricePerPound, poundsSold

if poundsSold > POUNDS_MIN then

print name, pricePerPound, poundsSold

endif

stop


b. A program that accepts candy data continuously until eof and produces a report that lists high-priced, best-selling items. Best-selling items are those that sell more than 2,000 pounds per month. High-priced items are those that sell for $10 per pound or more.

Answer: A sample solution is as follows:

b. Flowchart:

Pseudocode:

start

string name

num pricePerPound

num poundsSold

num POUNDS_MIN = 2000

num PRICE_MIN = 10

get name, pricePerPound, poundsSold

while not eof

if pricePerPound >= PRICE_MIN then

if poundsSold > POUNDS_MIN

print name, pricePerPound, poundsSold

endif

endif

get name, pricePerPound, poundsSold

endwhile

stop

3. Pastoral College is a small college in the Midwest. Design a flowchart or pseudocode for following:

a. A program that accepts a student's data: an ID number, first and last name, major field of study, and grade point average. Display a student's data if the student's grade point average is below 2.0.

Answer: A sample solution is as follows:

a. Flowchart:

Pseudocode:

start

num idNumber

num gpa

string firstName

string lastName

string major

num MAX_GPA = 2.0

get idNumber, firstName, lastName, major, gpa

if gpa TIME_LIMIT then

price = minutes * LOW_RATE

else

price = minutes * HIGH_RATE

endif

print custAreaCode, custPhoneNum, calledAreaCode, calledPhoneNum, price

stop


b. A program that accepts data about a phone call and displays all the details only about a call that costs over $10.

Answer: A sample solution is as follows:

b. Flowchart:

Pseudocode:

start

num custAreaCode

num custPhoneNum

num calledAreaCode

num calledPhoneNum

num minutes

num price

num LOW_RATE = 0.10

num HIGH_RATE = 0.13

num TIME_LIMIT = 20

get custAreaCode, custPhoneNum, calledAreaCode, calledPhoneNum, minutes

if custAreaCode not equal to calledAreaCode AND

minutes > TIME_LIMIT then

price = minutes * LOW_RATE

else

price = minutes * HIGH_RATE

endif

if price > 10 then

print custAreaCode, custPhoneNum, calledAreaCode, calledPhoneNum, price

endif

stop


c. A program that continuously accepts data about phone calls until eof is reached and displays details only about calls placed from the 212 area code to the 704 area code that last over 20 minutes.

Answer: A sample solution is as follows:

c. Flowchart:

Pseudocode:

start

num custAreaCode

num custPhoneNum

num calledAreaCode

num calledPhoneNum

num minutes

num price

num LOW_RATE = 0.10

num HIGH_RATE = 0.13

num TIME_LIMIT = 20

get custAreaCode, custPhoneNum, calledAreaCode, calledPhoneNum, minutes

while not eof

if custAreaCode = 212 AND calledAreaCode = 704 AND

minutes > TIME_LIMIT then

price = minutes * LOW_RATE

print custAreaCode, custPhoneNum, calledAreaCode, calledPhoneNum, price

endif

get custAreaCode, custPhoneNum, calledAreaCode, calledPhoneNum, minutes

endwhile

stop


d. A program that prompts the user for a three-digit area code. Then the program continuously accepts phone call data until eof is reached, and displays data for any phone call to or from the specified area code.

Answer: A sample solution is as follows:

d. Flowchart:

Pseudocode:

start

num givenAreaCode

num custAreaCode

num custPhoneNum

num calledAreaCode

num calledPhoneNum

num minutes

num price

num LOW_RATE = 0.10

num HIGH_RATE = 0.13

num TIME_LIMIT = 20

get givenAreaCode

get custAreaCode, custPhoneNum, calledAreaCode, calledPhoneNum, minutes

while not eof

if custAreaCode = givenAreaCode OR

calledAreaCode = givenAreaCode then

if custAreaCode not equal to calledAreaCode AND

minutes > TIME_LIMIT then

price = minutes * LOW_RATE

else

price = minutes * HIGH_RATE

endif

print custAreaCode, custPhoneNum, calledAreaCode, calledPhoneNum, price

endif

get custAreaCode, custPhoneNum, calledAreaCode, calledPhoneNum, minutes

endwhile

stop

Optional Information: Computer OS: Windows 7 Browser: IE Programming Language: Basic for Java Compiler: none Already Tried: I'm taking a basic programming class and i think it is trying teach us the basics for preperation for Java. I'm not sure what I'm doing and I have supplied some examples of what they are looking for as an answer to the Insurance company question. I think your company has solved this before for someone else. Exercises 1. Assume that the following variables contain the values shown: numberRed = 100 numberBlue = 200 numberGreen = 300 wordRed =