Posts

Showing posts from March, 2020

Lexicographic Increasing Order

Lexicographic increasing order refers to arranging elements or objects in ascending order based on their lexicographic order. In lexicographic order, elements are compared character by character, and the order is determined by the alphabetical or numerical value of each character. For example, consider a list of strings: ["apple", "banana", "cherry", "apricot"]. When arranged in lexicographic increasing order, the list would be ["apricot", "apple", "banana", "cherry"]. The comparison starts with the first character of each string, and if the characters are equal, the comparison moves to the next character. In this case, "apricot" comes before "apple" because 'p' comes before 'p' and 'r' comes before 'p'. Similarly, "apple" comes before "banana" because 'a' comes before 'b'. The concept of lexicographic increasing order ...

Implement the following class hierarchy: Student: id, name, StudentExam (derived from Student): with n subjects (n can be variable) StudentResult (derived from StudentExam): with percentage, grade. Define a parameterized constructor for each class and appropriate functions to accept and display details. Create n objects of the StudentResult class and display the marklist using suitable manipulators.| CPP programs |

Image
  /* Cpp Manipulators used are endl and setw(). These manipulators require inclusion of header file <iomanip> endl : It is used for ending of line in an output. setw(): This manipulator sets the character spacing in an output i.e         for e.g. cout<<"Hello"<<setw(3)<<"World";         here setw(3) will set 3 character spacing between "Hello   World". */ #include<iostream> #include<iomanip> #include<string.h> using namespace std; class student { protected: int rno; char name[20]; public: student(int r,char name1[]) { rno=r; strcpy(name,name1); } void display() { cout<<"\n Student rno="<<rno; cout<<"\n Student name="<<name; } }; class student_exam:public student { protected: int *ptr; int no; public: student_exam(int r,char nm[],int n):student(r,nm) { no=n; ptr=new int[no]; } void...

Popular posts from this blog

Implement the following class hierarchy: Student: id, name, StudentExam (derived from Student): with n subjects (n can be variable) StudentResult (derived from StudentExam): with percentage, grade. Define a parameterized constructor for each class and appropriate functions to accept and display details. Create n objects of the StudentResult class and display the marklist using suitable manipulators.| CPP programs |

Different Types of Computer Programming Languages

Lexicographic Increasing Order