Question

Problem 2. (2 pts) How do type declaration statements for simple variables affect the readability of...

Problem 2. (2 pts) How do type declaration statements for simple variables affect the readability of a language, considering that some languages do not require them?

Problem 3. (2 pts) Many contemporary languages allow two kinds of comments: one in which delimiters are used on both ends (multiple-line comments), and one in which a delimiter marks only the beginning of the comment (one line comments). Discuss the advantages and disadvantages of each.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Ans2. One key element in coding in any programming language is it's readability. Apart from adding comments to codes, another way to greatly enhance readability is by effective type declaration that are paramount in many programming languages such as Java, C, C++ and the likes. Type declaration allows for easy identification of data types and to differentiate between them. Not only does this enhance readability, it does also enhance optimal code-understandability.

The use of type declaration statements for simple scalar variables may have very little effect on the readability of programs. If a language has no type declarations at all, it may be an aid to readability, because regardless of where a variable is seen in the program text, its type can be determined without looking elsewhere. Unfortunately, most languages that allow implicitly declared variables also include explicit declarations. In a program in such a language, the declaration of a variable must be found before the reader can determine the type of that variable when it is used in the program.

Ans3. Multiple line comments:-

The main disadvantage of using paired delimiters for comments is that it results in diminished reliability. It is easy to inadvertently leave off the final delimiter, which extends the comment to the end of the next comment, effectively removing code from the program. The advantage of paired delimiters is that you can comment out areas of a program.

One line comments:-

The disadvantage of using only beginning delimiters is that they must be repeated on every line of a block of comments. This can be tedious and therefore errorprone. The advantage is that you cannot make the mistake of forgetting the closing delimiter.

Add a comment
Know the answer?
Add Answer to:
Problem 2. (2 pts) How do type declaration statements for simple variables affect the readability of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. Why should programmers think differently? (1.5 pts) 2. How do you think a programming language...

    1. Why should programmers think differently? (1.5 pts) 2. How do you think a programming language does or should affect the way we think about solving problems? (1.5 pts) 3. Pick another student's discussion post/thread and respond with a constructive comment such as to why you agree, disagree, or have additional information. (For example, the first student states that variables are interchangeable and should be terse (e.g. x) in Python but you respond that terse variable names can be problematic...

  • Question 1 2 pts The preprocessor executes after the compiler. False True Question 2 2 pts...

    Question 1 2 pts The preprocessor executes after the compiler. False True Question 2 2 pts What code is human-readable and follows the standards of a programming language? Secret code Source code Key code None of these Machine code Question 3 2 pts What is the symbol that marks the beginning of a one line comment? Question 1 2 pts The preprocessor executes after the compiler. True False Question 5 2 pts A statement that may be used to stop...

  • How can you solve this problem using if statements? CSCI 206 Lab Date: 27 March 2020...

    How can you solve this problem using if statements? CSCI 206 Lab Date: 27 March 2020 Lab 8 - Coffee Switches Due: 2 April 2020 Please submit your lab on Moodle. Since we are not meeting Friday, March 27, you must fill out your attendance assignment in your lecture section on Moodle. There is now a new category called Friday Attendance. Please go there and do the attendance assignment to be marked for attendance. Notes: . Carefully read and adhere...

  • Coding for Python - The pattern detection problem – part 2: def calculate_similarity_list(data_series, pattern) Please do not use 'print' or 'input' statements. Context of the assignme...

    Coding for Python - The pattern detection problem – part 2: def calculate_similarity_list(data_series, pattern) Please do not use 'print' or 'input' statements. Context of the assignment is: In this assignment, your goal is to write a Python program to determine whether a given pattern appears in a data series, and if so, where it is located in the data series. Please see attachments below: We need to consider the following cases: Case 1 - It is possible that the given...

  • Problem 4: Variables that may affect Grades The data set contains a random sample of STAT 250 Final Exam Scores out of 80 points. For each individual sampled, the time (in hours per week) that the stu...

    Problem 4: Variables that may affect Grades The data set contains a random sample of STAT 250 Final Exam Scores out of 80 points. For each individual sampled, the time (in hours per week) that the student spent participating in a GMU club or sport and working for pay outside of GMU was recorded. Values of 0 indicate the students either does not participate in a club or sport or does not work a job for pay. The goal of...

  • Name: True/False & Multiple Choice (2 points each) (True / False ) 2 A char literal...

    Name: True/False & Multiple Choice (2 points each) (True / False ) 2 A char literal '2', a string literal "2", and the numeric literal 2 are identical and stored the same way though they are different types. 3 Since comments do not affect the program execution, you don't need to have it at all. 4. After the following statements are executed, the value of the variable rem is 3. 1. A preprocessor directive line starts with a pound sign...

  • Can you piea se Show how 4a 2 got the answer F helps me. understand H better Thant you So much Problem 1 REGIONA...

    Can you piea se Show how 4a 2 got the answer F helps me. understand H better Thant you So much Problem 1 REGIONAL AIRLINES Regional Airlines is establishing a new telephone system for handling flight reservations. During the 10:00 A.M. to 11:00 A.M. time period, calls to the reservation agent occur ran- domly at an average of one call every 3.75 minutes. Historical service time data show that a reservation agent spends an average of 3 minutes with each...

  • Please answer the below question for the the article Also need reference plz answer 1 what...

    Please answer the below question for the the article Also need reference plz answer 1 what cultural differences do the US, Germany and India have ? 2 Which county is suitable to locate corporate regional headquarters and bottling and distribution facilities? 3. The International Cola Alliances the most peaceful area Border skirmishes are frequent. most stemming from minor misunderstandings that To introduce some of the complexities involved in ecame inflated by vast cultural and religious differences These distinct cultural differences...

  • Answer questions 1-8 How do you think this would help DASE &-1 NOT SPLLING THE BEANS...

    Answer questions 1-8 How do you think this would help DASE &-1 NOT SPLLING THE BEANS AT JELLY BELLY DEVELOPING A MORE PERFORMANCE APPRAISAL SYSTE be the sweetost job in the world? Why not as chocolates, gummies, gum balls, . Cheesecake, candy corns. licorice, sour car- tbeliel That's the way it is at F ind of course lotce, sour can ections, jellies, and of course let us not forget Fairfield, California-based Jelly retention, and rete. Happy workers lead to higher...

  • Summary Write a program that demonstrates the skills you’ve learned throughout this quarter. This type of...

    Summary Write a program that demonstrates the skills you’ve learned throughout this quarter. This type of project offers only a few guidelines and requirements, allowing you to invest as much time, effort and imagination as you want.  Submit your java programs (*.java) and any other I/O (*.txt) via Canvas  You’ve worked quite hard to make it this far, so have a bit of fun with this project! Design Brief: Use Case Scenario You are hired to develop a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT