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]
3 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]3 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
Patronage of most Medieval musicians was supplied by the
Arturiano [62]

Answer:

wrong^^its church

Explanation:

3 0
3 years ago
Do the following SQL questions. The resulting columns must all have descriptive names. You must show the result of the query. Fo
Maslowich

Answer:

We can use CREATE command to create tables with columns having descriptive names

Explanation:

Firstly, create a table using CREATE  command in SQL. The syntax is as follows:

CREATE TABLE [table_name]

(

 [col_name] [datatype]),

[col_name] [datatype]),

[col_name] [datatype]),

[col_name] [datatype])

)

Once the table is created, we can insert the data into table using INSERT command. It's syntax is as follows:

INSERT INTO table_name VALUES('', '', '')

if datatype is string, values must be entered within single quotes. If datatype is int, values are entered directly without using  quotes.

Now, you can select the data from  the table using SELECT command. It's syntax is as follows:

SELECT column-list FROM table_name

If you want to filter rows according to conditions, you can use WHERE command.

I have created  sample table and inserted some data into it. Now, I applied some queries on it to select data from the table.

I have written in a text file and attached the same. Please find. Thank you!

Download txt
3 0
3 years ago
What keyboard command opens the Go To dialog box?
Harlamova29_29 [7]

If you mean the search for a phrase or word function on a page,

Left Ctrl + F

7 0
3 years ago
Read 2 more answers
A disgruntled employee can harm a company by launching a computer virus, changing or deleting files, or exposing system password
Setler [38]

Answer:

Threat disgruntled employees

Explanation:

This is a type's threat in a network, why disgruntled employees is a threat?

Because disgruntled employees can implement a plant to damage a company's system when an IT employee be fired.

I t can be difficult to try to protect a system of these threats, Traditionally companies can wait for the less damage, then delete those credentials.

In cloud computing we have IDaaS, where an external company administers the company's credentials, is harder to damage the system in this way.

5 0
3 years ago
Which of the following applies to a DNS caching server? (Choose all that apply.)
Alborosie

Answer:

The answers are:  it is used to enable fast DNS queries and  It can help reduce the amount of network traffic generated by DNS servers.

Explanation:

Because a DNS server can resolve a query from tis local data sends a recursive qyery to a root server.

3 0
3 years ago
Other questions:
  • In an ha configuration, which two failure detection methods rely on icmp ping? (choose two.)
    12·1 answer
  • Graphic designers sometimes must adjust the spacing between letters so that the result looks right to them. This is called
    12·1 answer
  • So when i try to click on an assignment to answer it the ask a question thing pops up and i can't exit out of it. I've tried rel
    10·2 answers
  • What is required for sitting with your seatbelt on while driving?
    7·1 answer
  • What answer best explains why improper netiquette is considered dangerous? Individuals who violate user policies are often charg
    14·2 answers
  • Which line in the following program contains the header for the showDub function? 1 #include 2 using namespace std; 3 4 void sho
    9·1 answer
  • To add a new kind of information into the database you need to add a new table<br> true or false?
    7·2 answers
  • In Secure Electronic Transaction, the purpose of Dual Signature is to link two messages that are intended for two different reci
    5·1 answer
  • Hello everyone! can anybody help me? i need help with computing.
    10·1 answer
  • When one loop appears inside another, the loop that contains the other loop is called the ____ loop. Group of answer choices ind
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!