Answer:
Create the student class object which inherit the printinfo() from the abstract class People
Explanation:
Classes in object-oriented programming are blueprints of a defined type of data structure.
An object of an abstract class cannot be instantiated. So, the People class in question, is only inherited by the Student class which able to use the define printinfo() method.
There are a lot of aspect to programming. The correct notation to specify the following inheritance is Class Students inherits from abstract class.
Inheritance is simply known one of the key aspects of Object Oriented Programming (OOP).It is known to help to give code re-usability. When writing the same code every time, one can be said to inherit the properties of one class into the other.
Learn more about Inheritance in programming from
https://brainly.com/question/14078098
Write a program that prompts the user to enter three words. The program will then sort the words in alphabetical order, and display them on the screen. The program must be able to support words with both uppercase and lowercase letters. You must use C style strings (string class).
Answer:
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
bool sorter(string a, string b)
{
return a<b;
}
int main(){
string wordList[3];
string word;
for (int i = 0; i < 3; i++){
cout<< "Enter word: ";
cin>> word;
wordList[i] = word;
}
sort(wordList, wordList+3, sorter);
for (int i = 0; i < 3; i++){
cout<< wordList[i]<< "\n";
}
}
Explanation:
The C++ source code prompts the user for string words that are appended to the wordList array. The array is sorted with the sort() function from the C++ bits library. The finally for loop statement prints out the items in the array.
The factorial of n is equal to ______.
Answer:
n! = n*(n-1)*(n-2)*(n-3)* ... *2*1
Explanation:
The factorial operator is simply a mathematical expression of the product of a stated integer and all integers below that number down to 1. Consider these following examples:
4! = 4 * 3 * 2 * 1
4! = 12 * 2 * 1
4! = 24
6! = 6 * 5 * 4 * 3 * 2 * 1
6! = 30 * 4 * 3 * 2 * 1
6! = 120 * 3 * 2 * 1
6! = 360 * 2 * 1
6! = 720
So, the factorial of n would follow the same as such:
n! = n * (n-1) * (n-2) * ... * 2 * 1
Cheers.