اذهب إلى المحتوى

السؤال

نشر

At the end of this semester (Spring2019), we want to store the first name, the last name, and the final mark (out of 100) of all students of section 3143 having studied the course data structures. Note that the total number of students in this section is equal to 67. 

Through a C++ program, define suitable data structures to store these data. Additionally, your program will ask the user to enter all of these required data then, will print on the screen the first and last names of all students obtaining a final mark greater than or equal to 80.

Recommended Posts

  • 0
نشر

يمكن أن يحل كالتالي

يبقى عليك validation مثلًا العلامة من 0 إلى 100 وهكذا

#include<iostream.h>

       struct Student
       {
              
              char firstname[25];
              char lastname[25];
              int mark;
       };

       void main()
       {
              int i;
              Student std[ 66 ];         

              for(i=0;i<67;i++)
              {

              cout << "\nEnter details of " << i+1 << " Student";

                    cout << "\n\tEnter Student firstname : ";
                    cin >> std[i].firstname;

                    cout << "\n\tEnter Student lasttname : ";
                    cin >> std[i].lastname;

                    cout << "\n\tEnter mark of syudent : ";
                    cin >> Emp[i].mark;
              }

              cout << "\nDetails of students";
              for(i=0;i<67;i++)
              cout << "\n"<< std[i].firstname <<"\t"<< std[i].lastname <<"\t"
                       << std[i].mark ;


       }

 

انضم إلى النقاش

يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.

زائر
أجب على هذا السؤال...

×   لقد أضفت محتوى بخط أو تنسيق مختلف.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   جرى استعادة المحتوى السابق..   امسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

  • إعلانات

  • تابعنا على



×
×
  • أضف...