CS 315
Homework Assignment 1


Assigned:  November 25, 2024
Due:  December 2, 2024, 23:55

List data type in Dart, Go, JavaScript, Kotlin, Python, Ruby, and Rust

In computer science, a list or sequence is an abstract data type that represents a finite number of ordered values, where the same value may occur more than once. Lists were first supported in the first functional programming language, Lisp. In recent years, many programming languages provide support for list data types and have special syntax and semantics for lists and list operations.

In programming tasks, you may end up maintaining a list of objects. In this homework assignment, assume that you have to maintain a list of strings; e.g., names of people, cities, etc, in seven different programming languages. The programming languages are Dart, Go (Golang), JavaScript, Kotlin, Python, Ruby, and Rust. You will investigate how the following operations can be done in these programming languages:

  1. Declare/create an empty list
  2. Initialize a list with some values
  3. Check if the list is empty or not
  4. Add a new element to a list
  5. Check if a particular element exists in the list
  6. Remove a particular element from the list
  7. Get the head and the tail of a list
  8. Print all of the elements in the list

You can use online compilers/interpreters for this homework.

For each language, prepare a single source code file that exemplifies and tests each operation, in the order given above. Your example programs must be different from the example codes that may be available on the Internet. Be careful to avoid plagiarism!

Organize all of your experiments and their results and put them into a report. The report should include Parts A, B, and C, as explained below:

Part A - Operations in each language (45 points)

For each language and each operation, give the sample code segments and the results of their execution. You should explain what your example does, and the output, if generated.

Part B - Evaluation (10 points)

Your evaluation of these languages in terms of readability and writability of list operations. Discuss, in your opinion, which language is the best for list operations.

Part C - Learning strategy (10 points)

A learning strategy is an individual's approach to completing a task. In this section, discuss, in detail, the material and tools you used, and the experiments you performed. Also talk about personal communication, if you had. Give the URLs of the online compiler/interpreters you used to run your programs

Part D- Sample Codes (35 points)

The sample code files must compile and run without any errors.

Submission:

A single zip or rar file should be submitted containing the following files with given names:

  1. A single file for the Report, containing parts A, B, and C: ID_lastname_name_report.pdf (65 Points)
  2. A folder called, Codes, for Part D. The contents of the folder will be as follows:
    1. A single file for Dart code: ID_lastname_name.dart (5 points)
    2. A single file for Go code: ID_lastname_name.go (5 points)
    3. A single file for JavaScript code: ID_lastname_name.html (5 points)
    4. A single file for Kotlin code: ID_lastname_name.kt (5 points)
    5. A single file for Python code: ID_lastname_name.py (5 points)
    6. A single file for Ruby code: ID_lastname_name.rb (5 points)
    7. A single file for Rust code: ID_lastname_name.rs (5 points)

Please upload the zip or rar file you created to Moodle before the due date.

Important Notes: