What is the pseudocode for the following question? Building Block Day Care Cente
ID: 3735112 • Letter: W
Question
What is the pseudocode for the following question?
Building Block Day Care Center charges varying weekly rates depending on the age of the
child and the number of days per week the child attends, as shown in Table 8-5. Develop the
logic for a program that continuously accepts child care data and displays the appropriate
weekly rate.
Days Per Week
Age in Years
1
2
3
4
5
0
30.00
60.00
88.00
115.00
140.00
1
26.00
52.00
70.00
96.00
120.00
2
24.00
46.00
67.00
89.00
110.00
3
22.00
40.00
60.00
75.00
88.00
4 or more
20.00
35.00
50.00
66.00
84.00
Days Per Week
Age in Years
1
2
3
4
5
0
30.00
60.00
88.00
115.00
140.00
1
26.00
52.00
70.00
96.00
120.00
2
24.00
46.00
67.00
89.00
110.00
3
22.00
40.00
60.00
75.00
88.00
4 or more
20.00
35.00
50.00
66.00
84.00
Explanation / Answer
Pseudocode that continusly prompt to enter age and number
of days and then find the total cost and then print the total cost.
Main :
Set constant for number of rows and columns
ROWS=4
COLS=5
Set totalCost=0
Declare an array of 2d type and store the values
cost[][]={ {30.00, 60.00 ,88.00, 115.00, 140.00},
{26.00, 52.00, 70.00 ,96.00,120.00},
{24.00,46.00,67.00,89.00,110.00},
{22.00,40.00,60.00,75.00,88.00}
{20.00,35.00,50.00,66.00,84.00}
};
Do
Output "Ask user to enter age "
Read age
Output "Ask user to enter number of days per week "
Read days
Calculate total cost
totalCost=cost[age][days-1]
Output "Cost per days ", totalCost
Output "Do want to continue [y or n ] : "
Read chocie
End While choice <> 'n'
End Main
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.