Traditional Culture Encyclopedia - Weather inquiry - How to use web service to realize automatic updating of weather forecast newspapers on asp pages?
How to use web service to realize automatic updating of weather forecast newspapers on asp pages?
Public class method {
//The parameter is the letter entered.
Public void print weather (string input char)
{
//Displays the entered letters.
if(input char . equalsignorecase(" d "))
{
system . out . println(" dry ");
}
if(input char . equalsignorecase(" m "))
{
system . out . println(" wet ");
}
if(input char . equalsignorecase(" h "))
{
system . out . println(" hot ");
}
if(input char . equalsignorecase(" r "))
{
system . out . println(" rain ");
}
other
{
System.out.println ("input error");
}
}
}
Two. Followed by the execution class:
Import java.util. *;
Common class test {
Public static void main(String[] args) {
Scanner input = new scanner (system. in);
String weather =
String answer = "";
Method method = newmethod ();
do
{
System.out.println ("Please enter the first letter (d, m, h, r)");");
//Receive the entered weather.
Weather = input.next ();
//Call the method, passing in parameters.
Method.printWeather (weather);
System.out.println ("Do you want to continue typing?" );
//Whether the reception is input as n
The answer = input.next ();
}while(! answer . equalsignorecase(" n "));
}
}
- Related articles
- How to evaluate the animated film The Son of the Weather?
- Snowy solar terms friends circle warm heart copy
- Is soaking feet good for your health in summer? What water is good for soaking feet in summer?
- Storms and tornadoes hit Central America. What is it that hail is bigger than softball?
- The weather in northeast Jilin
- How many districts are there in Guangzhou?
- Is there water in Lijiang River in Guilin in March?
- The air quality in Beijing is better than that in Shanghai.
- More than 50 scenic spots in Hunan stopped during the flood season?
- Why is the temperature difference too big recently?