C++ hatası

  • Konuyu başlatan RSK06
  • Başlangıç Tarihi
  • Mesaj 14
  • Görüntüleme 808

RSK06

Hectopat
Katılım
29 Aralık 2020
Mesajlar
2.283
Çözümler
4
Daha fazla  
Cinsiyet
Erkek
Daha öğrenmeye başlayalı 2-3 saat oldu ve nerede hata yaptım anlamadım. Yardım eder misiniz?
 

Dosya Ekleri

  • Screenshot 2021-04-04 193852.png
    Screenshot 2021-04-04 193852.png
    47,7 KB · Görüntüleme: 57
  • Screenshot 2021-04-04 193837.png
    Screenshot 2021-04-04 193837.png
    45,8 KB · Görüntüleme: 61
#include <iostream>
int main() {
double weight;
int x;
std::cout << "What is your weight: ";
std::cin >> weight;
std::cout << "\nI have information for the following planets:\n\n";
std::cout << " 1. Venus 2. Mars 3. Mercury\n";
std::cout << " 4. Saturn 5. Neptune 6. Uranus\n\n";
std::cout << "Which planet are you visiting? ";
std::cin >> x;
if (x == 1) {
weight = weight * 0.91;
} else if (x == 2) {
weight = weight * 0.38;

} else if (x == 3) {
weight = weight * 0.38;
} else if (x == 4) {

weight = weight * 1.06;
} else if (x == 5) {
weight = weight * 1.19;
} else if (x == 6) {
weight = weight * 0.92;
}
std::cout << "\nYour weight: " << weight << "\n"
















}
 

Geri
Yukarı