Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I really need help for this assignment. Please give me the answer in good handwriting! Thank you so much PLEASE GIVE ME THE ANSWER THAT

I really need help for this assignment. Please give me the answer in good handwriting!

Thank you so much

PLEASE GIVE ME THE ANSWER THAT I CAN LOAD IT IN HASKELL

image text in transcribed

image text in transcribed

image text in transcribed

THIS IS THE TEMPLATE. PLEASE TAKE A LOOK. EVERYTHING WILL BE LOADED IN HASKELL

image text in transcribed

module CSC207a2 where count The tester program will use the test data to test your implementation. It will run a total of 100 test cases. To see the result, just load the tester into GHCi (or WinGHC) and ask it to show the value of results. If your function is implemented correctly, it should produce the following output: Prelude> :load "CSC207a2Tester.hs" [1 of 3] Compiling CSC207 a2TestData CSC207a2TestData.hs, interpreted) [2 of 3] Compiling CSC207a2 [3 of 3] Compiling CSC207a2Tester CSC207a2Tester.hs, interpreted) Ok, modules loaded: CSC207a2Tester, CSC207a2, CSC207a2TestData. *CSC207a2Tester> results (15.0, [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25, 26,27,28,29,30,31,32,33,34,35,36,37, 38,39,40, 41,42,43,44,45,46,47,48,49,5 0,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69, 70, 71,72,73,74 , 75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95, 96, 97,98 99,100],] CSC207a2.hs, interpreted ) The result contains a tuple of three values. The first (highlighted in green) is a floating-point value representing your score (on a scale of 15 points). The second (highlighted in blue) is a list of all test cases that you passed. The third (highlighted in pink) is a list of all test cases that you failed. If you would like, you can look up the test data from the file csc207a2TestData.hs. This file defines a single list named tests, which consists 100 tuples. Each tuple is a test, and it has three values (i, count, sequence) inside: i: the test id count: the expected result of the test case. * sequence: the list that is the input to the countOdd function. The following is the first few lines in the test data file: module CSC207a2TestData where tests-[1, 32, [8182, 3163, 9095, ..., 2414, 3712, 7571]) 2, 38, [2039, 6773, 4305, ...,6900, 8425, 3829]), 3, 40, [5860, 2836, 2484, ..,6726, 9330, 8307]), 4, 42, [9014, 3254, 7693, .,5775, 4343, 3815]), Notes: 1. Your function must be a recursive function (this is because there is no loop in Haskell) 2. Your program will be tested with similar but different data. The testing results will earn you up to 15 points (out of 20 points total) 3. The remaining 5 points will be awarded based on the structure, readability, and documentation of your implementation. Documentation should be in the form of Haskell 4. You cannot have any import statement in your program. And you can only use functions 5. The Prelude function odd (signature: odd : : Integral a => a-> Bool can be 6. There can be only one single function (the countodd function) defined in the comments, which start with --" and extend until the end of the line. in the Prelude module. use to test whether an integer is odd or not) "csc207a2.hs" file. No other helper function(s) is/are allowed. CSC207a2.hs module CSC207a2 where countOdd :: [Integer ->Integer countOdd xs =-1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming Languages 12th International Symposium Dbpl 2009 Lyon France August 2009 Proceedings Lncs 5708

Authors: Philippa Gardner ,Floris Geerts

2009th Edition

3642037925, 978-3642037924

More Books

Students also viewed these Databases questions

Question

5. How would you describe your typical day at work?

Answered: 1 week ago

Question

7. What qualities do you see as necessary for your line of work?

Answered: 1 week ago