Hi every body I need to constract a code from this problem
This question is based on Unit 2.
A motor insurance company has surveyed a sample of its clients. The information
on each returned questionnaire includes the following:
o whether the client has had a claim in the last twelve months;
o the age of the client (in whole years at last birthday).
(Each returned questionnaire is referred to as a `return' for short.)
A program is required to analyse this information. A keyboard operator is to input
the data by responding to the following screen prompts.
Has the client claimed in the last 12 months?
Enter Y (for Yes), N (for No) or S (to stop processing):
Age of client?
When all data has been entered, the program is to output three numbers. These
are the total number of returns analysed, the number who have made a claim, and
the number who have made a claim and are under 25. Typical output might be as
Number of returns analysed = 685
Number of claimants = 131
Number of claimants who are under 25 = 79
The program is to be based on the following top-level design.
1 initialise variables
2 loop while there are more returns to be processed
3 process next return
5 write out results
Step 3 will involve reading in the data from the next return - a character value in response to
the first prompt and an integer value in response to the second prompt - and updating counts
accordingly. Note that the client's age is requested for all returns, not just for those where a
claim has been made.
As it is not known in advance how many returns there are going to be, the loop will
have to be controlled by operator input. To indicate the end of input, the sentinel value `S' is
to be entered in response to the first of the screen prompts.
I had attached a librarey so you can add it to the code.
I'm realy in trouble so please help me. :cry: