Question

In: Computer Science

Discuss how you would determine a data type for your program variables. Give an example of...

Discuss how you would determine a data type for your program variables. Give an example of each data type declaration in your program.

Solutions

Expert Solution

A variable is simply a name of storage location

The data type of a variable determines the kind of data the variable can hold.

commonly used data types : byte,short,int ,long,float,double,char,boolean.

In some programming languages like c,c++, Java

a variable declaration always contains two components: the type of the variable and its name.

Example: int count = 0; here int is data type & count is name of variable.

In some programming languages like java script we omit data type.

A variable in JavaScript can contain any data. A variable can at one moment be a string and at another be a number.

// no error
let message = "hello";
message = 123456;

// Screenshot of the code & output


Related Solutions

What is economic value? Give an example of how you would determine the economic value for...
What is economic value? Give an example of how you would determine the economic value for a particular hospitality service.
describe how ratios function and then (give a numbers example) discuss how you would distribute profits...
describe how ratios function and then (give a numbers example) discuss how you would distribute profits and liquidated assets in ratio form.
Discuss how you would incorporate communication in your training program (audience would be for orientation, or...
Discuss how you would incorporate communication in your training program (audience would be for orientation, or your team you manage). Explain what you would do and when you would do it. Also, how would you check for effectiveness?
Could you define the following terms and give an example? cases variables statistics data
Could you define the following terms and give an example? cases variables statistics data
how we can choose statistical analysis test based on data type and no of variables? give...
how we can choose statistical analysis test based on data type and no of variables? give me 5 test examples which must include manova and mancova
Practice problems 1 – Type of variables 1. In the following situations give an example of...
Practice problems 1 – Type of variables 1. In the following situations give an example of a parameter and a statistic a. Political elections b. Subaru 2020 Forester vehicles c. RUM students d. Puerto Ricans 2. You are in charge of a local company who wants to obtain mean income of the company’s engineers to compare with the mean income of engineers in the industry. You can either obtain the population mean (parameter) or a sample mean (statistic) to reach...
give an example of each of the type of costing systems used to determine the costs...
give an example of each of the type of costing systems used to determine the costs in petrochemical refinery and building construction
Discuss a strength or aptitude that you have and give an example of how it has...
Discuss a strength or aptitude that you have and give an example of how it has helped you. 250 words
: what is your understanding of business data analysis? Give an example that you are familiar...
: what is your understanding of business data analysis? Give an example that you are familiar with. Question 2: what are the 4 basic categories of data? Describe the key characters of each category.
how would you explain how personal morals affects performance and give an example:
how would you explain how personal morals affects performance and give an example:
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT