subject

Public class Question1
{
/* For this Exercise, you will be writing 8 different conditional expressions in order to solve a stated problem.
* There are five variables being passed as arguments to this method that you will use as part of your solution:
* An int variable with the identifier age
* A String variable with the identifier personName
* A Student variable with the identifier aStudent
* Two boolean variables with the identifiers a and b
*
* 1) Declare a boolean varaible with the identifier condition1 and assign it a value based on the following instructions:
* The value of a boolean expression involving the int variable age that evaluates to true based on the following conditions:
* The value of age is greater than or equal to 65.
*
* 2) Declare a boolean variable with the identifier condition2 and assign it a value based on the following instructions:
* The value of a boolean expression involving the String personName that evaluates to true based on the following conditions:
* The person's name comes before 'N' alphabetically (i. e., their names starts with A - M)
*
* 3) Declare a boolean variable with the identifier condition3 and assign it a value based on the following instructions:
* The result of a boolean expression involving the Student variable aStudent that evaluates to true based on the following conditions:
* The ID of the student contains no more than 7 digits in it.
*
* 4) Declare a boolean variable with the identifier condition4 and assign it a value based on the following instructions:
* The result of a boolean expression involving the int variable age that evaluates to true based on the following conditions:
* The value of age is in the range 18 to 24 inclusive.
*
* 5) Declare a boolean variable with the identifier condition5 and assign it a value based on the following instructions:
* The result of a boolean expression involving the String variable personName that evaluates to true based on the following conditions:
* The first or last letter in the String is an 'a' regardless of case (i. e., 'A' is also valid)
*
* 6) Declare a boolean variable with the identifier condition6 and assign it a value based on the following instructions:
* The result of a boolean expression involving the Student variable aStudent that evaluates to true based on the following conditions:
* The student's average grade for 3 exam scores is greater than 60.
*
* 7) Declare a boolean variable with the identifier condition7 and assign it a value based on the following instructions:
* The result of a boolean expression involving the Student variable aStudent and the String variable personName that evaluates to true based on the following conditions:
* The combined length of personName and the student's name is less than 10 characters or greater than 20 characters.
* You should exclude spaces from your calculation.
*
* 8) Declare a boolean variable with the identifier condition8 and assign it a value based on the following instructions:
* The result of a boolean expression involving the boolean variables a and b that models the logical implication ( -> ) operator. The expected behavior is:
* if both a and b are true, a -> b (i. e., a implies b) is true
* if a is true and b is false, a -> b (i. e., a implies b) is false
* if a is false, a -> b (i. e., a implies b) is true regardless of the value of b
*
* HINT: It is not necessary to use any if statements to complete this part of the Lab04 assignment.
* CHALLENGE: Make all of your solutions a single statement.
*/
public static boolean[] question1(int age, String personName, Student aStudent, boolean a, boolean b)
{
// Your code goes here:

// Necessary for unit tests. Do not modify.
return new boolean[] {condition1, condition2, condition3, condition4, condition5, condition6, condition7, condition8};
}

// Main method for testing code.
public static void main(String[] args)
{
// Modify these values to test your code
int age = 17;
String personName = "Betty";
Student aStudent = new Student();
boolean a = false;
boolean b = true;

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:00
Which database model is best used for data warehouse and data mining
Answers: 3
question
Computers and Technology, 24.06.2019 05:30
Cómo pongo un tomo de llamada sin pagar?
Answers: 1
question
Computers and Technology, 24.06.2019 08:20
Evaluate the scenario below and indicate how to handle the matter appropriately. situation: michael received an e-mail from what he thought was his doctor’s office, requesting his social security number. since he had just been in to see his doctor last week, he replied to the e-mail with his social security number.
Answers: 2
question
Computers and Technology, 24.06.2019 10:00
Which two technologies support the building of single-page applications?
Answers: 2
You know the right answer?
Public class Question1
{
/* For this Exercise, you will be writing 8 different conditi...
Questions
question
Biology, 15.04.2021 18:30
question
Social Studies, 15.04.2021 18:30
question
Mathematics, 15.04.2021 18:30
question
Mathematics, 15.04.2021 18:30
question
Mathematics, 15.04.2021 18:30
question
Mathematics, 15.04.2021 18:30
Questions on the website: 13722367