NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#include <stdio.h>

float kiralama_bedeli(int surucu_yasi, char arac_tipi, int kiralanacak_gun){

float ucret=0;
float indirim_orani=1;

if(surucu_yasi < 18 || surucu_yasi > 80){
printf("Yas sinirlamalarindan dolayi arac kiralayamazsiniz !");
}

switch(arac_tipi){

case 'M': case 'm':
ucret = 100;
break;
case 'F': case 'f':
ucret = 150;
break;
case 'S': case 's':
ucret = 200;
break;
case 'V': case 'v':
ucret = 250;
break;
case 'C': case 'c':
return 0;
default:
printf("Yanlis bir arac sinifi giriniz!!");
}

// kiralanacak gune gore indirim orani belirlendi
if(kiralanacak_gun>0 && kiralanacak_gun <=7)
indirim_orani = 1;
else if(kiralanacak_gun>7 && kiralanacak_gun <=15){
indirim_orani = 0.15;
}
else if(kiralanacak_gun>15 && kiralanacak_gun <=30){
indirim_orani = 0.3;
}
else if(kiralanacak_gun>30){
indirim_orani = 0.5;
}

// ucret hesaplandi ve surucu_yasina gore ekstra indirim uygulandi.
float toplam_ucret = ucret*kiralanacak_gun-(ucret*kiralanacak_gun*indirim_orani);
if(surucu_yasi>35 && surucu_yasi <= 80)
toplam_ucret = toplam_ucret - (toplam_ucret*0.1);

return toplam_ucret;
}


int main()
{
int yas,gun;
char arac_sinifi;
int sayac = 0;


do{
sayac ++;

baslangic:
printf("Araba kiralama sistemine hos geldiniz...nn");
printf("Surucunun yasini giriniz: ");
scanf("%d",&yas);

if(yas < 18 || yas > 80){
printf("Yas sinirlamalarindan dolayi arac kiralayamazsiniz !n");
printf("n--------------------------------------------------nn");
goto baslangic;
}

else{
printf("Lutfen Arac tipini seciniz minicar (m) familycar (f) SUV (s) Van (v) cikis (c): ");
scanf(" %c",&arac_sinifi);

if(arac_sinifi == 'c' || arac_sinifi == 'C')
break;

printf("Kiralayacaginiz gun sayisini giriniz: ");
scanf("%d",&gun);
float sonuc = kiralama_bedeli(yas,arac_sinifi,gun);
printf("nOdeyeceginiz tutar %.2f TL dirn",sonuc);
}

printf("n--------------------------------------------------nn");

}while( sayac < 16 );


printf("nnn--------------------------------------------------");


return 0;
}
     
 
what is notes.io
 

Notes.io is a web-based application for 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 12 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.