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]
2 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]2 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
Which type of device log contains the most beneficial security data?
zhuklara [117]
The security Log is your Answer.
6 0
3 years ago
What is this tool called?
kondor19780726 [428]
Is there a picture????????
4 0
3 years ago
Read 2 more answers
Namespaces cannot have namespaces as members.<br><br> True<br><br> False
Anna71 [15]

Answer:

False

Explanation:

namespaces can be nested. That is we can have a hierarchy of namespaces.

For examples suppose we have a namespace top. Within this we have another namespace first. At the next level we have a namespace called second. Then we have a class MyClass as a member of this namespace second. Then the complete description of the class will be as follows:

top::first::second::MyClass

5 0
3 years ago
Select the correct answer.
Umnica [9.8K]

Answer:

OB. by zooming in on them

hope it helps

7 0
2 years ago
True or false with reason :- profit and loss account is a real account​
frosja888 [35]

Answer:

False

Explanation:

Account of expenses, losses, gains, and incomes is called the Nominal account. Profit and Loss Account contains all indirect expenses and indirect incomes of the firm. Therefore, Profit and Loss Account is a Nominal Account and not a real account.

:)

5 0
2 years ago
Other questions:
  • As the driver it is not your responsibility that you are focused on the driving task with any possible distractions minimized. T
    9·2 answers
  • Which term describes the process by which light passes through an object or a medium.
    7·2 answers
  • Your car must have two red stoplights, seen from ______ feet in the daytime, that must come on when the foot brake is pressed.
    6·1 answer
  • So i'm trying to figure out why this code wont run can anyone help me
    8·1 answer
  • EASY POINTS what favorate food<br> so easy
    7·2 answers
  • What do application in productivity suites have in common
    5·1 answer
  • What are 2 ways computers can connect to a network?
    5·1 answer
  • Please help!!
    6·1 answer
  • Why does my laptop keep disconnecting from the wifi.
    13·1 answer
  • Write a program that accepts the lengths of three sides of a triangle as inputs. the program output should indicate whether or n
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!