1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Brrunno [24]
3 years ago
5

Java Programming Using nested if statement For a student to be accepted in XYZ College, the student must meet the following requ

irements: GPA must be 3.75 or higher. Family income must be more than $60,000 Applicant must be a New Jersey resident. XYZ college asked you to write a program to implement the above requirements. Write the program using (nested if) Submit: Source code for the program (java file) Output word or pdf or jpg Design pseudocode pdf or word or jpg
Computers and Technology
1 answer:
mihalych1998 [28]3 years ago
6 0

Answer:

Follows are the solution to this question:

import java.util.*;//import package  

public class Main//defining a class

{

       public static void main(String[] ags)//main method  

       {

       float GPA;//defining floating point variable  

       int annual_income;//defining integer variable

       Scanner ga = new Scanner(System.in);//creating Scanner class object

       System.out.println("Enter GPA of student family : ");//print message

       GPA= ga.nextFloat();//input value from user-end

       System.out.println("Enter annual income of student family : ");//print message

       annual_income= ga.nextInt();//input value from user-end

      System.out.println("Is student resident of New Jersey(y/n) :");//print message

       char a=ga.next().charAt(0);//defining char variable to input char value

if(GPA>=3.75) //use if block to check GPA value

       {

        if(annual_income>60000) // use if to check annual income value

         {

            if((a == 'y'|| a== 'Y')) //use if to check char value

   System.out.println("Student accepted in college");//print message

            else//defining else block

             System.out.println("Student is not accepted in college because he/she not resident of New Jersey ");//print message

         }

        else//defining else block

          System.out.println("Student is not accepted in college because annual income is less than $60000 ");//print message

    }

   else//defining else block

    System.out.println("Student is not accepted in college because GPA is less than 3.75 ");//print message

       }

}

Output:

Please find the attached file.

Explanation:

Please find the attached file of the pseudocode.

In this code one integer, one float, and char variable "GPA, annual_income, and a" is declared, that uses the scanner class for accept value from the user-end, and in the next step, nested if the statement is used that checks the GPA value, annual_income, and a value and use the print method to print a value with the message.

You might be interested in
Help me plz What character must always be used when a formula is enter in a cell? (on a spreadsheet)​
lara [203]

Answer:

The equal sign "=" must be used.

Most, if not all, spreadsheet programs support formulas, but you must start them with an equal sign.

8 0
3 years ago
Type the correct answer in the box. Spell the word correctly.
Liono4ka [1.6K]

Translators convert code written in a high-level language to the machine language.

4 0
3 years ago
Read 2 more answers
What term is the ability to restore service quickly and without lost data if a disaster makes your components unavailable or it
oksian1 [2.3K]

Answer:

"Recoverability" is the appropriate solution.

Explanation:

  • The above refers to either the DBMS work timetables where only certain processes are conducted out only when all transactions where such modifications are learned by the submission are implemented or operated.
  • This technique is used to reinstate make informed even without system failures.
8 0
3 years ago
Type the correct answer in the box. Spell the word correctly.
padilas [110]

Answer:t internal firewall

Explanation:

Did this in class

4 0
3 years ago
The Monte Carlo (MC) Method (Monte Carlo Simulation) was first published in 1949 by Nicholas Metropolis and Stanislaw Ulam in th
Eddi Din [679]

Answer:

can you give more detail

Explanation:

3 0
3 years ago
Other questions:
  • Write the interface (.h file) of a class ContestResult containing: An data member winner of type string, initialized to the empt
    14·1 answer
  • Which best describes the benefits of renting a home?
    10·2 answers
  • sqrt is being defined as a variable name, how do I get its math function to... well... function? (Python)
    11·1 answer
  • Fifty part-time students were asked how many courses they were taking this term. The (incomplete) results are shown below. Need
    6·1 answer
  • Which of these statements is true about database reports? A. A generated report will include all records in the database. B. A g
    10·1 answer
  • Whats the correct answer
    15·2 answers
  • Q: Why can't I log in to Brainly
    13·1 answer
  • Which part of project management considers if employees will work at home or in the office?
    10·2 answers
  • Has replaced the need for landline telephones in many instance​
    10·1 answer
  • A bitmap image is provided in two different resolutions. Image 1 has a resolution of 1500 x 1225. Image 2 has a resolution of 50
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!