The second process of assessment

Source: Internet
Author: User

https://gitee.com/snjsnjsnj/codes/fwpcmiqray17v4lsjed0331

1:

Import Java.util.Scanner;class Student {
private String name;
private String sex;
private int age;
Public Student() {
this.name = "Tom";
this.sex = "male";
this.age = 15;
}Public void toString(string n, int A, string s) {
this.name = n;
This.sex = s;
this.age = A;
System.out.println ("Student [name= '" + THIS.name + "', sex= '" + This.sex + "', age=" + This.age + "]"); }  }Public class Main {
Public static void main(string[] args) {
Scanner reader =New Scanner (System. in);
String n = reader.next ();int a = Reader.nextint ();
String s = reader.next (); Student ww =New Student ();
Ww.tostring (N, a, s);      Reader.close (); } }2:Import Java.util.Scanner;public class Main {
Public static void main(string[] args) {
Scannerin = new Scanner (System. in);
int[] Grade = new int[5];
For (int i=0; i<grade.length; i++) {
Grade[i] =In.nextint ();
} RR rr =new RT (grade);
double dd = Rr.mark ();
System.out.printf ("%.2f", DD);
}}abstract class rr{
int[] grade;
Public RR(int[] grade) {
This.grade = grade;
}Public abstract double mark();
}class RT extends rr{
}3:Import Java.util.Scanner;Public class main{
Public static void main(string[] args) {
ScannerIn = new Scanner (System. in);
int height, width;
char status;
Height =In.nextint ();
width =In.nextint ();
Board Board =new Board (height, width);
Status = Board.getstatus (); System.out.print (status);
} }class board{
int A, B;
Public Board(int A, int B) {
this.height = A;
This.width = B;
}Public Char getStatus() {
if (a<=b) {
return status (1);
}else{
return Status (1.0);
}    }Public char status(double rate) {
return "B";
}Public char status(int rate) {
return "A";
}} 4:import Java.util.Scanner;Public class main{
Public static void main(string[] args) {
ScannerIn = new Scanner (System. in);
double x1,x2,y1,y2,a,b,disance;
While (in.hasnextdouble ()) {
x1=in.nextdouble ();
X2=in.nextdouble ();
y1=in.nextdouble ();
Y2=in.nextdouble ();
a=x1-x2;    B=y1-y2;    Disance=dis (A, b); System.out.printf ("%.2f", disance);
System.out.println ();
}   }Public static double dis(double x,double y) {
Double D;
D=MATH.SQRT (X*x+y*y);return D;
} }

The second process of assessment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.