Şimdi Ara

C programlama ödev yardımı

Daha Fazla
Bu Konudaki Kullanıcılar: Daha Az
1 Misafir - 1 Masaüstü
5 sn
1
Cevap
0
Favori
202
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • C programlama ödevime yardım ederseniz çok sevinirim. işin içinden çıkamadım. Şimdiden çok teşekkürler.

    Q14. Write a complete C program that calculates the distance according to given speed and
    amount of gasoline in tankful of a car. Use Do-While construction.
    a) Car has 50 liters (litre) of a tankful.
    b) Your program will take “speed” and “amount of gasoline” from user.
    c) Then, your program will calculate the distance according to following table (Table-1) and display
    it on command prompt.
    d) This cycle will continue until the tankful is empty (amount of gasoline is “0 ”).
    e) Your program must control the amount of gasoline and speed.

    For example: If the current amount of gasoline is bigger than previous amount of gasoline or 50
    liters in the initial condition, your pogram should display a warning message.
    Speed values can be between 0-169. If the user enters bigger speed values than 169, he/she
    should see a warning message on the screen like “Speed values must be between 0-169”.

    speed: 0-50 Lt/100km:9.9 litre
    speed: 50-70 Lt/100km:8.7 litre
    speed: 70-90 Lt/100km:6.1 litre
    speed: 90-120 Lt/100km:6.8 litre
    speed: 120-140 Lt/100km:7.4 litre
    speed: 140-169 Lt/100km:8.3 litre

    Example output:
    Amount of gasoline : 50 liters
    Current speed : 80 km/h
    Distance (km) : 819.672 km
    Amount of gasoline : 40 liters
    Current speed : 100 km/h
    Distance (km) : 588.235 km
    Amount of gasoline : 20 liters
    Current speed : 150 km/h
    Distance (km) : 240.963 km







  • 
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.