1. In using scanf the reference to data was always passed. When using printf the reference was passed for a string, but the data value was required for types such as integer. This says that what is commonly refer to as a variable actually has 3 parts: 1 - The label (sometimes called the id or name); 2- the reference; 3- the value. Explain to the best of your understanding what is the difference between each of these three parts, and how it changes the cognitive model or metaphor you use to understand a variable. The type of the variable (how the variable is stored and operations on the variable) are associated with what part of the variable, the label, reference, or value? 2. Which parts of the variable exist at compile time, and which parts exist at run time? 3. Harder question with more insight: Can a value be a reference? Can you think of an example? (Think of structs and arrays). 4. Even harder, this is a real world example. I read that Python has immutable primitive types (e.g. num). But If I say "X-5; X=X+3", X is 8! It seems that X mutated (changed). So what does immutable mean in

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
1. In using scanf the reference to data was always passed. When using printf the reference was passed for a string, but the data value was required for types such as integer. This says that what is commonly
refer to as a variable actually has 3 parts: 1 - The label (sometimes called the id or name); 2 - the reference; 3 - the value. Explain to the best of your understanding what is the difference between each of
these three parts, and how it changes the cognitive model or metaphor you use to understand a variable. The type of the variable (how the variable is stored and operations on the variable) are associated
with what part of the variable, the label, reference, or value?
2. Which parts of the variable exist at compile time, and which parts exist at run time?
3. Harder question with more insight: Can a value be a reference? Can you think of an example? (Think of structs and arrays).
4. Even harder, this is a real world example. I read that Python has immutable primitive types (e.g. num). But If I say "X=5; X=X+3", X is 8! It seems that X mutated (changed). So what does immutable mean in
Python. How does this apply to this topic of value and reference, and what is a variable anyway?
5. Read the other posts, and see if any of their comments help you understand the concept of a variable. Respond to one post.
Transcribed Image Text:1. In using scanf the reference to data was always passed. When using printf the reference was passed for a string, but the data value was required for types such as integer. This says that what is commonly refer to as a variable actually has 3 parts: 1 - The label (sometimes called the id or name); 2 - the reference; 3 - the value. Explain to the best of your understanding what is the difference between each of these three parts, and how it changes the cognitive model or metaphor you use to understand a variable. The type of the variable (how the variable is stored and operations on the variable) are associated with what part of the variable, the label, reference, or value? 2. Which parts of the variable exist at compile time, and which parts exist at run time? 3. Harder question with more insight: Can a value be a reference? Can you think of an example? (Think of structs and arrays). 4. Even harder, this is a real world example. I read that Python has immutable primitive types (e.g. num). But If I say "X=5; X=X+3", X is 8! It seems that X mutated (changed). So what does immutable mean in Python. How does this apply to this topic of value and reference, and what is a variable anyway? 5. Read the other posts, and see if any of their comments help you understand the concept of a variable. Respond to one post.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Reference Types in Function
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