By GokiSoft.com| 14:54 03/03/2021|
Java Basic

Examination- ADF1 - Java Basic - Thi thực hành - T1907A

Thời Gian Bắt Đầu Thi : 15:20 - 16:20

Các bạn làm xong thi upload code lên chủ đề này cho thầy.

Gửi bài chậm 1 phút -> trừ 0.5 điểm



Phản hồi từ học viên

5

(Dựa trên đánh giá ngày hôm nay)

nguyễn văn huy [T1907A]
nguyễn văn huy

2020-03-18 09:23:06



/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package DeThi;
import java.util.*;
/**
 *
 * @author ASUS
 */
public class main extends ConversUtil{
    public static void main(String[] args) {
       Scanner scan=new Scanner(System.in);
       ConversUtil co=new ConversUtil();
       double temp;
       double cel;
        System.out.println("enter temperature in fahren");
        temp=Double.parseDouble(scan.nextLine());
        System.out.println("enter temperature in cel");
        cel=Double.parseDouble(scan.nextLine());
        System.out.println(co.celm(cel));
    }
}
////
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package DeThi;
import java.util.*;
/**
 *
 * @author ASUS
 */
public class ConversUtil {
    public double fahren(double fDegree){
        return (double)(5/9)*(fDegree-32);
    }
    public static double celm(double cDegree){
        return (double) (9/5)*(cDegree)+32;
    }
}
////
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package DeThi.hai;
import java.util.*;
/**
 *
 * @author ASUS
 */
public class main {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        System.out.println("nhap  mot chuoi");
        String chuoi=scan.nextLine();
        StringTokenizer st=new StringTokenizer(chuoi);
        while(st.hasMoreTokens()){
            System.out.println(st.nextToken());
        }
    }
}



Nguyễn Văn Quang [T1907A]
Nguyễn Văn Quang

2020-03-18 09:22:54



/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package assignment;
import java.util.Scanner;
/**
 *
 * @author Quang
 */
public class Driver {
    public static void main(String[] args)
    {
       
        Double temp;
        Double cel;
        Scanner scan = new Scanner(System.in);
        System.out.println("Enter temperature in Farenheit");
         temp = Double.parseDouble(scan.nextLine());
        System.out.println(ConversionUtil.fahrenheitToCelcius(temp));
        System.out.println("Enter temperature in celcius");
         cel = Double.parseDouble(scan.nextLine());
        System.out.println(ConversionUtil.celciusToFahrenheit(cel));
        
    }
}



/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package assignment;
import java.util.Scanner;
import java.util.StringTokenizer;

/**
 *
 * @author Quang
 */
public class Splitstring {
    public static void main(String[] args)
    {
        Scanner scan = new Scanner(System.in);
        System.out.println("Moi ban nhap vao mot chuoi");
        String m = scan.nextLine();
        
        StringTokenizer st = new StringTokenizer(m);
        while(st.hasMoreElements())
        {
            System.out.println(st.nextToken());
        }
    }
}



Nguyễn Văn Quang [T1907A]
Nguyễn Văn Quang

2020-03-18 09:22:39



/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package assignment;
import java.util.Scanner;
/**
 *
 * @author Quang
 */
public class Driver {
    public static void main(String[] args)
    {
       
        Double temp;
        Double cel;
        Scanner scan = new Scanner(System.in);
        System.out.println("Enter temperature in Farenheit");
         temp = Double.parseDouble(scan.nextLine());
        System.out.println(ConversionUtil.fahrenheitToCelcius(temp));
        System.out.println("Enter temperature in celcius");
         cel = Double.parseDouble(scan.nextLine());
        System.out.println(ConversionUtil.celciusToFahrenheit(cel));
        
    }
}



NguyenHuuThanh [T1907A]
NguyenHuuThanh

2020-03-18 09:20:52



Bai 1:
Conversion: 
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Test;

/**
 *
 * @author abc
 */
public class ConversionUtil {

     public static  double fahrenheitToCelcius(Double fDegree)
    {
        return (double) ((5.0/9.0) * (fDegree - 32));
    }
    
    public static double celciusToFahrenheit(Double cDegree)
    {
        return (double)  ((9.0/5.0) * (cDegree) + 32);
    }

   
    
}
Driver
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Test;
import java.util.Scanner;
/**
 *
 * @author abc
 */
public class Driver {
    public static void main(String[] args)
    {
       
        Double temp;
        Double cel;
        Scanner scan = new Scanner(System.in);
        System.out.println("Enter temperature in Farenheit");
         temp = Double.parseDouble(scan.nextLine());
        System.out.println(ConversionUtil.fahrenheitToCelcius(temp));
        System.out.println("Enter temperature in celcius");
         cel = Double.parseDouble(scan.nextLine());
        System.out.println(ConversionUtil.celciusToFahrenheit(cel));
        
    }
    
  
    
}
Bai 2:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Test;
import java.util.Scanner;
import java.util.StringTokenizer;
/**
 *
 * @author abc
 */
