I was assigned a program to write. here are the instructions
Problem Solving and Programming
- Insurance companies are interested in software that will better assist their customers based on the study carried out by the NMTRO. A trial run of the software should be implemented where up to 30 customers may be attended to per day.
You are required to write a pseudocode or draw a flowchart that will accept customer’s information (First Name, Last Name, Gender, Model of car, Category of car, Insurance Company, TOC, whether or not an Antitheft device has been installed, Premium and value of car). Calculate the compensation payment for each customer based on calculation criteria given in Task B of the spreadsheet section.
At the end you are to: a. Calculate the number of vehicles insured Fully Comprehensive b. Find the highest vehicle cost c. Calculate the percentage of owners who installed antitheft mechanism d. Prompt the user for a customer’s name and search for and display the customer’s information including the compensation payment to be made.
- Design and implement a trace table that accepts data for 6 members (same data as the spreadsheet). The table should track the Value of car, TOC, Premium, antitheft installed and insurance payment. The total premium of all customers should be calculated
here is the code `
VAR
First_Name, Last_Name, Model, Insurance_company, stop: array[1..30] of string;
Compensation, V_O_C, P_O_A, A_O_C: array [1..30] of real;
Gender: array [1..30] of char;
T_O_C, Premium, X, Count, CountA, Highest, Category: array [1..30]of integer;
Antitheft_installed: array [1..30] of boolean;
Begin
Count:=0;
CountA:=0;
Highest:=0;
FOR X = 1 to 30 DO
Repeat
Writeln ('Please enter First_Name');
Readln (First_Name[X]);
Writeln ('Please enter Last_Name');
Read Last_ Name [X]
Writeln ('Please enter Gender, M or F');
Readln Gender[X]
Until "stop"
IF Gender<>M and Gender <>F then
Print "You can only enter M or F for Gender"
ENDIF
Repeat
Writeln "Please enter Model"
Read Model[X]
Writeln "Please Enter number corresponding with Category of car"
Writeln "Please Enter 1 for LCR-70"
Writeln "Please Enter 2 for LCR-71"
Writeln "Please Enter 3 for LCR-72"
Writeln "Please Enter 4 for LCR-73"
Read Category[X]
Until "stop"
If category >=5 then
Writeln "Please select one of the options above"
ENDIF
Repeat
Writeln "Please enter 1 if Type Of Coverage is FC"
Writeln "Please enter 2 if Type Of Coverage is TPO"
Read TOC[X]
Until "stop"
IF TOC >=3 Then
Writeln "Only 1 or 2 can be entered here"
ENDIF
Repeat
Writeln "Please enter Antitheft installed Yes or No"
Read Antitheft installed[X]
IF Antitheft = "yes" then
CountA =CountA+1
P_O_A= CountA/Max * 100
ENDIf
Writeln "The percentage is" P_O_A[X]
Writeln "Press 1 for BBC"
Writeln "Press 2 for Nationwide"
Writeln "Press 3 for IWCI"
Writeln "Press 4 for Statefarm"
Read Insurance company[X]
IF Insurance_company =1 then
Writeln "Your premium is $2700"
ENDIF
IF Insurance_company =2 then
Writeln "Your premium is $3500"
ENDIF
IF Insurance_company =3 then
Writeln "Your premium is $1675"
ENDIF
IF Insurance_company =4 then
Writeln "Your premium is $1950"
ENDIF
IF insurance_company>= 5 then
Writeln "Please choose one of the options above"
ENDIF
Read Premium
Writeln "Please enter value of car"
Read V_O_C[X]
While TOC= " FC" Do
Count=Count+1
ENDWhile
Writeln "The total number of vehicles fully comprehensively insured is" Count[X]
IF V_O_C > Highest then
Highest= V_O_C
Writeln "The Highest value of car is", Highest[X]
IF V_O_C <1 and TOC= "FC" then
Compensation= V_O_C * 0.5 Else
IF A_O_C >=2 and A_O_C <=4 and TOC= "FC" then
Compensation= V_O_C * 0.4 Else
IF A_O_C >=5 and A_O_C <=7 and TOC= "FC" then
Compensation= V_O_C * 0.3 Else
IF A_O_C >=8 and A_O_C <=10 and TPO= "FC" then
Compensation= A_O_C * 0.2 Else
IF A_O_C >10 and TOC= "FC" then
Compensation= V_O_C * 0.1 Else
Compensation= V_O_C * 0
Writeln "The Frist name of the customer is" First_Name[X]
Writeln "The Last name of the customer is" Last_Name[X]
Writeln "The customer Gender is" Gender[X]
Writeln "The model of car the customer own is" Model[X]
Writeln "The category of car customer own is" Category[X]
Writeln "The insurance company the customer is with is" Insurance_ Company[X]
Writeln "The type of coverage for customer is" TOC[X]
Writeln "The customer antitheft yes or no" Antitheft_ installed[X]
Writeln "The premium for customer is" Premium[X]
Writeln "The value of car for customer is" V_O_C[X]
Writeln "The customer compensation is" Compensation[X]
Writeln "Enter 11 to add a customer"
end.`
i get these errors
17 / 26 clunis.pas Error: Type mismatch
17 / 27 clunis.pas
Error: Incompatible types: got "Array[1..30] Of LONGINT" expected "LONGINT"
19 / 13 clunis.pas
Fatal: Syntax error, UNTIL expected but identifier LAST_ found