logo

Crowdly

Browser

Add to Chrome

Ви берете участь у перевірці коду і помітили проблему в наступному фрагменті псе...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Ви берете участь у перевірці коду і помітили проблему в наступному фрагменті псевдокоду (*** означає коментар).

*** this pseudo-code calculates the average sales per month achieved by an organization ***

0  program SALES

1  month_counter, sales_in_month, total_sales, fileID,: integer

2  average_sales: float

3  begin

4      *** open the sales file***

5      fileID = open file ( “Sales” )

6      If (fileID = 0) then

7          *** File cannot be opened***

8          Display error message 333

9      Else

10         *** get the number of months you want to consider

11         Read (number_of_months)

12         month_counter = 1

13         while month_counter <= number_of_months loop

14             *** get sales for month from sales file using the GetSales function***

15             sales_in_month = GetSales (month_counter, FileID)

16             *** add the sales to the total***

17             total_sales = total_sales + sales_in_month

18             month_counter = month_counter + 1

19         endloop

20         *** calculate the average monthly sales and output that value***

21         average_sales = total_sales / number_of_months

22         Write (average_sales)

23     Endif 

24  end program SALES

Яка з наведених нижче проблем присутня в цьому фрагменті?

More questions like this

Want instant access to all verified answers on vns.lpnu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome