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
1. What does the word “processing” in data pro- cessing mean?
blsea [12.9K]

Answer:

Word processing is the process of creating and editing documents on a computer. It allows a user to create documents that mimic the format and style of a typical typewriter. It requires a computer and word processing software. A printer may also be used to create a physical copy of the document.

Explanation:

6 0
2 years ago
Read 2 more answers
Write a program that reads in a text file, infile.txt, and prints out all the lines in the file to the screen until it encounter
ivanzaharov [21]

Answer:

Explanation:

f=open("infile.txt","r")

flag=True

while(flag):

s=f.readline().strip()

if(len(s)>=4):

print(s)

else:

flag=False

8 0
2 years ago
Write a java program as follows Write a method called powOfTwo that takes an integer as parameter, computes, and outputs it’s sq
Kisachek [45]

Answer:

public static int powOfTwo(int input) {

 return input*input;

}

You will have to call this method in main
for printing it, write

System.out.println(powOfTwo(your number));

in public static void main(str[]args) {

}

8 0
2 years ago
Technician A says that oil for the rod bearings comes from splash off the crankshaft. Technician B says that lubrication to the
worty [1.4K]

Answer: technician B

Explanation:

The oil is picked up from the oil pump though a pick up tube that is mounted on the oil pump. The end of the pick up tube sits in the oil at the bottom of the oil pan. The oil is then forced through holes that are drilled into the block. Those holes which are called (journals) lead to the main bearings,rod bearings,lifters, camshaft, ect..

7 0
3 years ago
Hi good morning
Natali5045456 [20]

Answer:

1. SSH/Telnet.

2. SMTP.

3. DNS.

4. DHCP.

5. HTTPS/SSL.

6. FTP

Explanation:

1. Provides connections to computers over a TCP/IP network: the standard protocol used for this is SSH/Telnet, through port number 22 and 23 respectively.

SSH is acronym for secure shell.

2. Sends e-mail over a TCP/IP network: SMTP using port number 25.

SMTP is an acronym for Simple Mail Transfer Protocol and it uses the standard port number of 25 to provide clients with requested services.

3. Translates URLs to IP address: DNS using port number 53.

A Domain Name System (DNS) can be defined as a naming database in which internet domain names (website URLs) are stored and translated into their respective internet protocol (IP) address. This simply means that, DNS is used to connect uniform resource locator (URL) or web address with their internet protocol (IP) address.

4. Automates assignment of IP address on a network: DHCP using port number 67.

Dynamic Host Configuration Protocol (DHCP) is a standard protocol that assigns IP address to users automatically from the DHCP server.

5. Securely transports web pages over a TCP/IP network: HTTPS/SSL using port number 443.

HTTPS is acronym for Hypertext Transfer Protocol Secure while SSL is acronym for Secure Sockets Layer (SSL).

6. Transports files over a TCP/IP network: FTP using port number 20 or 21.

FTP is an acronym for file transfer protocol.

8 0
2 years ago
Read 2 more answers
Other questions:
  • In Linux Operating System, what file extension is used forexecutable files?
    6·1 answer
  • Which is a good technique for effectively proofreading your presentation?
    7·1 answer
  • Which address correctly represents one that is composed of two halves, one assigned to a network adapter manufacturer, and the o
    6·1 answer
  • What is an enterprise system
    14·2 answers
  • Which statement describes borders and shading ?
    13·1 answer
  • IT professionals have a responsibility to educate employees about the risks of hot spots. Which of the following are risks assoc
    13·1 answer
  • Can someone please please please help me!
    10·1 answer
  • Given the statement: int list[25]; The index can go from 0 to 25 inclusive withoutgoing beyond the end of the array.true or fals
    14·1 answer
  • Identify the following​
    9·1 answer
  • Which of the following online creation tools will be used if a person wants to create a video presentation?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!