d2jsp
Log InRegister
d2jsp Forums > Off-Topic > General Chat > Homework Help > Help Understanding Assignment > Computer Science
Add Reply New Topic New Poll
Member
Posts: 6,325
Joined: Dec 2 2007
Gold: 2,347.75
Nov 19 2014 12:11pm
The second task is to write and test a Fasto program, named Assign1.fo that:

1. reads from standard input an integer named n, then
2. builds a two dimensional array, named x, with n rows of irregular size in the following way:
for each row, numbered i = 0..n-1, an integer named k is read from the standard input, then
3 is added to each element of the array [0,1,...,k-1] and the result becomes the row i of array x (note that x is 2-dimensional), then

3. builds a 1-dimensional integer array, named y, of length n, in which each element y[i] is the result of summing up the elements belonging to row i of array x, and
4. reads another integer p from standard input, and if 2 < p < n then it prints and returns x[p], else it prints and returns array y.

This is a computer science assignment, but I simply can't understand what he wants us to do. hehe

This post was edited by Utunity on Nov 19 2014 12:12pm
Member
Posts: 6,325
Joined: Dec 2 2007
Gold: 2,347.75
Nov 19 2014 01:02pm
Found out the solution :)
Go Back To Homework Help Topic List
Add Reply New Topic New Poll