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
Alenkasestr [34]
4 years ago
9

Write a single Java if-else statement that outputs the value of a char variable GRADE if GRADE is equal to 'A' or 'B' or 'C' or

'D' or 'F'; otherwise, output the message "Input Error".
Computers and Technology
1 answer:
ad-work [718]4 years ago
3 0

Answer:

Following are the program in java is given below

import java.util.*; // import package

public class Main // main class

{

public static void main(String[] args) // MAIN FUNCTION

{

Scanner scan2 = new Scanner(System.in);// scanner CLASS

System.out.println("Enter the Grade ");

char GRADE = scan2.next().charAt(0);//Read input by user

if(GRADE=='A' || GRADE=='B' || GRADE=='C' || GRADE=='D' || GRADE=='F' ) // //CHECK CONDITION

{    

System.out.println("The GRADE is :" +GRADE); // display grade  

}

else // Else block

{

System.out.println(" Input Error"); // display message

}

}

}

Output:

Enter the Grade

D

The GRADE is :D

Explanation:

Following are the description of program

  • Create the object of scanner class for read the value of grade by the user .
  • Read the value of "GRADE" variable by using the scanner class object  scan 2
  • Now check the condition in if block if the "GRADE" is  'A' or 'B' or 'C' or 'D' or 'F' then display the value of the GRADE variable otherwise else block is executed and input error message is displayed .

You might be interested in
What should the shutter speed be on the camera?<br> A. 1/30<br> B. 1/50<br> C. 1/60<br> D. 1/15
11Alexandr11 [23.1K]

Answer:

C. 1/60

Explanation:

Shutter speed is most commonly measured in fractions of a second, like 1/20 seconds or 1/10 seconds. Some high-end cameras offer shutter speeds as fast as 1/80 seconds. But, shutter speeds can extend to much longer times, generally up to 30 seconds on most cameras.

But in this case C. 1/60 is the answer.

6 0
3 years ago
Which command should you use if you want your workbook with a different file name?
klasskru [66]

Answer:

you would right click on the workbook tab you want to change the name on, then you would click Edit Name.

4 0
4 years ago
A _____ is a tool that helps you research information on the Internet.
never [62]

a search engine is a tool that helps you reaserch information on the internet, because it is what you use to type in the info you want to learn more about

6 0
4 years ago
Which technology is used to uniquely identify a wlan network?
expeople1 [14]
The answer is SSID

SSID which in full stands for Service Set Identifier is used to identify a network. It ensures that clients are able to locate a WLAN in which they are attached to. In Layman’s terms, it’s the username or the primary name in a WiFi setup in which a user joins and is connected to.






8 0
3 years ago
Provided you have an Internet connection and functional Web browser, gather information on three different commercial RAID contr
aalyn [17]

Answer:

1). Serial ATA (SATA): SATA drives are base hard drives. Serial ATA was designed to  replace the older parallel ATA (PATA) standard (often called by the old name IDE), offering several advantages  over the older interface: reduced cable size and cost (7 conductors instead of 40), native hot swapping, faster  data transfer through higher signaling rates, and more efficient transfer through a I/O queuing protocol. On  some systems without a controller, these can be cabled instead to the onboard SATA connections on the  motherboard. On smaller servers with a controller, they can still be cabled because these systems will not have  a backplane. Cabled hard drives are not hot swappable.

2). Near Line SAS: Near Line SAS are enterprise SATA drives with a SAS interface, head, media, and rotational  speed of traditional enterprise-class SATA drives with the fully capable SAS interface typical for classic SAS

drives. This provides better performance and reliability over SATA. Basically it is a hybrid between SATA and SAS.

3). Serial Attached SCSI (SAS): SAS is a communication protocol used in Enterprise hard drives and tape drives.  SAS is a point-to-point serial protocol that replaces the older based parallel SCSI bus technology (SCSI). It uses  the standard SCSI command set. These have extra connections through the top of the SATA connection. These  are the top end in performance for electromechanical drives.

4). Solid-State Drive (SSD): An SSD is a data storage device that uses integrated circuit assemblies as memory to  store data persistently. SSD technology uses electronic interfaces compatible with traditional block  input/output (I/O) hard disk drives. SSDs do not employ any moving mechanical components, which  distinguishes them from traditional magnetic disks such as hard disk drives, which are electromechanical  devices containing spinning disks and movable read/write heads. Compared with electromechanical disks, SSDs  are typically less susceptible to physical shock, are silent, and have lower access time and latency. Typically  because of these features, SSD drives can be the fastest I/O in the market today in standard hard drive form factor.

Explanation:

5 0
4 years ago
Other questions:
  • What term describes an instance of a program being executed?
    15·1 answer
  • The efficiency of a screw is low because of _____. width friction length height
    10·2 answers
  • This folder is ndownload and it isn't like download file
    14·1 answer
  • Why does esherick say the name of the boxer rebellion in inaccurate
    5·1 answer
  • What is an input periphal
    8·2 answers
  • What is activated as necessary to support local eocs and to ensure that responders have the resources they need to conduct respo
    5·1 answer
  • What is A cell that can hold or display data​
    11·1 answer
  • Java:
    15·1 answer
  • The _______ displays the data series in separate columns side-by-side so that you can compare the relative heights of the column
    5·2 answers
  • 7. Suppose that a RISC machine uses 5 register windows. a. How deep can the procedure calls go before registers must be saved in
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!