player is good if the following conditions are satisfied:
He is either from “India”, “Japan” or “Korea”
He has a minimum of 3 years of experience
He has won at least 3 major tournaments, and one of them must be "World Championship Tournament".
He must know more than 10 techniques. (but see next question)
If he knows less than 10 techniques, then he must be a world champion.
His name contains at least 3 words. For example "Sachin Tendulkar" will not meet this condition.
Write a method:
boolean isGoodPlayer(String name, String country, int yearsExperience, String[] majorTournamentsWon, String[] techniques, boolean isWorldChampion)
name
country
yearsExperience
majorTournamentsWon
techniques
isWorldChampion
Answer / ranjeet great
//I am not posting solution..You do your wprk by own..just use it..
import java.util.Scanner;
public class RanjeetGreatJavaClass
{
public static void main(String args[])
{
int age;
String firstname,middlename,lastname,degree;
boolean hasOwnClinic;
Scanner in = new Scanner(System.in);
System.out.println("Enter First Name :");
firstname = in.nextLine();
System.out.println("Enter Middle Name");
middlename = in.nextLine();
System.out.println("Enter Last Name");
lastname= in.nextLine();
System.out.println("Enter Degree");
degree= in.nextLine();
System.out.println("Enter Age");
age = in.nextInt();
System.out.println("Dr has his own Clinick ?");
Scanner scanner = new Scanner(System.in);
String answer = scanner.nextLine();
Boolean yn = (answer.equalsIgnoreCase("Y") ? true : false);
System.out.println(yn);
/*
if(scanner.nextBoolean()==true)
{
System.out.println("Dr has his own Clinik");
}
else
{
System.out.println("Dr don't have his own Clinik");
}
*/
System.out.print("How Many Patients :");
int totalPatients = in.nextInt();
String[] patientsname = new String [totalPatients];
//allows user to input Patientst names
for(int j = 0; j < patientsname.length;j++)
{
System.out.println(j);
System.out.print("Enter Patients Names:");
patientsname[j] = in.nextLine();
}
if (!degree.equalsIgnoreCase("MBBS"))
{
System.out.println("He must have at least 1000 Patients");
}
if (firstname.length()>5&& middlename.equalsIgnoreCase("kumar")&&age>25&°ree.equalsIgnoreCase("MBBS") )
{
for(int i = 0; i < patientsname.length;i++)
{
if(patientsname[i].equalsIgnoreCase("DEVESH")&& totalPatients>200);
{
System.out.println("He is a Good Doctor");
}
if(totalPatients>500&&yn.equals("true"))
{
System.out.println("He is a Good Doctor");
}
}
}
else
{
System.out.println("He is a Bad Doctor");
}
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
consider the following structure: struct num nam{ int no; char name[25]; }; struct num nam n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}}; ..... ..... printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1); What does the above statement print? a.8,9 b.9,9 c.8,8 d.8,unpredictable value
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
program to convert a integer to string in c language'
can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......
Why can’t we compare structures?
What is a loop?
What will be the outcome of the following conditional statement if the value of variable s is 10?
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
What are local variables c?
differentiate built-in functions and user – defined functions.
can we define a function in structure?
How can you access memory located at a certain address?