Question: can you solve this? (a) Assume given a program with the following definitions: main=doxfunifxfun=doputStrinInput:thenputStrLnGoodbye,andstgetLineelsemainreturn(lengths>5) Give a possible console dialog between progrum and user (after calling

 can you solve this? (a) Assume given a program with the

can you solve this?

(a) Assume given a program with the following definitions: main=doxfunifxfun=doputStrin"Input:"thenputStrLn"Goodbye,"andstgetLineelsemainreturn(lengths>5) Give a possible console dialog between progrum and user (after calling main in the interpreter). for which each of the seven definition lines is executed at least once. (b) Write a program which first reads a positive integer n from the console, and then reads n integers one after the other and finally outputs their sum. Your program should prompt appropriately for its inputs (indicating which number of summand is to be input next), as well as explain its final output. Beside the functions already occurring above, a few other reminders: putStr :: String 10(0, readLn :10 Int, print : Int 100, show : Int String If you want to use further 10-related functions, like while, you have to define them yourself here

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!