Closed sametndsenol closed 1 year ago
typedef struct fullName { //tam adi char name; //adi char surname; //soyadi }name_t;
https://user-images.githubusercontent.com/54737836/105917568-8a0b3e00-6043-11eb-8d5c-f5fcb7fac5f9.mp4
typedef struct examGrades { //sinav not double midterm; //vize double final; //final double quiz; //quiz double homework; //odev }grades_t; typedef struct courseRegistered { //kayitliDersler char courseName[COURSENAMELENGTH]; //ders adi char courseCode[COURSECODELENGTH]; //ders kodu grades_t grades; //notler char letterGrade[2]; //herf notu double numericGrade; //numerik notu }courseReg_t; typedef struct studentInfo { //ogrenci bilgi name_t studentName; //ogrenci adi char stNo; //ogrenci numara courseReg_t courses[COURSESREGISTERED]; //dersler double gpa; //ortalama }student_t; typedef struct courseInfo { //ders bilgi char courseName[COURSENAMELENGTH]; //ders adi char courseCode[COURSECODELENGTH]; //ders kodu student_t students[CLASSSIZE]; //ogrenciler double courseAverage; //ders ortalama }courses_t;
int main() { struct studentInfo aStudents[CLASSSIZE]; for (int i = 0; i < CLASSSIZE; i++) { printf("%d Please enter student name and surname", i); scanf_s("%s %s", &aStudents[i].studentName.name, NAMELENGTH, &aStudents[i].studentName.surname, NAMELENGTH); } printf_s("%s %s", aStudents[2].studentName.name, aStudents[2].studentName.surname); }
include
include
include
define CLASSSIZE 4 // SINIFKAPASITE
define STUDENTNUMBERLENGTH 10 // OGRENCINUMARAUZUNLUGU
define NAMELENGTH 25 // ADIUZUNLUGU
define COURSENAMELENGTH 50 // DERSADIUZUNLUGU
define COURSECODELENGTH 10 // DERSKODUZUNLUGU
define COURSESREGISTERED 5 // KAYITLIDERSLER
define MIDTERMWEIGHT 30 // VIZEAGIRLIK
define FINALWEIGHT 30 // FINALAGIRLIK
define QUIZWEIGHT 20 // QUIZAGIRLIK
define HOMEWORKWEIGHT 20 // ODEVAGIRLIK
typedef struct fullName { //tam adi char name; //adi char surname; //soyadi }name_t;
https://user-images.githubusercontent.com/54737836/105917568-8a0b3e00-6043-11eb-8d5c-f5fcb7fac5f9.mp4
typedef struct examGrades { //sinav not double midterm; //vize double final; //final double quiz; //quiz double homework; //odev }grades_t; typedef struct courseRegistered { //kayitliDersler char courseName[COURSENAMELENGTH]; //ders adi char courseCode[COURSECODELENGTH]; //ders kodu grades_t grades; //notler char letterGrade[2]; //herf notu double numericGrade; //numerik notu }courseReg_t; typedef struct studentInfo { //ogrenci bilgi name_t studentName; //ogrenci adi char stNo; //ogrenci numara courseReg_t courses[COURSESREGISTERED]; //dersler double gpa; //ortalama }student_t; typedef struct courseInfo { //ders bilgi char courseName[COURSENAMELENGTH]; //ders adi char courseCode[COURSECODELENGTH]; //ders kodu student_t students[CLASSSIZE]; //ogrenciler double courseAverage; //ders ortalama }courses_t;
int main() { struct studentInfo aStudents[CLASSSIZE]; for (int i = 0; i < CLASSSIZE; i++) { printf("%d Please enter student name and surname", i); scanf_s("%s %s", &aStudents[i].studentName.name, NAMELENGTH, &aStudents[i].studentName.surname, NAMELENGTH); } printf_s("%s %s", aStudents[2].studentName.name, aStudents[2].studentName.surname); }