logo

Crowdly

Browser

Додати до Chrome

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

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

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

*** 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

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

Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на vns.lpnu.ua?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome