The Social Media Language (SML) has the following built-in data types: comment message account picture message The format of functions in SML is as follows: ( , ,  …, ) SML has the following built-in operations: account post   (comment, message, account); account post   (picture, account); account delete (message, account); account delete (picture, account); account find   (comment, account); message search (picture, account); account share  (account, account); SML also has the following built-in conversion functions: comment comment_of (picture); comment about      (account); account friend_of (account); account add_on_of (picture); picture picture_of (comment); The conversion functions convert the value of its parameter, and then returns converted value.  The parameter remains unchanged. Other features of the language are as follows: The language is not case sensitive. Coercion is performed only from comment to picture, and from message to picture; meaning, if the actual data type is either a comment or a message, and the expected data type is a picture, the value of the comment or message is automatically converted to a picture. Static type checking is performed whenever sufficient information has been provided by the programmer to the compiler. Otherwise, type checking is deferred until runtime. Variables do not have to be explicitly declared. Those that are not declared explicitly and start with a letter between I and N (inclusive) have the data type comment (part of the language definition). Any other undeclared variables are typeless; that is, their data type is determined based on the type of the value that was most recently assigned to them. The assignment operator is :=. Both operands of the assignment operator must have the same data type (meaning := , and := returns void. Given the following variable declarations: var  ig : account; meme : picture; primary : comment; arrow : account;   Q1) Question 1 Line 1: result := find(meme, ig);      Line 2: ig := delete(result, ig);         a) Is type checking static or dynamic for Line 1?            b) Will a data type mismatch error occur in Line 1?   c) If your answer in the previous question is YES, rewrite Line 1. If your answer in the previous question is NO, select "NA" Options for C -> 1)result := find(comment_of(me), it 2)result := find(about(me), ig) 3)result := find(friend_of(mine), ig) 4)result := search(comment_of(me), ig)                                                                                                                          5) NA

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Need help in this question with detailed explanation

Info given-

The Social Media Language (SML) has the following built-in data types:

comment
message
account
picture
message

The format of functions in SML is as follows:

<return_type> <function_name> (<parameter1> , <parameter2>,  …, <parameter_n>)

SML has the following built-in operations:

account post   (comment, message, account);
account post   (picture, account);
account delete (message, account);
account delete (picture, account);
account find   (comment, account);
message search (picture, account);
account share  (account, account);

SML also has the following built-in conversion functions:

comment comment_of (picture);
comment about      (account);
account friend_of (account);
account add_on_of (picture);
picture picture_of (comment);

The conversion functions convert the value of its parameter, and then returns converted value.  The parameter remains unchanged.

Other features of the language are as follows:

  • The language is not case sensitive.
  • Coercion is performed only from comment to picture, and from message to picture; meaning, if the actual data type is either a comment or a message, and the expected data type is a picture, the value of the comment or message is automatically converted to a picture.
  • Static type checking is performed whenever sufficient information has been provided by the programmer to the compiler. Otherwise, type checking is deferred until runtime.
  • Variables do not have to be explicitly declared. Those that are not declared explicitly and start with a letter between I and N (inclusive) have the data type comment (part of the language definition). Any other undeclared variables are typeless; that is, their data type is determined based on the type of the value that was most recently assigned to them.
  • The assignment operator is :=. Both operands of the assignment operator must have the same data type (meaning <type> := <type>, and := returns void.

Given the following variable declarations:

var  ig : account;
meme : picture;
primary : comment;
arrow : account;

 

Q1)

Question 1
Line 1: result := find(meme, ig);     
Line 2: ig := delete(result, ig);    

    a) Is type checking static or dynamic for Line 1?       

    b) Will a data type mismatch error occur in Line 1?

  c) If your answer in the previous question is YES, rewrite Line 1. If your answer in the previous question is NO, select "NA"

Options for C ->

1)result := find(comment_of(me), it
2)result := find(about(me), ig)
3)result := find(friend_of(mine), ig)
4)result := search(comment_of(me), ig)                                                                                                                          5) NA

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education