public class Splitstring {
    public static void main(String[] args)
    {
        Scanner scan = new Scanner(System.in);
        System.out.println("Moi ban nhap vao 1 chuoi");
        String a = scan.nextLine();
        
        StringTokenizer st = new StringTokenizer(a);
        while(st.hasMoreTokens())
        {
            System.out.println(st.nextToken());
        }
    }
    
}



Đường Thanh Bình [T1907A]
Đường Thanh Bình

2020-03-18 09:20:49


bài 2
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package JavaBasic;
import java.util.StringTokenizer;
import java.util.Scanner;

/**
 *
 * @author Administrator
 */
public class Exercise2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("Enter a string :");
        String s = scanner.nextLine();

        StringTokenizer string = new StringTokenizer(s);
        while(string.hasMoreTokens()){
            System.out.println(string.nextToken());
        }
    }
}



exercise1

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package JavaBasic;



import java.util.Scanner;

/**
 *
 * @author Administrator
 */
public class Main {
     public static void main (String[]args){
        Scanner scanner = new Scanner(System.in);
        ConversionUtil cover = new ConversionUtil();
        System.out.println("Enter temperature in Fahrenheit");
        Double temp = Double.parseDouble(scanner.nextLine());
        System.out.println(cover.fahrenheitToCelsius(temp));

        Double cel = Double.parseDouble(scanner.nextLine());
        System.out.println(cover.celciusToFahrenheit(cel));

    }
}
     
       
main


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package JavaBasic;



import java.util.Scanner;

/**
 *
 * @author Administrator
 */
public class Main {
     public static void main (String[]args){
        Scanner scanner = new Scanner(System.in);
        ConversionUtil cover = new ConversionUtil();
        System.out.println("Enter temperature in Fahrenheit");
        Double temp = Double.parseDouble(scanner.nextLine());
        System.out.println(cover.fahrenheitToCelsius(temp));

        Double cel = Double.parseDouble(scanner.nextLine());
        System.out.println(cover.celciusToFahrenheit(cel));

    }
}
     
       
execirse1


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package JavaBasic;

/**
 *
 * @author Administrator
 */
class ConversionUtil {
     public double fahrenheitToCelsius(double fDegree){
        return 5 * (fDegree - 32) /9;
    }
    public double celciusToFahrenheit(double cDegree){
        return  (9 * cDegree / 5) + 32;
    }
}




Đường Thanh Bình [T1907A]
Đường Thanh Bình

2020-03-18 09:20:48


bài 2
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package JavaBasic;
import java.util.StringTokenizer;
import java.util.Scanner;

/**
 *
 * @author Administrator
 */
public class Exercise2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("Enter a string :");
        String s = scanner.nextLine();

        StringTokenizer string = new StringTokenizer(s);
        while(string.hasMoreTokens()){
            System.out.println(string.nextToken());
        }
    }
}



exercise1

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package JavaBasic;



import java.util.Scanner;

/**
 *
 * @author Administrator
 */
public class Main {
     public static void main (String[]args){
        Scanner scanner = new Scanner(System.in);
        ConversionUtil cover = new ConversionUtil();
        System.out.println("Enter temperature in Fahrenheit");
        Double temp = Double.parseDouble(scanner.nextLine());
        System.out.println(cover.fahrenheitToCelsius(temp));

        Double cel = Double.parseDouble(scanner.nextLine());
        System.out.println(cover.celciusToFahrenheit(cel));

    }
}
     
       
main


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package JavaBasic;



import java.util.Scanner;

/**
 *
 * @author Administrator
 */
public class Main {
     public static void main (String[]args){
        Scanner scanner = new Scanner(System.in);
        ConversionUtil cover = new ConversionUtil();
        System.out.println("Enter temperature in Fahrenheit");
        Double temp = Double.parseDouble(scanner.nextLine());
        System.out.println(cover.fahrenheitToCelsius(temp));

        Double cel = Double.parseDouble(scanner.nextLine());
        System.out.println(cover.celciusToFahrenheit(cel));

    }
}
     
       
execirse1


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package JavaBasic;

/**
 *
 * @author Administrator
 */
class ConversionUtil {
     public double fahrenheitToCelsius(double fDegree){
        return 5 * (fDegree - 32) /9;
    }
    public double celciusToFahrenheit(double cDegree){
        return  (9 * cDegree / 5) + 32;
    }
}




Phan Bạch Tùng Dương [T1907A]
Phan Bạch Tùng Dương

2020-03-18 09:18:44

Exercise 1:



/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Exam2;

/**
 *
 * @author Admin
 */
public class ConversionUtil {
    public double fahrenheitToCelsius(double fDegree){
        return 5 * (fDegree - 32) /9;
    }
    public double celciusToFahrenheit(double cDegree){
        return  (9 * cDegree / 5) + 32;
    }
}



/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Exam2;

import java.util.Scanner;

/**
 *
 * @author Admin
 */
public class Main {
    public static void main (String[]args){
        Scanner scanner = new Scanner(System.in);
        ConversionUtil cover = new ConversionUtil();
        System.out.println("Enter temperature in Fahrenheit");
        Double temp = Double.parseDouble(scanner.nextLine());
        System.out.println(cover.fahrenheitToCelsius(temp));

        Double cel = Double.parseDouble(scanner.nextLine());
        System.out.println(cover.celciusToFahrenheit(cel));

    }
}
Exercise 2:




