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
Tags:
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]](https://www.gravatar.com/avatar/b107d14d7d43c142b68c12c377262371.jpg?s=80&d=mm&r=g)
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]](https://www.gravatar.com/avatar/e40ab58e34debd5a0dbf4bcfa90bded0.jpg?s=80&d=mm&r=g)
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]](https://www.gravatar.com/avatar/e40ab58e34debd5a0dbf4bcfa90bded0.jpg?s=80&d=mm&r=g)
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]](https://www.gravatar.com/avatar/035e4f4fed661b8e1c3e066e43cd5e41.jpg?s=80&d=mm&r=g)
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]](https://www.gravatar.com/avatar/c2ef7c316acb82467912bf5677b52a8b.jpg?s=80&d=mm&r=g)
Đường Thanh Bình
2020-03-18 09:20:49
/*
* 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]](https://www.gravatar.com/avatar/c2ef7c316acb82467912bf5677b52a8b.jpg?s=80&d=mm&r=g)
Đường Thanh Bình
2020-03-18 09:20:48
/*
* 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]](https://www.gravatar.com/avatar/e74e3ec62fe3a191929e12eecbe01edf.jpg?s=80&d=mm&r=g)
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]](https://www.gravatar.com/avatar/33675cc9fc3762fd323389a179aa047f.jpg?s=80&d=mm&r=g)
hoangduyminh
2020-03-18 09:16:49
/*
* 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]](https://www.gravatar.com/avatar/04c40301dd027839d265b3c3c9dc6e6b.jpg?s=80&d=mm&r=g)
Đỗ Văn Huấn
2020-03-18 09:16:01
bai1 package javaBasic.Exercise1; package javaBasic.Exercise1; |
bai2 package javaBasic.Exercise2; |
![Trần Anh Quân [T1907A]](https://www.gravatar.com/avatar/7e3a8fe30cedd711f426fc59a9d48efc.jpg?s=80&d=mm&r=g)
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());
}
}
}