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
The advantage of an electronic ____ is that the content can be easily edited and updated to reflect changing financial condition
Lana71 [14]
Computer.................................
6 0
4 years ago
In Microsoft word when you highlight existing text you want to replace , you're in?
lorasvet [3.4K]

Insert Mode

[insert 20 characters]

6 0
4 years ago
Which of the following is a function of the slip yoke used on a driveshaft?
Harrizon [31]
It has to be all of the above because A and B are both true.

<span>It allows movement between the suspension as it reacts to the road surface, which also allows the driveshaft to change length to configure to the road.</span>

7 0
4 years ago
Which term is defined as an exploit that takes place before the security community or software developer knows about the vulnera
Natasha_Volkova [10]

Answer:

A zero-day attack.

Explanation:

A Zero-day vulnerability is a computer-software vulnerability that is unknown to, or unaddressed by, the security community or software developer or even the vendor of the target software. Until the vulnerability is mitigated, hackers can exploit it to adversely affect computer programs, data, additional computers or a network.

An exploit directed at a software with zero-day vulnerability & exploiting this vulnerability is called a zero-day exploit, or zero-day attack.

3 0
3 years ago
The order of precedence determine
Free_Kalibri [48]
The order of precedence is the hierarchical order in which calculations are conducted. The simplest example of this is the way you always multiply before you add numbers.
7 0
4 years ago
Other questions:
  • g Write a program that prompts the user to enter two integers. The program outputs how many numbers are multiples of 3 and how m
    11·1 answer
  • Net Worth is equal to assets minus liabilities. Which event will have the greatest impact (positive or negative) on one's net wo
    5·1 answer
  • Which is currently the most common cellular network?<br> 4G<br> 4G LTE<br> 5G<br> 5G LTE
    13·1 answer
  • PLEASE HELP!!!!!!!!!!!!!!!!!!
    6·1 answer
  • How will you convert a decimal fraction into its hexadecimal form by a process of repeated division and repeated multiplication?
    13·1 answer
  • So lets see what you know...Write me a short code and include a detailed explanation of the language used and what the out come
    7·1 answer
  • Increasing your margins will increase the amount of space you have to type text on your document. Please select the best answer
    10·1 answer
  • What is the minimum number of public IP addresses needed to expose a service running on 10,000 IoT devices having private IP add
    9·1 answer
  • Write a program using integers userNum and divNum as input, and output userNum divided by divNum three times.
    7·1 answer
  • What is a good theme statement for the short Pixar film "bao"?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!