Closed

write a programme in haskell.....

Your task is to write a program in Haskell for a lecturer ratings website that lets students add lecturers, give lecturers ratings between 0 and 10, and display the details of various lecturers. The site maintains a “database” (a textfile) of many lecturers; each record of which gives a lecturer’s staffID, the name, the year of join, and a list of students’ ratings. The average of the students’ ratings for a lecturer gives the lecturer’s website rating. If a lecturer has been added to the website but is yet to be rated by anyone then its website rating is 0. You should begin by developing purely functional code to cover the core functionality, and then add to this the functions/actions that will comprise the program’s user interface. You may assume that no two lecturers have the same studentID – i.e. any lecturer can be uniquely identified by its staffID.

Core functionality

The program should include pure (non-I/O) functions that perform the following:

(i) add a new lecturer to the database (ii) show all lecturers in the database (iii) give all lecturers joining in a certain year (iv) give all lecturers that have a website rating of 7 or higher (v) give the average website rating for the lecturers joining on a certain year (vi) give the names of the lecturers a given student has rated, along with that student’s ratings (vii) allow a given student to rate (or re-rate) a lecturer (note that only the latest rating from the user should remain recorded) (viii) give all the lecturers joined between two given years (inclusive), sorted in descending order of website rating

Note that for functions (ii), (iii), (iv) and (viii), the well-formatted string-valued results should include each lecturer’s staffID, name, year of join and website rating. The website rating of a lecturer should be given to two decimal places. Use the printf function from the [login to view URL] module to achieve nice formatting of floating-point numbers (e.g., printf "%3.2f" 2.1234 is "2.12"). I recommend that you attempt the above

items in order – the first few should be easier than those at the end. If you can’t complete all eight items of functionality, try to ensure that those parts that you have attempted are correct and as well-written as possible. Ensure also that every segment of code you write is appropriately documented. Hints. Begin by copying and renaming the [login to view URL] file from Moodle; your code should be developed within this file. Your first task will be to decide on a data representation Lecturer for individual lecturer. The database of films can then be of type [Lecturer]. Now, for example, the functions to perform items (i) and (ii) above might have the types:

addLecturer :: String -> String -> Int -> [Lecturer] -> [Lecturer]

lecturersAsString :: [Lecturer] -> String

where addLecturer staffID name year database returns a modified version of database with a new lecturer (with the given staffID, name and year, and with no ratings) added, and lecturerAsString database gives a string which, when output using putStrLn, is nicely formatted and multi-line. You may find it useful to define a few additional “helper” functions to aid in the writing of the program. You may also find functions in the [login to view URL] and [login to view URL] modules useful. Test data. There is a file [login to view URL] containing test data on Moodle. You should copy and edit this data so that it is a valid value of type [Lecturer] given your particular Lecturer type definition. Include this data in your program file as follows:

testDatabase :: [Lecturer]

testDatabase = [ ... the test data ... ]

Evner: Java, PHP, Python

Se mere: use perl add text pdf, php arced text function, use word wrap text field java, haskell tutorial, how to run haskell on mac, install haskell, haskell hello world, haskell main, haskell interpreter, haskell script, haskell program example, haskell, use xml uploading text, vb6 use dts import text file sql server, sort programme facebook use, use programming read text files view, use texthtml modify text flash site, use stl word count function, text function flash, write programme store single matrix file write mode

Om arbejdsgiveren:
( 0 bedømmelser ) Singapore, Singapore

Projekt ID: #17430467

7 freelancere byder i gennemsnit $393 på dette job

$155 SGD in 3 dage
(25 bedømmelser)
5.3
KGeorgy

Having the required skills, we will be glad to help you. Relevant Skills and Experience We have some questions regarding your project, so please find me to discuss everything in more detail. Proposed Milestones $1000 Flere

$1000 SGD in 3 dage
(26 bedømmelser)
4.9
naryl

Hello. It's not quite clear if you want a website or just a library with functions. If it's the latter then I can do it in Haskell in four days at most. The requirements are clear and I can start working immediately. P Flere

$250 SGD in 4 dage
(10 bedømmelser)
3.7
yuriecojocari

ready to learn this beautiful language and apply knowledge to help you to build it. right now I do know only a few bits what is Haskell. I really would appreciate the chance of learning this and doing this project

$888 SGD in 4 dage
(3 bedømmelser)
2.0
m1710d

Hello.. i made you an offer. I'll do it in 3 days for only $120 and $13.33 for Freelancer. You can also ask me to do it in 2 days for $150 and $16.67 for Freelance or 1 day for 200$ and $22.22 for Freelancer. if yo Flere

$134 SGD in 3 dage
(0 bedømmelser)
0.0
vitomireanuioana

I am a computer science student. We studied functional programming languages as Haskell, [login to view URL] and Prolog and I strongly believe I can do your request

$155 SGD in 10 dage
(0 bedømmelser)
0.0
LambdaConcept

Strong skills in Haskell development I will be able to provide a nice code clearly autodocument. Your need seems clear so I can start as early as you accept the project and the milestone

$166 SGD in 5 dage
(0 bedømmelser)
0.0