Question: In Class Activity 1 : IF ELSE Write an external file that includes a method for each of the following: A method that receives one
In Class Activity : IF ELSE
Write an external file that includes a method for each of the following:
A method that receives one integer and determines if the integer is positive or negative. The method will return a if the integer is negative, a zero if the integer is a or a if the integer is positive.
A method that receives one integer age and determines if the User is eligible to vote or not. If the age is or greater then print out that they are eligible to vote. Otherwise compute how many years they must wait to vote and print that out.
A method that receives one integer and determines whether or not the integer is odd or even. If the integer is odd then return a If the integer is even then return a
A method that receives two integers and determines which is the largest. Print out which of the two integers is greater and which is lesser.
A method that receives two strings and determines if they are equal or not. Return a true if equal or a false if not equal. You must use the String methods when comparing strings.
Write a Driver with a main method that does each of the following:
Prompt the User to enter a positive or negative integer. Send the integer to a method to determine if the integer is positive or negative. Print out a message stating whether or not the number entered was positive or negative.
Prompt the User to enter their age. Send the age integer to a method to determine if the User is eligible to vote.
Prompt the User to enter a positive integer. Send the integer to a method that will determine if the number is odd or even.Print out a message stating if the integer is odd or even.
Prompt the User to enter two integers. Send the two integers to a method that will determine which of the two integers is greater and which is lesser.
Prompt the User to enter a password string Send the User's password and the saved password to a method that will determine if the password is correct or not. Print out whether or not the password is correct.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
