EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
8th Edition
ISBN: 9781305480537
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
bartleby

Videos

Expert Solution & Answer
Book Icon
Chapter 7, Problem 1PE

Explanation of Solution

Program:

File name: “InputCharacterInfo.java

//Import necessary header files

import java.util.Scanner;

//Define a class named InputCharacterInfo

public class InputCharacterInfo

{

    //Define main method

    public static void main(String[] args)

    {

        //Create an object to the Scanner class

        Scanner sc = new Scanner(System.in);

        //Prompt the user to enter a character

        System.out.println("Enter char: ");

        char aChar = sc.nextLine().charAt(0);

        //Tests if character is uppercase

        if (Character.isUpperCase(aChar))

        {

            //Print the result

            System.out.println(aChar + " is uppercase");

        }

        //Else condition

        else

        {

            //Print the result

            System.out.println(aChar + " is not uppercase");

        }

        //Tests if character is lowercase

        if (Character.isLowerCase(aChar))

        {

            //Print the result

            System.out.println(aChar + " is lowercase");

        }

        //Else condition

        else

        {

            //Print the result

            System.out.println(aChar + " is not lowercase");

        }

        //Returns the uppercase equivalent of the character

        aChar = Character...

Blurred answer
Students have asked these similar questions
Fix the error(s) code in the picture 2, compile and output the results as shown in command prompt below.
CHALLENGE ACTIVITY 5.4.3: Printing output using a counter.   Retype or copy, and then run the following code; note incorrect behavior. Then fix errors in the code, which should print num_stars asterisks.while num_printed != num_stars: print('*')   Sample output with input: 3 * * *   Python for this please.
Find a line with an error in the following code segment: 1: void displayFile(fstream file) {2:   string line;3:   while (file >> line) 4:     cout << line << endl;5: } Group of answer choices 1 2 3 4
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
C - File I/O; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=cEfuwpbGi1k;License: Standard YouTube License, CC-BY
file handling functions in c | fprintf, fscanf, fread, fwrite |; Author: Education 4u;https://www.youtube.com/watch?v=aqeXS1bJihA;License: Standard Youtube License