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, 23.06.2019 16:30
Monica and her team have implemented is successfully in an organization. what factor leads to successful is implementation? good between different departments in an organization leads to successful is implementation.
Answers: 1
question
Computers and Technology, 24.06.2019 00:50
3. what is the output of the following statements? temporary object1; temporary object2("rectangle", 8.5, 5); temporary object3("circle", 6, 0); temporary object4("cylinder", 6, 3.5); cout < < fixed < < showpoint < < setprecision(2); object1.print(); object2.print(); object3.print(); object4.print(); object1.set("sphere", 4.5, 0); object1.print();
Answers: 1
question
Computers and Technology, 25.06.2019 01:40
The instantiation of an endpoint in a potential tcp connection is know as
Answers: 1
question
Computers and Technology, 25.06.2019 08:00
Astrategy for speeding up hard drive performance is
Answers: 2
You know the right answer?
Public class Question1
{
/* For this Exercise, you will be writing 8 different conditi...
Questions
question
Mathematics, 30.04.2021 18:40
question
Biology, 30.04.2021 18:40
question
Mathematics, 30.04.2021 18:40
question
Mathematics, 30.04.2021 18:40
Questions on the website: 13722367