Answered You can hire a professional tutor to get the answer.

QUESTION

Write a script that will prompt the user for N integers, and then write (save) the positive numbers (= 0) to a file called positive.dat and the...

Write a script that will prompt the user for N integers, and then write (save) the positive numbers (>= 0) to a file called positive.dat and the negative numbers to a file called negative.dat. Error-check to make sure that the user enters N integers.

Hint: for Error-check, we can use the following code (See lecture note 10)num = input('Enter an integer: ');num2 = int32(num);while num2 ~= num num = input('Invalid! Enter an integer: '); num2 = int32(num);end

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question