🔒 Closed Java Need Help

Status
Not open for further replies.

Super Galaxy

Forum Veteran
Need help po paano po ba program nito Pinapagawa po kasi saamin kong pwede po sana ako makahingi ng program

Write a conversion program focused on meter conversion. (e.g. m to km, m to cm, and so on) Use the table, and program below for your reference. Copy and paste your work in the space provided.
1.webptenor.gif
 
implement mo lang yung mga formulas sa metric conversions sa program mo tapus mag declare ka ng number na babasehan (pwede din na input ng user) tapos convert mo lang sa centimeters to meter to km...etc. yun na maigging output mo, pero baka mali pagkaintindi ko kasi di ka nag provide ng further instructions.
 
Use x as yung icoconvert mo. Then yung y yung result. Also gamitan mo ng multiple class kasi may tatlong conversion ka

Java:
class Converter {
public static void main (string[] args) {
double x, y;
Scanner input = new Scanner(System.in);
System.out.println("Enter value: ");
x = input.nextDouble();
}
}

tsaka gamitan mo ng magtatanong muna kung anong conversion yung gagamitin tas direct mo na sa code na yan.
 
Java:
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        double x;

        //cm to mm
        System.out.println("Enter the centimeter");
        x = scanner.nextDouble();
        System.out.println("The conversion to millimeters is:" + (x*10));

        //meter to cm
        System.out.println("Enter the meter");
        x = scanner.nextDouble();
        System.out.println("The conversion to centimeters is:" + (x*100));

        //km to meter
        System.out.println("Enter the kilometer");
        x = scanner.nextDouble();
        System.out.println("The conversion to meters is:" + (x*1000));

        }
    }

Eto TS para simple lang.
 
Napaka simple lang naman nung gagawin may sample naman na eh, Btw wala naman sinabi na need mag input ng value so tingin ko no need muna gumamit ng Scanner. Maliban na lng kung stated sa requirements.
 
Status
Not open for further replies.

About this Thread

  • 9
    Replies
  • 745
    Views
  • 6
    Participants
Last reply from:
Blueriver

Trending Topics

Online now

Members online
567
Guests online
1,458
Total visitors
2,025

Forum statistics

Threads
2,292,288
Posts
29,075,914
Members
1,210,258
Latest member
kurochan07
Back
Top