package practical1q3;
/**
*
* @author chunh00ng
*/
import java.util.Scanner;
public class Practical1Q3 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int test1, test2, sum;
System.out.print("Enter an 8 digit number : ");
int cardNum = scanner.nextInt();
{
int newNum1 = cardNum + (10 - (sum % 10));
System.out.println("The valid number should be " + newNum1);
}
}
}
public static int checkNum(int num){
int total = 0, temp;
Output :
Practical 2 Question 1
package unitconverter;
/**
*
* @author chunh00ng
*/
Output :
Practical 2 Question 2
Average.java
package average;
/**
*
* @author chunh00ng
*/
public class Average {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int n1 = 12, n2 = 23, n3 = 34, n4 = 45, n5 = 56;
double d1 = 1.23, d2 = 2.34, d3 = 3.45, d4 = 4.56, d5 = 5.67;
Calculator.java
package average;
/**
*
* @author chunh00ng
*/
public class Calculator {
Output :
Practical 2 Question 3
package p2q3;
/**
*
* @author chunh00ng
*/
public class P2Q3 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int num = 0;
Output :