1. Is each of the following a legal C++ variable name? (Answer yes or no.) myIDN
ID: 3679476 • Letter: 1
Question
1. Is each of the following a legal C++ variable name? (Answer yes or no.) myIDNumber this_is_a_var AMOUNT
yourIDNumber amount $amount
int 10amount doubleAmount
July31 one amount Amount
2. What data type ( int , double , or string ) is appropriate for storing each of the following values?
A person ’ s height (in inches)
The amount of interest on a loan, such as 1 percent
The amount of your car payment
Your grandmother,s first name
The number of siblings you have
Explanation / Answer
1. Is each of the following a legal C++ variable name? (Answer yes or no.)
myIDNumber(yes) this_is_a_var(yes) AMOUNT(yes)
yourIDNumber(yes) amount(yes) $amount(no)
int)no) 10amount(no) doubleAmount(yes)
July31(yes) one amount(no) Amount(yes)
2. What data type ( int , double , or string ) is appropriate for storing each of the following values?
A person ’ s height (in inches)(double)
The amount of interest on a loan, such as 1 percent(int)
The amount of your car payment(double)
Your grandmother,s first name(string)
The number of siblings you have(int)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.