Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
148 views
in Computer by (51.9k points)
closed by

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

1 Answer

+1 vote
by (49.5k points)
selected by
 
Best answer

a) Number of months in a year = int as it can’t be string or float

b) Resident of Delhi or not = boolean as it is a condition like ‘either or’

c) Mobile number = int as it can’t be float or string

d) Pocket money = float as it can be a decimal value i.e. 10.50

e) Volume of a sphere = float as volume of sphere = 4/3( * r3), value of = 3.14 and r value can be decimal i.e. 4.5 unit

f) Perimeter of a square = float as perimeter = 4 * length of side, the length of side can be a decimal value

g) Name of the student = string as name is combinations of characters

h) Address of the student = string as address is the concatenated form of different strings.

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...