Java Conditional Statement Practice

Source: Internet
Author: User

Tag: Next can string returns double height condition str sys

/*system.out.println ("Please enter three numbers:");//Enter three digits to return the largest one.
int a,b,c,big;
Scanner d = new Scanner (system.in);
A = D.nextint ();
b = D.nextint ();
c = D.nextint ();

if (a>b)
{
Big=a;
if (big<c)
{
Big = C;
}

}
Else
{
Big=b;
if (big<c)
{
Big = C;
}
}
System.out.println (big); */
/*
SYSTEM.OUT.PRINTLN ("Please input three coefficients of the two-second equation");//One-yuan two-time equation root condition

Double a,b,c,d;
Scanner sc = new Scanner (system.in);
A = Sc.nextdouble ();
b = sc.nextdouble ();
c = sc.nextdouble ();
D = b*b-4*a*c;
if (a==0)
{
System.out.println ("This is not a unary two-time equation");
}
Else
{
if (d>0)
{
System.out.println ("Equation has two real roots");
}
else if (d==0)
{
System.out.println ("Equation has two equal real roots");
}
Else
{
System.out.println ("The equation has no real roots");
}
}
*/
/*system.out.println ("Please enter a year");//Enter a year to see if it is a leap years
Scanner sc = new Scanner (system.in);
int year = Sc.nextint ();
if (year%4 = = 0 && year%100! = 0 | | year%400 = = 0)
{
System.out.println (year+ "is a leap year");
}
Else
{
System.out.println (year+ "Not a leap year");
}
*/
/*SYSTEM.OUT.PRINTLN ("Input Gender: Height: Weight:");//Determine whether the figure is standard
Scanner sc = new Scanner (system.in);
String sex = Sc.nextline ();
Double height = sc.nextdouble ();
Double weight = sc.nextdouble ();
Double Biao;
if (Sex.equals ("male"))
{
Biao = height-100;
if (biao-3{
System.out.println ("good");
}
else if (biao-3>height)
{
System.out.println ("thin");
}
Else
{
System.out.println ("fat");
}
}
else if (sex.equals ("female"))
{
Biao = height-110;
if (biao-3{
System.out.println ("good");
}
else if (biao-3>height)
{
System.out.println ("thin");
}
Else
{
System.out.println ("fat");
}
}

*/

Java Conditional Statement Practice

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.