Tone
Sharpness
Scale
Arrangement
Answer:
#include <iostream>
using namespace std;
struct StudentType{
string studentName;
int studentId;
}
int n;
char answer[20];
int main(){
cout<< "Enter the size of the array: ";
cin >> n;
StudentType *student = new StudentType(n);
for (int i = 0; i < n; i++){
int name;
int number;
cin>> name;
cin >> number;
student[i].studentName = name;
student[i].studentId = number;
}
for (int i = 0; i < 20; i++){
cout<< "Enter answers: ";
cin >> ans;
answer[i] = ans;
}
}
Explanation:
The C++ source code has three global variables namely, answer which is an array of character data type, StudentType which is a structure data type and the integer variable n. The main function declares and initializes the dynamic-spaced student array of the structure datatype with the n variable.
Answer:
The name should be readable and make sense
Explanation:
Aside the rules involved in naming variables, there are also some good tips which should be considwred when given names to our variables. These means there are some variables which are acceptable by our program but may be avoided in other to make our codes easier to read by us and others and it also makes debugging easier when we run into errors. Using short variables are acceptable on code writing as far as the rules are followed. However, it is more advisable to use names that are descriptive and readable such that it relates to the program or code being worked on. This ensures that we and others can follow through our lines of code at a much later time without making mistakes or forgetting what the variable stands for.
Answer:
Option a is the correct answer for the above question.
Explanation:
- The above question has the option in which two option holds a syntax which is used to declare a variable in PHP language. So the answer is on behalf of the PHP language.
- When a user wants to create an object of any class with the two-parameter in PHP language, then he can do it by the help of "class_name object_name= new class_name($argument1,$argument2)".
- The option 'a' follows the above syntax to create an object of Cart class. Hence it is a correct option while the other is not because:
- Option b states a syntax in which the new keyword is not defined which is used to create a new object.
- Option c states that option in which '$' is not defined to declare a variable.
- Option d states that option in which '$' is not defined to declare a variable.