Which data type will be used to represent the
following data values and why?
a) Number of months in a year
b) Resident of Delhi or not
c) Mobile number
d) Pocket money
e) Volume of a sphere
f) Perimeter of a square
g) Name of the student
h) Address of the student
Answers
a) int data type
b) String datatype
c) String datatype
d) int datatype
e)double datatype
f)double datatype
g) String datatype
h) String datatype
Explanation:
a) The number of months in the year is the integer value that's why we used the datatype int that is used for storing the value number .
b) The Resident of Delhi or not is the collection of character that's why we used the datatype string that is used for storing the collection of character.
c) The mobile number is the 10-12 digit value that's why we used the datatype string.The string datatype is treated them as a character.
d) The pocket money is the integer value that's why we used the datatype int that is used for storing the value number .
e) The volume of sphere is a decimal value that's why we used the datatype double.The double datatype is used for holding decimal value .
f) The Perimeter of a square may be the decimal value that's why we used the datatype double.The double datatype is used for holding decimal value as well as integer .
g) The name of student is the collection of character that's why we used the datatype string .The string datatype that is used for storing the collection of character and the long integer value .
h)The address of student is the collection of character that's why we used the datatype string .The string datatype that is used for storing the collection of character .
Learn More :
- brainly.com/question/13991990
Answer:
a) int
b)string
c)string
d)int
e)float
f)float
g)string
h)string