Give good variable names for each of the following:
a. A variable to hold the speed of an automobile
b. A variable to hold the pay rate for an hourly employee
c. A variable to hold the highest score in an exam
a)
The declared variable name is "autoSpeed" is used to hold the speed of an automobile:
//Declare variable name
autoSpeed
Example:
//Initialized the variable name with data type double
double autoSpeed=60.5;
b)
The declared variable name is "empPayHourRate" is used to hold the pay rate for an hourly employee:
//Declare variable name
empPayHourRate
Example:
//Initialized the variable name with data type integer
int empPayHourRate=1000;
c)
The declared variable name is "examHighScore" is used to hold the pay rate for an hourly employee:
//Declare variable name
examHighScore
Example:
//Initialized the variable name with data type double
double examHighScore=95;