2. In an assignment statement it may be necessary to convert the data type ( Type Conversion ). Explain what is meant by narrowing and widening conversion as follows for example in C, C ++, or Java programming language.
These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.Question 1
Primitive data types are provided by default to users by the programming language to use for further block constructions. These are considered “fundamental” or “predefined” types and can be used by users to construct other types (e.g. abstract, structures). They store single values and define both variables and constants. In C++, there are seven primitive data types, as follows:
• char – can appear with “signed” or “unsigned” and represents either a character or a small integer (usually it requires 1 byte regardless the C++ used compiler);
• int (stands for “integer”) – it can be “short”, “normal”, “long” or “long long” (depending on the amount of bytes used for storage); the ranges vary accordingly for each case (in general, 2/4/8 bytes); it can be used in combination with “unsigned” or “signed”;
• bool (stands for “Boolean”) – requires one byte and has two values: true & false;
• float – represents a real number on 4 bytes using single-precision representation;
• double – represents a real number using double-precision floating point scheme (8 bytes);...
By purchasing this solution you'll be able to access the following files: