Answer:
#include<iostream>
#include<cstring>
#include <algorithm>
using namespace std;
class Student{
public:
string name;
int rollNo;
Student(){
}
Student(string n, int r){
name = n;
rollNo = r;
}
};
class ClassRoom{
public:
Student stud[10];
int count;
ClassRoom(){
count = 0;
}
void addStudent(string str,int roll){
Student s(str,roll);
stud[count++] = s;
}
Student * getAllStudents(){
return stud;
}
};
int main()
{
string name;
char temp[20];
int rollNo, N, i;
Student * students;
ClassRoom classRoom;
i=0;
while(getline(cin, name) && cin.getline(temp,20)&&i<10){
rollNo = atoi(temp);
classRoom.addStudent(name, rollNo);
i++;
}
N = i;
students = classRoom.getAllStudents();
for(int i=0 ; i < N; i++){
cout << (students+i)->rollNo << " - " << (students+i)->name;
if(i<N-1)
cout<<endl;
}
return 0;
}
Explanation:
- In the addStudent method, increment the counter and as the value of variable s to the the stud array.
- In the getAllStudents method, return all the students.
- Finally in the main method, display the name and roll no. of students.
Answer:
Generation in computer terminology is a change in technology a computer is/was being used which includes hardware and software to make of an entire computer system .
Answer:
The conclusion is incorrect; using the test case [0, 1, 4, 5] is not sufficient to conclude the program is correct.
Explanation:
From the code snippet given, we cannot conclude that the test case is sufficient.
One of the reasons is because the test case contains only integer variables.
Tests need to be carried out for other large and floating points numerical data types such as decimal, double, float, etc. except that when it's known that the inputs will be of type integer only else, we can't rush into any conclusion about the code snippet
Another reason is that input are not gotten at runtime. Input gotten from runtime environment makes the program flexible enough.
Lastly, the array length of the array in the code segment is limited to 4. Flexible length needs to be tested before we can arrive at a reasonable conclusion.
Explanation:
In this question
d is known as diameter
r is known as radius
c is known as circumference
pi is known as π
a is known as area
Now, In Maths
Area of circle = π×r×r
Circumference of circle = 2×π×r
Radius (r) = diameter(d)÷2
Given diameter is 6
then, r = 6 ÷2
r = 3
so, diameter = 6
radius = 3
circumference = 2×π×r
= 2×3.14×3 ( the value of π is equal to 3.14)
= 18.84
Area = π×r×r
= 3.14×3×3 ( the value of π is equal to 3.14)
= 28.26
Answer:
Data Redundancy
Explanation:
It is a data organization issue that allows the unnecessary duplication of data within your Microsoft Access database.
Hope this helps ^v^