Wednesday, 3 October 2018


Choong Kar Yee
182630
Lab2


1. 
public ComputerArea




public Average




public FahrenheitToCelsius




public SalesTax








2.
public Average




public class FahrenheitToCelsius




3.


4.


5.


IPO
Input
Process
Output
double money
double ringgit = (int)money;
double sen= (100*money)%100;
Display ringgit
Display sen

PAC

Input
Process
Output
Calculate money
Calculate ringgit
Calculate sen
Number of ringgit
Number of sen




6.
IPO
Input
Process
Output
weight in pound
height in inches
Calculate BMI


Display BMI

PAC

Input
Process
Output
weight in pound
height in inches
weight in pounds
height in inches
BMI=weight*0.45359237/
(height*0.0254)/(height*0.0254)

BMI




BMI. 1 pound is  0.0254

import java.util.Scanner;
public class BMI{
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
double weight=input.nextDouble();
int height=input.nextInt();
double BMI=(weight*0.45359237)/(0.0254*height)/(0.0254*height);
System.out.printIn("BMI is" + BMI);
}

}



basically what i have done today is very challenging tho.
Computer Programming course is interesting and yet challenging.
when you have typing error, your program could not be done at all.
You need to be alert on every single word that you typed and figure out what is the wrong on it.
Anyways, this is a new knowledge to me ;)
CHALLENGES ACCEPTED!!





No comments:

Post a Comment

lab 10 1. import java.util.Scanner; public class Test1{      public static void main(String []args){               Scanner input =...