Facebook
From kleo, 1 Year ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 315
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <string>
  4. using namespace std;
  5.  
  6. // -------------------------------------------
  7.  
  8. // A. Design a roll call list, arrange list of students according to roll numbers in ascending order (using Bubble Sort)
  9.  
  10. // B. Arrange list of students according to name. (Use Insertion sort)
  11.  
  12. // C. Arrange list of students to find out first ten toppers from a class. (Use Quick sort)
  13.  
  14. // D. Search students according to SGPA. If more than one student having same SGPA, then print list of all students having same SGPA.
  15.  
  16. // E. Search a particular student according to name using binary search without recursion.
  17.  
  18. // -------------------------------------------
  19.  
  20. struct Student{
  21.          int Rollno[3];
  22.          string Fullname[3];
  23.          float cgpa[3];
  24.          }stu1;
  25. void inputInformation(Student db){
  26.     for(int i=0;i<3;i++){
  27.         cout << "Enter Roll no. of the student: ";
  28.         cin >> db.Rollno[i];
  29.         cout << "\nEnter Name of the student: ";
  30.         cin >> db.Fullname[i];
  31.         cout << "\nEnter the CGPA of the student: ";
  32.         cin >> db.cgpa[i];
  33.     }
  34. }
  35. void displayInput(Student db){
  36.     cout << "\n--------------------------------------------------------";
  37.     for(int i=0;i<3;i++){
  38.         cout << "\nRoll. no of the student: " << db.Rollno[i];
  39.         cout << "\nName no of the student: " << db.Fullname[i];
  40.         cout << "\nCGPA no of the student: " << db.cgpa[i];
  41.         cout << "\n--------------------------------------------------------";
  42.         }
  43. }
  44. void bubbleSort(){
  45.    
  46. }
  47. int main(){
  48.     inputInformation(stu1);
  49.     displayInput(stu1);
  50.     return 0;
  51. }
  52.  
  53.