100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CIS 505 Exam 1 Notes Study Guide |Complete Questions with 100% Correct Answers $10.99   Add to cart

Exam (elaborations)

CIS 505 Exam 1 Notes Study Guide |Complete Questions with 100% Correct Answers

 2 views  0 purchase
  • Course
  • Institution

CIS 505 Exam 1 Notes Study Guide |Complete Questions with 100% Correct Answers How do signify a real in SML? 12.0, 3e~2, 3,14e12 How do you signify a character in SML? #"x", #"A", #n" How do you concatenate two strings in SML? Using the ^ operator i.e. "abra" ^ "cadabra" = "abracadabra" W...

[Show more]

Preview 2 out of 5  pages

  • March 27, 2024
  • 5
  • 2023/2024
  • Exam (elaborations)
  • Questions & answers
avatar-seller
CIS 505 Exam 1 Notes Study Guide |Complete Questions
with 100% Correct Answers
How do signify a real in SML?

12.0, 3e~2, 3,14e12

How do you signify a character in SML?

#"x", #"A", #\n"

How do you concatenate two strings in SML?

Using the ^ operator

i.e. "abra" ^ "cadabra" = "abracadabra"

What operators can you not use on reals?

=, <>

Can < and > be used on strings?

Yes, and it means lexicographically precedes. It returns a bool

i.e. "a" < "b", "abc" < "acb"

What are the 3 boolean operators?

not, andalso, orelse

SML has what two types of typing?

Static and Strong

How to cast as a real in SML?

real(11) = 11.0

How to round down, round up, round generally, and truncate?

floor(5.4) = 5
ceiling(5.4) = 6
round(5.5) = 6
trunc(~5.4) = ~5

How to go from character to int? Vice-versa?

ord(#"0") = 48
chr(48) = #"0"

What is a tuple?

, A fixed-size ordered collection of two or more values. Always same length, sometimes different types

Ex: (1, "a", true)
(4, (1,"a",true))

What is a list?

A list is a list of all the same type. Always same type, sometimes different length

What are the return types of these list operations?

Empty List []
Head hd
Tail tl
Append @
cons ::

'a list
'a list→'a
'a list→'a list
'a list*'a list→'a list
'a*'a list→'a list

What do explode and implode to?

Explode takes a string and converts it into a list of characters

Implode takes a list of characters and makes it a string

Fill in the blanks:

SML is a(n) __________________-based (________________) language with ___________,
____________ typing

SML is an expression-based(functional) language with strong, static typing.

Write a basic function that takes in a number and adds one

fun inc(x) = x+1;

What does tl return?

All the elements of the list except the first one

Write a function that uses the a function and a number as its parameters. It is supposed to add the
number and one to the function

fun do_fun(f,x) = f(x) + x + 1;

val a = 2;
val a = 2 : int

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller LectAziim. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $10.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

77254 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$10.99
  • (0)
  Add to cart