/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Exam;

import java.util.Scanner;
import java.util.StringTokenizer;

/**
 *
 * @author Admin
 */
public class Exercise2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("Enter a string :");
        String s = scanner.nextLine();

        StringTokenizer string = new StringTokenizer(s);
        while(string.hasMoreTokens()){
            System.out.println(string.nextToken());
        }
    }
}



hoangduyminh [T1907A]
hoangduyminh

2020-03-18 09:16:49


Bài 2


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package BT2;

import java.util.Scanner;
import java.util.StringTokenizer;
/**
 *
 * @author Minh
 */
public class Exercise2 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("Enter a string: ");
        String data = input.nextLine();
        StringTokenizer st = new StringTokenizer(data);
        System.out.println("Result:");
        while (st.hasMoreTokens()) {
            System.out.println(st.nextToken());
        }
        
    }
}


Bai 1
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ThiThucHanh;

import java.util.Scanner;

/**
 *
 * @author Minh
 */
public class Main {
    public static void main(String[] args) {
         ConversUtil cv = new ConversUtil();
        
        Scanner input = new Scanner(System.in);
        System.out.println("Nhập vào độ Celcius cần đổi: ");
        double cecius = input.nextDouble();
        System.out.println(cecius + "đô C = " + cv.celciusToFahrenheit(cecius) + " độ F");
        System.out.println("Nhập vào độ Fahrenheit cần đổi: ");
        double fahrenheit = input.nextDouble();
        System.out.println(cecius + " độ F = " + cv.fahrenheitToCelsius(fahrenheit) + " độ C");        
    }
}



/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ThiThucHanh;

/**
 *
 * @author Minh
 */
public class ConversUtil {
      public double fahrenheitToCelsius(double fDegree) {
        return 5 * (fDegree - 32) / 9;
    }
      
       public double celciusToFahrenheit(double cDegree) {
        return (9 * cDegree / 5) + 32;
    }
}



Đỗ Văn Huấn [T1907A]
Đỗ Văn Huấn

2020-03-18 09:16:01


bai1

package javaBasic.Exercise1;

public class ConversionUtil {
public double fahrenheitToCelsius(double fDegree) {
double cDegree = 5 * (fDegree - 32) / 9;
return cDegree;
}

public double celciusToFahrenheit(double cDegree) {
double fDegree = (9 * cDegree / 5) + 32;
return fDegree;
}
}
package javaBasic.Exercise1;

import java.util.Scanner;

public class Main {
public static void main(String[] args) {
double temperature;
ConversionUtil conversionUtil = new ConversionUtil();
Scanner scan = new Scanner(System.in);

System.out.println("Enter temperature in Fahrenheit: ");
temperature = Double.parseDouble(scan.nextLine());
temperature = conversionUtil.fahrenheitToCelsius(temperature);
System.out.println("Celsius: " + temperature);

System.out.println("Enter temperature in Celsius: ");
temperature = Double.parseDouble(scan.nextLine());
temperature = conversionUtil.celciusToFahrenheit(temperature);
System.out.println("Fahrenheit: " + temperature);
}
}

bai2

package javaBasic.Exercise2;

import java.util.Scanner;

public class StringTokenizer {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.print("Please enter text: ");
String text = scan.nextLine();
String[] name = text.split(" ");

for (String mName: name) {
System.out.println(mName);
}
}
}



Trần Anh Quân [T1907A]
Trần Anh Quân

2020-03-18 09:14:48

B1


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package baithuchanh;

/**
 *
 * @author Anh Quan
 */
public class ConversionUtil {

    public double fahrenheitToCelsius(double fDegree) {
        return 5 * (fDegree - 32) / 9;
    }

    public double celciusToFahrenheit(double cDegree) {
        return (9 * cDegree / 5) + 32;
    }
}





/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package baithuchanh;
/**
 *
 * @author Anh Quan
 */
import java.util.Scanner;
public class Main {
    
   public static void main(String[] args) {
        ConversionUtil cv = new ConversionUtil();
        Scanner sc = new Scanner(System.in);
        System.out.println("Nhập vào độ Celcius : ");
        double cecius = sc.nextDouble();
        System.out.println(cecius + " độ C = " + cv.celciusToFahrenheit(cecius) + " độ F");
        System.out.println("Nhập vào độ Fahrenheit : ");
        double fahrenheit = sc.nextDouble();
        System.out.println(cecius + " độ F = " + cv.fahrenheitToCelsius(fahrenheit) + " độ C");
    }
}
B2



/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package baithuchanh;

/**
 *
 * @author Anh Quan
 */
import java.util.Scanner;
import java.util.StringTokenizer;
public class Ex2 {
    

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("Enter a string: ");
        String data = sc.nextLine();
        StringTokenizer st = new StringTokenizer(data);
        System.out.println("Result:");
        while (st.hasMoreTokens()) {
            System.out.println(st.nextToken());
        }
    }

}



Đăng nhập để làm bài kiểm tra

Chưa có kết quả nào trước đó