Your Ad Here

USING C++ VARIABLES, DATA TYPES, AND KEYWORDS


In this exercise, you use what you have learned about naming C++ variables, C++ data types,
and keywords to answer the following questions:
1. Is each of the following a legal C++ variable name? (Answer yes or no.)
my_age ____ this_is_a_var ____ NUMBER ____
your_age ____ number ____ $number ____
int ____ number1 ____ floatNum ____
25May ____ number Six ____ Number ____
2. What data type (int, double, or string) is appropriate for storing each of the
following values?
A product number ________________________________________________________________________
The amount of interest on a loan, such as 10% ____________________________________________
The price of a CD ________________________________________________________________________
The name of your best friend _____________________________________________________________
The number of books you own ____________________________________________________________

0 comments:

Post a Comment

Popular Posts

Recent posts