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 OS function does a CLI fulfill? A User interface B Running applications C Hardware interface D Booting
konstantin123 [22]

Answer:

User Interface

Explanation:

4 0
3 years ago
• What advantage does a circuit-switched network have over a packet-switched network? What advantages does TDM have over FDM in
lions [1.4K]

Answer:

Advantages of both circuit switched networks and TDM are given below:

Explanation:

Advantages of circuit switched network over packet switched network:

  • Circuit switched network has the advantage of being physically connected and having a dedicated channel for communication between the sender and the receiver which also makes it more reliable. Packet switched networks do not have a dedicated channel hence, they are not that reliable.
  • Circuit switched networks are used for voice calls because there is no timing jitter or delay in these types of networks while packet switched networks do not offer this advantage.

Advantages of TDM over FDM in a circuit switched network:

  • TDM is time division multiplexing i.e. multiple information is sent in different time intervals but on the same frequency. While FDM sends information using different frequencies. So, the advantage of using TDM is that the information will be sent from the sender to the receiver using only a single frequency.
  • Using TDM, bandwidth is saved because it only sends information on a single frequency unlike FDM.
  • In TDM, there is low chance of interference between signals since they are sent in different time intervals from the sender to the receiver. While FDM has a higher chance of interference.
4 0
3 years ago
A router is connected to a network 192.169.1.0/24 and network 192.168.2.0/24. The router is configured to use RIP and has learne
Mnenie [13.5K]

Answer:

Forward the packet to the next hop router specified by the route network 0.0.0.0

Explanation:

8 0
2 years ago
Which of these can expose a computer to a virus? Check all that apply.
Rina8888 [55]

Answer:

downloads, websites, emails?

4 0
2 years ago
Read 2 more answers
Write a little man program that accepts three values as input and produces the largest of the three as output.
ki77a [65]
Required: program to return the largest of three numbers.

pseudocode

input parameters, int A,B,C;
int T; // temporary storage
if (A>B) T=A;
else T=B;
if (T>C) print(T);
else print(C);


5 0
2 years ago
Other questions:
  • Create a function average_temp(s) that accepts a file name s that contains temperature readings. Each line in the file contains
    15·1 answer
  • In this exercise, you are given a word or phrase and you need to return that word or phrase with the word ‘like’ in front of it.
    5·1 answer
  • List of most popular entertainment and culture websites
    15·1 answer
  • What are two examples of management information systems?
    12·1 answer
  • Why is a class an excellent representation of an abstract data type?
    15·1 answer
  • Write a program that reads a person's first and last names separated by a space, assuming the first and last names are both sing
    10·1 answer
  • Write a Java application that uses the Math class to determine the answers for each of the following: a. The square root of 37 b
    10·1 answer
  • A finally clause will execute:
    8·1 answer
  • To extract detailed and comprehensive responses from your client, use the _____ questioning technique.
    5·2 answers
  • The Operating System is used to locate, move, and copy files.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!