NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

// Yunus Emre OCAK - 200202031

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>

struct Ogrenci{
int ogrenci_id;
int aldigi_vize_notlari[3];
int aldigi_final_notlari[3];
};

void random_not(struct Ogrenci ogrenci_dizisi[100], int ogrenci_sayisi){

for(int a = 0; a<ogrenci_sayisi; a++){
int ogrenci_id = rand() % 100 + 1;

int fizik1 = rand() % 100 + 1;
int fizik2 = rand() % 100 + 1;

int mat1 = rand() % 100 + 1;
int mat2 = rand() % 100 + 1;

int kimya1 = rand() % 100 + 1;
int kimya2 = rand() % 100 + 1;

ogrenci_dizisi[a].ogrenci_id = ogrenci_id;

ogrenci_dizisi[a].aldigi_vize_notlari[0] = fizik1;
ogrenci_dizisi[a].aldigi_vize_notlari[1] = kimya1;
ogrenci_dizisi[a].aldigi_vize_notlari[2] = mat1;

ogrenci_dizisi[a].aldigi_final_notlari[0] = fizik2;
ogrenci_dizisi[a].aldigi_final_notlari[1] = kimya2;
ogrenci_dizisi[a].aldigi_final_notlari[2] = mat2;
}

}

void a_ortalama(struct Ogrenci ogrenciler[100], int ogrenci_sayisi, int ders_kodu, int donus[]){
int vize_toplam = 0;
int final_toplam = 0;
for(int a = 0; a<ogrenci_sayisi; a++){
vize_toplam += ogrenciler[a].aldigi_vize_notlari[ders_kodu];
final_toplam += ogrenciler[a].aldigi_final_notlari[ders_kodu];
}

donus[0] = vize_toplam/3;
donus[1] = final_toplam/3;
}

void main()
{
srand(time(NULL));
int ogrenci_sayisi;
printf("Ogrenci sayisi giriniz (max 100): ");
scanf("%d",&ogrenci_sayisi);

struct Ogrenci ogrenci_dizisi[100];
random_not(ogrenci_dizisi, ogrenci_sayisi);

printf("nOgrenci bilgileri:n");
for(int a = 0; a<ogrenci_sayisi; a++){
struct Ogrenci current = ogrenci_dizisi[a];
printf("Ogrenci id:%d | Vizeler:%d %d %d Finaller:%d %d %dn",current.ogrenci_id,
current.aldigi_vize_notlari[0],current.aldigi_vize_notlari[1],current.aldigi_vize_notlari[2],
current.aldigi_final_notlari[0],current.aldigi_final_notlari[2],current.aldigi_final_notlari[3]);
}

while(1){
printf("nnMat icin 1'e, Fizik icin 2'ye, Kimya icin 3'e, Cikis icin 4'e basin.");
int current;
scanf("%d", &current);

int donusler[2];

if(current == 1){
a_ortalama(ogrenci_dizisi, ogrenci_sayisi, 1, donusler);
printf("Matematik vize ort. = %d final ort. = %d", donusler[0], donusler[1]);
} else if(current == 2){
a_ortalama(ogrenci_dizisi, ogrenci_sayisi, 0, donusler);
printf("Fizik vize ort. = %d, final ort. = %d", donusler[0], donusler[1]);
} else if(current == 3){
a_ortalama(ogrenci_dizisi, ogrenci_sayisi, 2, donusler);
printf("Kimya vize ort. = %d, final ort. = %d", donusler[0], donusler[1]);
} else{
break;
}
}
}
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.