Wednesday, 26 September 2018

Choong Kar Yee
182630
Lab1

1.
public test 1

public class Test1 {
public static void main(String[] args)  {
double i = 50.0;
double k = i + 50.0;
double j = k + 1;
System.out.println("j is:" +j+ "and k is:" +k);
}
}



public class Test2 {
public static void main(String[] args) {
int k = 1;
int i = k + 2;
System.out.println("i is" + i );
}
}





public class Test3 {
public static void main(String[] args) {
int i, j, k;
i = j = k = 2;
System.out.println("i is" + i + "j is" + j + "k is" + k);
}
}



public class Test4{
public static void main(String[] args)
{
int amount = 5;
System.out.println(amount/2);
}
}





public class Test5{
public static void main(String[] args)
{
double interestRate = 0.05;
double interest = interestRate * 10000;
System.out.println("interest is " + interest);
}
}




public class Test6
{
public static void main(String[] args)
{
int value = 2147483647 + 1;
System.out.println("value is " + value);
}
}


public class Test7
{
public static void main(String[] args)
{
int value = -2147483646 - 1;
System.out.println("value is"  + value);
}
}



public class Test8
{
public static void main(String[] args){
System.out.println("1.0 - 0.9");
}
}





public class Test9
{
public static void main(String[] args) {
double value=1/1;
System.out.println("value is" + value);
}
}




public class CelsiusToFahrenheit {
public static void main(String[] args)
{
System.out.println("35.0 celsius is 95.0 Fahrenheit.");
System.out.println("The conversion formula at the bottom should produce 95.0.");
System.out.println("But it does not. So, how to correct it?");
System.out.println((35*9/5) + 32 );
}
}





public class Welcome
{
public static void main(String[] args) {
System.out.println("Fundamental First!");
System.out.println("Excellence follow suit!");
}
}


2.

a
Data                     
Process
Output
Number of square feet of land
Calculate the number of acres of land
Number of acres of land with square


b
Data                     
Process
Output
Three test scores
Calculate the average of three test scores
Average of three test scores

c
Data                     
Process
Output
Percentage profit and retail price of circuit boards
Calculate profit of circuit board
Profit of circuit board




3.
 a

Data                     
Processing
Output
Acceleration a and take-off speed v
Calculate the minimum runway length needed
Value of minimum runway length needed

public class Airplane {
public static void main(String[] args)
{
double v=60;
double a=3.5;
double length=v*v/(2*a);
System.out.println("length is" + length);
}
}




Tuesday, 18 September 2018




CHOONG KAR YEE
182630
SSK3100 (Group 15)

Morning world!
Today I will explain about what I have learned in SSK3100 course. This is the first lecture and what I learned.
Firstly, download Java via website and install the program in computer.

Next, go to Control Panel - System - Advanced Setting - Environment Variables - System variable - search for ''Path" and edit the variable value by entering the java jdk 10.0.2 bin link into the column.

So now, open the Command Prompt.

FYI : ''mkdir'' stands for create a new folder
         ''cd'' stands for enter the file you created

Create a SSK3100 folder followed by kyee and lab01.




Next, save a notepad in your lab01 file.
Copy the script from attachment that lecturer gave into the notepad and Save as "MyFirstJavaProgram".



''java - version'' - to check on your java version

''set class'' & "set classpath" - This is a exceptional step when you found out your java program is not functioning well. so this step is needed.








When you see ''Hello World'', you are DONE!


But anyway there is some typing error in command. Not to worry, just retype the command and it will goes well.

Practice makes PERFECT! 




Next Blog - http://anjalayraman10.blogspot.com/

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