CS 31 Homework Assignment 2 SOLUTION

$30.00 $24.00

Short-Circuit Evaluation in Dart, Javascript, PHP, Python, and Rust Solution A short-circuit evaluation of an expression is one in which the result is determined without evaluating all of the operands and/or operators. In this homework assignment, you will compare the behavior of Short-Circuit Evaluation in five different programming languages: Dart, Javascript, PHP, Python, and Rust.…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Description

5/5 – (2 votes)

Short-Circuit Evaluation in Dart, Javascript, PHP, Python, and Rust Solution

A short-circuit evaluation of an expression is one in which the result is determined without evaluating all of the operands and/or operators.

In this homework assignment, you will compare the behavior of Short-Circuit Evaluation in five different programming languages: Dart, Javascript, PHP, Python, and Rust. You will investigate how the following design issues are addressed in these programming languages:

1. How are the boolean values represented?

2. What operators are short-circuited?

3. How are the results of short-circuited operators computed? (Consider also function calls)

4. What are the advantages about short-circuit evaluation?

5. What are the potential problems about short-circuit evaluation?

For each design issue and for each language, explain the answer clearly by giving examples using code segments in these languages. You can illustrate the answers to these questions, in different parts of a single program. The example program must be complete. It should compile and execute on the

dijkstra.cs.bilkent.edu.tr machine.

Finally,

1. Write a paragraph discussing, in your opinion, which language is the best for short-circuit evaluation considering advantages and disadvantages. Explain why. (approx. 200 words, 5 points)
2. Write a separate section about your learning strategy in doing this homework assignment. A learning strategy is an individual’s approach to complete a task. In this section, discuss, in detail, the material and tools you used, experiments you performed. Also talk about personal communication, if you had. (approx. 500 words, 10 points)

Submission:

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

1. A single file for Dart code: lastname_name_dart.dart

2. A single file for Javascript code: lastname_name_javascript.html

3. A single file for PHP code:lastname_name_php.php

4. A single file for Python code: lastname_name_python.py

5. A single file for Rust code: lastname_name_rust.rs

6. A single file for report: lastname_name_report.pdf

Your report should contain clear answers to each question for each language, corresponding example code segments and answers to additional questions.

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

Important Notes:

Late submissions will be accepted, with 10 points (out of 100) deduction for each extra day.

You may use the tutorials available in the Internet as a reference, but do not derive your example from the contents of the tutorials. If you do so, your programs may be similar to others in the class, that causes a disciplinary investigation. Collaboration on the homework is not allowed.

Suggestion:

Do not postpone the execution of your programs to the last minute! The dijkstra machine might be overloaded, then.

CS 31 Homework Assignment 2 SOLUTION
$30.00 $24.00