Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

[HELP!] Simple Java Program

char32

Novice
Advanced Member
Messages
25
Reaction score
0
Points
26
Patulong naman po ako.

I'm trying to create a program that will compute BMI. Pero bago yun, the program has to convert pounds for the mass to kg, and ft. in. to m^2.

Parang ganto:


BMI= Mass(kg) ;However, mass input is in pounds and height input is in ft. in (like 5'6") so it has to be converted.
Height(m^2)



Kaso, I keep receiving the error: incompatible type: possible lossy conversion from double to int.

Please see screenshot.


Please help meeee. :pray::pray::pray::pray::pray::pray::pray::pray:



View attachment 283831
 

Attachments

  • Head ache.jpg
    Head ache.jpg
    173.3 KB · Views: 35
palitan mo ng double yung int

P.S aralin mo yung mga data types sir
 
Last edited:
^
tama sya, pag-aralan mo yung differences ng data types

For the numerical data types, ito yung mga usual na ginagamit, INT, FLOAT, DOUBLE

for whole numbers, use int (ex. 1, 100, 1000)
for numbers with decimal places, use float / double (ex. 3.1415, .5, .0005), wala halos difference ang float and double except sa size ng number na pwede mo ilagay, isipin mo na lang na mas mahaba (mas precise) si double kesa kay float

so kung meron ka value na 3.1415, pwede mo sya ilagay kay float, pwede din naman kay double. now, kung ilalagay mo sya kay int, mae-encounter mo nga iyan error na yan, or kung gusto mo ipilit, ang maiiwan na lang sa value mo ay yung 3, kasi yun lang yung whole number.

kung meron ka naman 1000, pwede mo sya ilagay sa kahit alin jan sa 3 data types na yan
 
palitan mo ng double yung int

P.S aralin mo yung mga data types sir

^
tama sya, pag-aralan mo yung differences ng data types

For the numerical data types, ito yung mga usual na ginagamit, INT, FLOAT, DOUBLE

for whole numbers, use int (ex. 1, 100, 1000)
for numbers with decimal places, use float / double (ex. 3.1415, .5, .0005), wala halos difference ang float and double except sa size ng number na pwede mo ilagay, isipin mo na lang na mas mahaba (mas precise) si double kesa kay float

so kung meron ka value na 3.1415, pwede mo sya ilagay kay float, pwede din naman kay double. now, kung ilalagay mo sya kay int, mae-encounter mo nga iyan error na yan, or kung gusto mo ipilit, ang maiiwan na lang sa value mo ay yung 3, kasi yun lang yung whole number.

kung meron ka naman 1000, pwede mo sya ilagay sa kahit alin jan sa 3 data types na yan



Thanks mga sir. Napa run ko na siya. Ano pa po ba dapat kong malaman sa basics? Thanks po ulit ng marami. :yipee::yipee::yipee::yipee::yipee::yipee::yipee::yipee:
 
Thanks mga sir. Napa run ko na siya. Ano pa po ba dapat kong malaman sa basics? Thanks po ulit ng marami. :yipee::yipee::yipee::yipee::yipee::yipee::yipee::yipee:

Concentrate ka dito sir. Eto ang mga kailangan mo i master kasi palagi mo itong magagamit.

1. Input
2. Conditional Statements
3. Looping
4. Methods and Fields
5. Error Handling
6. Class and OOP
7. Arrays and Dictionaries
8. Inheritance
 
Back
Top Bottom