EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 6, Problem 2PE
Explanation of Solution
Program:
File name: “EvenEntryLoop.java”
//Import necessary header files
import java.util.*;
//Define a class named EvenEntryLoop
public class EvenEntryLoop
{
//Define main method
public static void main(String args[])
{
//Declare a variable
int number;
//Create an object for the Scanner class
Scanner in = new Scanner(System.in);
//While condition
while (true)
{
//Prompt the user to enter a number
System.out.print("Enter a number: ");
number = in...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Write an application named, Lab14.java. This application will do the following: 1. Display an introductory message 2. Choose a random word from the file, wordlist.txt, and display it 3. Disguise the selected word, and display it 4. Ask the user whether to continue, i.e., whether to repeat steps 2, 3, and 4, or quit the application Once the user chooses to stop the application: 5. Display the total number of vowels hidden 6. Display the total number of consonants hidden 7. Display termination message The user will be asked whether to continue playing and will indicate that another game is to be played by answering ‘y’ or ‘Y’ in response to the question, “Want to play again?” asked by the program after displaying each chosen word and its disguised version. If the user’s response is any character other than ‘y’ or ‘Y’, the totals are displayed and then the application termination message is displayed. See examples below. About randomly choosing a word from the file, wordlist.txt, found on…
Write an application in which the user can enter a date using digits and
slashes (for example, "6/24/2012"), and receive output that displays the
date with the month shown as a word (such as “June 24, 2012"). Allow for
the fact that the user might or might not precede a month or day number
with a zero (for example, the user might type "06/24/2012" or “6/24/2012").
Do not allow the user to enter an invalid date, defined as one for which the
month is less than 1 or more than 12, or one for which the day number is
less than 1 or greater than the number of days in the specified month. Also
display the date's ordinal position in the year; for example, 6/24 is the
176th day. In this application, use your knowledge of arrays to store the
month names, as well as values for the number of days in each month so
that you can calculate the number of days that have passed. Figure shows
the output when the user has entered 6/24/2012. Save the application as
Date.java
Input
Enter a date in the format…
PLEASE DO IT IN JAVA-LIKE ECLIPSE!!
Create an EvensAndOdds application that generates 25 random integers between 0 and 99 and thendisplays all the evens on one line and all the odds on the next line. Application output should looksimilar to:
Knowledge Booster
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
- For Java Write an application that prompts the user for a password that contains at least two uppercase letters, at least three lowercase letters, and at least one digit. Continuously reprompt the user until a valid password is entered. Display Valid password if the password is valid; if not, display the appropriate reason(s) the password is not valid as follows: The password did not have enough of the following: uppercase letters lowercase letters digitsarrow_forwardCode with comments and output screenshot is must for an Upvote. Thank you! Using Java: Create a random 2000-digit number and store it in a file. Read the number from the file and find the smallest number within our larger number that contains at least every digit. For instance,149485420251367 contains every digit, but 94556780231 is a smaller number that contains every digit.arrow_forwardWrite an application that counts by five from 5 through 500 inclusive and that starts a new line after every multiple of 50 (50,100,150 and so on).Save the file as CountByAnything.javaarrow_forward
- A customer in a store is purchasing three items. Write a JavaFx application that asks for the price of each item, tax %, and whether item will be picked up or delivered; Then display the subtotal of the sale, the amount of sales tax, and the total, if items are to be delivered, add fee to the total cost.your program should at least 4 methods: 1. A method to get the price of item and return as double array. 2. A method that receives the price array and tax % as parameters, calculates the sales tax, and returns the sales tax. 3. A method that receives the total price, sales tax, and delivery fee as parameters, and displays all along with the subtotal. 4. A main method where the above are called appropriately to solve the problem.arrow_forwardJava:arrow_forwardcan you please do this in java eclipse idearrow_forward
- Please do this program in Java programming language onlyarrow_forwardMust be in JAVA. Please show in simplest form and with comments.arrow_forwardWrite an application that determines whether a phrase entered by the user is a palindrome. A palindrome is a phrase that reads the same backward and forward without regarding capitalization, spaces or punctuation. And it will allow the user to enter as many phrases as he likes after each iteration.arrow_forward
- PLEASE DO IT IN JAVA!! Create a Palindrome application that prompts the user for a string and then displays a messageindicating whether or not the string is a palindrome. A palindrome is a word or phrase that isspelled the same backwards and forwards. For example, “mom” is a palindrome, as well as “kayak”and “Never odd or even”.arrow_forwardA Java Practical Assignments.pdf - Adobe Acrobat Pro DC (32-bit) File Edit View E-Sign Window Help Home Tools Java Practical Assig. x Sign In 1 /1 139% Java Practical Assignments 1. Write an application that throws and catches an ArithmeticException when you attempt to take the square root of a negative value. Prompt the user for an input value and try the Math.sqrt() method on it. The application either displays the square root or catches the thrown Exception and displays an appropriate message. 2. Create a program that allows a user to input customer records (ID number, first name, last name, and balance owed) and save each record to a file. 3. Write an application for Limpopo's Car Care Shop that shows a user a list of available services: oil change, tire rotation, battery check, or brake inspection. Allow the user to enter a string that corresponds to one of the options, and display the option and its price as R250, R220, R150, or R50, accordingly. Display an error message if the…arrow_forwardJAVAWrite a program that will add and remove the following name and phone number list. (List on image below) Once lists of names and phone numbers are added to the program, the program will ask a user whether there is an item to be removed or not. If it is, it will be removed. Otherwise, the program is terminated. The program will delete items continuously if requested. The result of the program looks like following:arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Files & File Systems: Crash Course Computer Science #20; Author: CrashCourse;https://www.youtube.com/watch?v=KN8YgJnShPM;License: Standard YouTube License, CC-BY
UNIX Programming (Part - 10) The File System (Directories and Files Names); Author: ITUTEES;https://www.youtube.com/watch?v=K35faWBhzrw;License: Standard Youtube License