[SOLVED] CS代考计算机代写 sub check_alarm {

30 $

File Name: CS代考计算机代写_sub_check_alarm_{.zip
File Size: 386.22 KB

SKU: 1065147504 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


sub check_alarm {
my ($iterations) = @_;
our ($test);

@output = read_text_file (“$test.output”);
common_checks (“run”, @output);

my (@products);
for (my ($i) = 0; $i < $iterations; $i++) {for (my ($t) = 0; $t < 5; $t++) {push (@products, ($i + 1) * ($t + 1) * 10);}}@products = sort {$a <=> $b} @products;

local ($_);
foreach (@output) {
fail $_ if /out of order/i;

my ($p) = /product=(d+)$/;
next if !defined $p;

my ($q) = shift (@products);
fail “Too many wakeups.
” if !defined $q;
fail “Out of order wakeups ($p vs. $q).
” if $p != $q; # FIXME
}
fail scalar (@products) . ” fewer wakeups than expected.

if @products != 0;
pass;
}

1;

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS代考计算机代写 sub check_alarm {
30 $