คอมพิวเตอร์M3./6งาน2

กระทู้สนทนา
#เขียนโปรเเกรมรับค่า(input)ชื่อ,นามสกุล,อายุ,น้ำหนัก,ส่วนสูง
#เเสดงผล ชื่อ, นามสกุล, อายุ(ปี), น้ำหนัก(กก.) เเละ ส่วนสูง(ซม.)
#โดยมีข้อความหน้าข้อมูลด้วย
#เเสดงชนิดข้อมูลของตัวเเปรเเต่ละตัว
#คำนวณค่า BMI เเละเเสดงผล พร้อมทั้งเเสดงชนิดข้อมูลค่าBMI
# BMI = (weight/(height/100)**2)
name = input("Input your name: ")
surname = input("Input your surname: ")
age = int(input("Input your age:"))
weigth = int(input("Input your weight:"))
heigth = int(input("Input your height:"))
print("Your name is: ",name)
print("Your surname is: ",surname)
print("Your age is: ",age,"years","\b.")
print("Your weight is: ",weight,"k","\b.")
print("Your height is: ",height,"cm","\b.")
print()
print("Type of name: ",type(name))
print("Type of surname: ",type(surname))
print("Type of age: ",type(age))
print("Type of weight: ",type(weight))
print("Type of height: ",type(height))
print()
BMI = (weigth/(heigth/100)**2)
print("Your BMI is: ",BMI)
แสดงความคิดเห็น
โปรดศึกษาและยอมรับนโยบายข้อมูลส่วนบุคคลก่อนเริ่มใช้งาน อ่านเพิ่มเติมได้ที่นี่