Question

some programming languages require that named constants are assigned a value when they are declared. Other...

some programming languages require that named constants are assigned a value when they are declared. Other languages allow a constant’s value to be assigned later in a program. Which requirement do you think is better? Why?

Homework Answers

Answer #1

The one where we have to assign the value when they are declared is better because if the value is a constant then it must be known at the time of the declaration otherwise there is no point of declaring the variable if its not going to be used in code or if we don't know the value of variable yet. If we don't know the value then we can't use it hence it becomes a redundant variable unless assigned a value so we can declare it at that time only when we know the value of the constant.

Know the answer?
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
Similar Questions
QUESTION 1 1.   Which programming languages do not have iteration statements and why?        Imperative...
QUESTION 1 1.   Which programming languages do not have iteration statements and why?        Imperative programming languages require recursion to do anything iteratively        Object-Oriented Programming languages do not use iteration since functions operate over data structures.        Functional programming languages since they do not use variables and counting loops require variables.        Functional programming languages do not have variables and iteration requires variables to operate. QUESTION 2 1.   One of the downsides of using expressions...
In C Programming: Thread safety is a concept often used when discussing subroutines or other code...
In C Programming: Thread safety is a concept often used when discussing subroutines or other code segments that are written in such way that they can be “multiply run” as parts of multiple threads that are being scheduled concurrently or otherwise multiprogrammed. Do you think that the function printf() is thread safe? Do some research and/or run some code experiments and provide a brief, but complete, answer that explains your view on the subject. Be sure to explain why you...
1. Most database applications require a host programming language to communicate with the database using SQL....
1. Most database applications require a host programming language to communicate with the database using SQL. A wide range of programming languages can be used with SQL,from traditional languages such as COBOL, FORTRAN, and Assembler to more modern languages such as C/C++, Java, and Visual Basic. Your choice of host programming language can impact the way you will have to code SQL. True or False? 2. It is an entity name guideline: a. Do not pluralize the name; use singular...
All forms of psychotherapy require the patient/client to engage with a therapist in some form of...
All forms of psychotherapy require the patient/client to engage with a therapist in some form of discussion. But what about other treatment methods? Do you think it’s completely necessary to talk with a psychotherapist to in order to resolve one’s issues, or can we just solely rely on drug treatments or perhaps psychosurgery? Why?
Each part of this lab will use the same input file, named “lab3-in.dat.” This file will...
Each part of this lab will use the same input file, named “lab3-in.dat.” This file will be located in the same directory as the executables (do not specify a path for the file in the Select statements). This file is a roster of animals in a travelling carnival. The record format for the file is as follows: Field Description Length Data Type Name 12 String Gender 1 String Species 15 String The end result of each part of this assignment...
in a U-tube barometer, mercury (or some other fluid) is placed in a U shaped tube....
in a U-tube barometer, mercury (or some other fluid) is placed in a U shaped tube. The air is vacuumed out of one end, which is then sealed. Atmospheric pressure pushes down on the other end, resulting in the two surface levels being at different heights. If we made a U-tube barometer using olive oil as our fluid, how tall would we need to make it to be able to measure standard atmospheric pressure? Based on this answer, why do...
Which analytical procedure, in your opinion, is the most important when testing for realizable value of...
Which analytical procedure, in your opinion, is the most important when testing for realizable value of accounts receivable? Why do you think so?
1) Write a java programming using a while loop where you will add numbers and when...
1) Write a java programming using a while loop where you will add numbers and when you press number 0 it will add all your numbers and display the results. Use Scanner object. Steps: 1) Declare variables integer called sum which is equal to zero   2) Declare Scanner object   3) Declare while condition where is true   4) Inside of that condition prompt the user to enter the numbers   5) Declare variable integer called number and input the number statement   6)...
This programming task will be a bit different. It will be more like what you would...
This programming task will be a bit different. It will be more like what you would receive if you were a maintenance engineer working in a corporate information systems or technology department. In other words, you will have some prebuilt source code provided for you that you must alter so it will meet the given programming specification.. Build a program from what you have been given as a starting-point. Rename the “starter code”. Do not add any modules; just, use...
1. Why do we prefer the median as a better measure of central tendency when the...
1. Why do we prefer the median as a better measure of central tendency when the data are positively/negatively skewed? Are there times in which mean or mode should be used instead? Explain your answer. 2. Find an article about the misuse of statistics and share what you have learned from the article. Then, find an example of when statistics were misused/skewed and state the reason why you think the statistics were reported that way. 3. Maybe you have considered...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT