Generation

generate functionFri, 31 Mar 2023

برنامح يقوم بانشاء سجل لادخال بيانات عدة طلاب مع اسمهم ورقمهم وراتبهم ثم انشاء دالة للبحث عن طالب معين داخل قاعدة البيانات

#include <iostream> #include <string> using namespace std; struct student{ string name; int age; int salary; }; struct student students[1000]; int currentIndex = 0; void addStudent(string name, int age, int salary){ students[currentIndex].name = name; students[currentIndex].age = age; students[currentIndex].salary = salary; currentIndex++; } void printStudent(struct student x){ cout << "Student name is: " << x.name << endl; cout << "Student age is: " << x.age << endl; cout << "Student salary is: " << x.salary << endl; cout << "-----------------------------" << endl; } void searchStudent(string name){ struct student x; bool found = false; for (int i = 0; i < currentIndex; i++){ if (students[i].name == name){ x = students[

Want to kickstart your project?Use the new AI Studio to create your code