41. DC045 20142015. a. Identifier is a reference to memory locations which can hold values. State two (2) rules for naming the identifier. b. State whether the following variables names are valid or invalid. Variable Names Sprice Valid/Invalid (i) Percentage2 (iii) Cost_of_living (ii) c. Identify the suitable variable declaration for the following statement. "A program that will display the mark and grade for a student. " Variable Name Data Type (i) mark (ii) grade

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter3: Assignment, Formatting, And Interactive Input
Section: Chapter Questions
Problem 12PP: (General math) a. A balance has the following weights: 100 lb, 50 lb, 10 lb, 5 lb, and 1 lb. The...
icon
Related questions
Question
41
41. DC045 20142015.
a. Identifier is a reference to memory locations which can hold values. State two (2) rules
for naming the identifier.
b. State whether the following variables names are valid or invalid.
Variable Names
(i)
Valid/Invalid
Sprice
Percentage2
(ii)
(ii)
Cost_of_living
c. Identify the suitable variable declaration for the following statement.
"A program that will display the mark and grade for a student. "
Variable Name
Data Type
(i)
mark
(ii)
grade
d. The following declarations have errors. Correct the errors by rewriting the declaration.
(i)
char numl= 98, num2 = 76, num3 = 54;
(ii)
int 1", 2, 3d ;
(iii)
int long.
Transcribed Image Text:41. DC045 20142015. a. Identifier is a reference to memory locations which can hold values. State two (2) rules for naming the identifier. b. State whether the following variables names are valid or invalid. Variable Names (i) Valid/Invalid Sprice Percentage2 (ii) (ii) Cost_of_living c. Identify the suitable variable declaration for the following statement. "A program that will display the mark and grade for a student. " Variable Name Data Type (i) mark (ii) grade d. The following declarations have errors. Correct the errors by rewriting the declaration. (i) char numl= 98, num2 = 76, num3 = 54; (ii) int 1", 2, 3d ; (iii) int long.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Binary numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning