C++ Variable Identification Assignment
C++ Variable Identification Assignment
IDENTIFICATION
Assignment
SUBMITTED TO: PROF SIR USMAN
SUBMITTED BY: NUDBA NASEER
ROLL NUMBER:- BIT-F24-M29
C++ variable identification Assignment
Problem 1
Solution: Total 4 variables identified in this problem.
Variables identified :
radius r (float/ double )- using it for the decimal number used in problem for the radius
circumference cir (float/double )-using it for the decimal number used in problem for the
circumference which we calculated
area (float/ double)- using it for decimal precision for the area we found
Problem 2
Solution :
Variable identified :
GPA (float)- using it for decimal number usedn in problem for the GPA of student about what asked for
print .
Problem 3
Solution:
Variable identified :
Fahrenhiet/ frn (float)- using it for decimal precision used in the problem to show the temperature in
fahrenhiet
Celcius /cls (float) – using it for decimal precision used in problem to show temperature in celcius
Problem 4
Solution :
Variables identified :
Simple intrest /splI (float/double )- using it for decimal precision used in problem for the intrest we
calculated in problem through formula
Principal (float/double) –using it for decimal precision used in the problem for principal amount given in
the problem
Rate (float) – using it for decimal precision used in problem for the rate we intrested in problem as
intrest count
Time (float ) – using it for decimal precision used in problem for the time period .
Problem 5
solution:
Total 2 variables identified in this problem ( it can be one if person is not older than 18 and ineligible
.for voting )
Variables identified :
Age ( int )- using it for whole number used in problem for age of person who is voting .
Problem 6
Solution :
Variables identified :
Volume ( float/double) – using it for decimal precision used in problem for the the volume of cylinder
we calculated .
Radius (float/double)- using it for decimal number used in problem for the radius of cylinder we
found.
Hieght (float/double) – using it for decimal precision used in problem for the the hieght of the cylinder
we calculated .
Pi(float/double ) – using it for pi value used in the problem (3.14).
Problem 7
Solution :
Variable identified :
Name (string)- using for text for the name of item we bought .
Price (float/double) – using it for the decimal precision used in problem for the price of item we added
in the shopping cart .
Quantity (int) – using it for whole number for the quantity of item we bought and added in the
shopping cart .
Calculated Coast (float\double) –The calculated coast will be in float or double so the Following variable
will used Because Total money can be in points.
Problem 8
Solution :
Variable identified :
Weight ( float /double ) –using it for decimal number used in problem for person’s weight .
Height (float /double) – using it for decimal number used in problem person’s height .
BMI( float/double) – using it for decimal precision for the total body mass index we calculated .
Problem 9
Solution :
Balance (float/double)-using for decimal number used in problem to store account balance .
Acc typ (string)-using for text that declare the type of account rather it is for “checking “ or “savings”.
Problem 10
Solution :
Variables identified :
First name (string )- using it for text for first name from collected information
Last name ( string)- using for text last name from personal information
Age (int)-using for age of the person in whole number whom information is collected
Gender (char)- using it for gender which represented in the single character
The end