CS341 - Programming Languages Assignment

Download Solution Order New Solution

Assignment Task

Programming environments for F# 

The quickest way to get started is using replit.com: there is a project setup for this homework named Homework 04 which is configured with F# and starter code. Alternatively, you can install Visual Studio Community Edition for Windows or Mac, both offer F#; create a new F# Console project to start programming. If you decide to work outside replit.com, be sure to download the starter code of “main.fs”

Homework Exercise

The exercise is to input a string from the user, and then output the following information:

  • Length of string (# of characters, including spaces and punctuation)
  • # of vowels in the string (a, e, i, o, u)
  • # of each vowel
  • # of digraphs in the string (ai, ch, ea, ie, ou, ph, sh, th, wh)
  • # of each digraph

For simplicity, only count lower-case vowels and digraphs. To help you get started, we are providing a starter code that inputs a string from the user and calls a few functions that currently return 0:

When your program is complete, here’s an example of how it should behave given the input: "shush!" said the person on the train as i used my phone.

The most natural way to solve this problem in a functional language is to convert the input string to a list of characters, and then work with the resulting list. Two functions are provided for converting strings: explode s takes a string and returns a list of characters, and implode L takes a list of characters and returns a string.

This CS341 IT and Computer Science has been solved by our PHD Experts at My Uni Paper.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.