FUNDAMENTALS OF COMPUTER

COMPUTER PROGRAMMING FUNDAMENTALS

WHAT IS PROGRAMMING

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which data type would be MOST appropriate for storing the initial of a person’s first name?
A
character
B
string
C
integer
D
real
Explanation: 

Detailed explanation-1: -A student creates a variable called FirstName to hold the letters of a person’s first name and they declare this variable’s data type as String . The computer will interpret the 1’s and 0’s as letters . Even if it is a number, it will not work in a mathematical equation because the data type is String .

Detailed explanation-2: -You can use text fields to store data with text or any combination of text and numbers. Because names are composed entirely of text, the Text data type is the obvious and best choice.

Detailed explanation-3: -Answer: Characters-It is a char data type only. It stores the character of a fixed length that can range from-128 to 127. For example-If the user declares the character(6) that means 6 bytes of memory will be fixed to store the 6 characters.

Detailed explanation-4: -So, we should use integer data type for age. similarly to represent weight, we always represent our weight using floating number. Example 52.3 kg, 70.5 kg etc.

There is 1 question to complete.