Explanation of Solution
Program:
File name: “Inbetween.java”
//Import necessary header files
import java.util.Scanner;
//Define a class named Inbetween
public class Inbetween
{
//Define main method
public static void main(String args[])
{
//Declare a flag variable
int flag;
//Create an object for Scanner class
Scanner flag1=new Scanner(System.in);
//Prompt the user to enter the first number
System.out.println("Enter first number:");
int first=flag1.nextInt();
//Prompt the user to enter the second number
System.out.println("Enter second number:");
int second=flag1.nextInt();
//If first number is greater than second number
if(first > second)
{
/*For loop to execute every integer between the entered numbers*/
for(flag=second;flag<=first;flag++)
{
//Print the result
System.out...
Trending nowThis is a popular solution!
- can you please write in java.util.scanner form ,can you please make it so i can copy and past it int[] numbers = {345, 632, 675, 157, 834, 294, 832};1. Write a method to find its highest value. 2. Write a method to find its lowest value. 3. Write a method to find its total value.arrow_forwardWrite an application that prints your initials in large block letters. Make each large letter out of the corresponding characters. Use escape sequences to form your initials. Make sure your initials are the same size as the example below. Programming language: JAVA Initial: SParrow_forwardWrite an application that allows a user to enter any number of student quiz scores, as integers, until the user enters 99. If the score entered is less than 0 or more than 10, display Score must be between 10 and 0 and do not use the score. After all the scores have been entered, display the number of valid scores entered, the highest score, the lowest score, and the arithmetic average. ***Java please***arrow_forward
- In Java Create a class WhileEvent3, write code that asks the user to enter a positive or negative number or 'x' 'X' to quit the program. When out of the loop the sum of all numbers entered is printed. READ THE USER'S input as String an not as integer.arrow_forwardThis is a prompt givento me by my proffesor. It is in java(we use netbeans) Use notepad to create a text file with weather information as below. Then write a program to read the weather information from file and find the highest temperature. Cloudy 51 Rainy 52 Sunny 56 Windy 47 Sunny 53arrow_forwardCreate a java class called Question4, and implement the following points inside the main method:1. Reads a string from the standard input device and store it in a variable called inputStr.2. Find all the letter characters in inputStr and store them in another string variable called letterChars. Then, convert all the characters in letterChars to uppercase characters (i.e., capital letters).3. Display the contents of letterChars to the user using a message dialog box.For example, if the contents of inputStr is “q123Ab455c6d”, then the final contents of letterChars will be “QABCD”.arrow_forward
- In Java. Prompt the user for two years. Print all the movies that were released in those years and that have a name that's fewer than 6 characters. File: db.txt Test Case 1 Movie search by year range. Enter two years.\n1970ENTER1974ENTERMovies with short names that were released between 1970 and 1974\nI dag\nIzumi\nJamie\nJamie\nJulie\nJulie\nKako\nKako\nKate\nKojak\nKojak\nKojak\nKojak\nKojak\nLeeds\nMaude\nMeshi\nMily\nNakia\nNakia\nNakia\nNakia\nNancy\nNanou\nTang\nThem\nTimo\nToma\nToma\nToma\nToma\nTotte\nTrial\nUFO\nUFO\nYak\nYak\nZoom\nZut!\nNumber of matches: 39\n Test Case 2 Movie search by year range. Enter two years.\n2050ENTER3000ENTERMovies with short names that were released between 2050 and 3000\nNo matching movies found!\narrow_forwardWrite a Java program in a file called Box.java that outputs a box of stars (*) on the screen. Prompt the user for how big (row x column) the box should be. For example: Please enter the size of the box (row column): 3 4 **** **** ****arrow_forwardWrite an application that reads an integer and determines and prints whether it’s odd or even. [Hint: Use the remainder operator. An even number is a multiple of 2. Any multiple of 2 leaves a remainder of 0 when divided by 2.]arrow_forward
- Write an application that allows a user to enter any number of student quiz scores, as integers, until the user enters 99. If the score entered is less than 0 or more than 10, display Score must be between 10 and 0 and do not use the score. After all the scores have been entered, display the number of valid scores entered, the highest score, the lowest score, and the arithmetic average.arrow_forwardin Java Write a program that establishes two savings accounts with saver1 having account number10002 with an initial balance of $2,000, and saver2 having account 10003 with an initialbalance of $3,000. Set a common rate of interest at 5% per year. At the end of each month,update the balance by adding one month’s interest to the balance, so that the balancecompounds monthly. Print an output that displays the month number and the account numberand the balance for each of the two accounts. Use month 0 to display the initial balances, month1 to display the balances after the first month’s interest, and so on. At the end of the year,display the total balance for both accounts combined, like this:Output:Monthly balances for one year with 0.05 annual interest:Month Account # Balance Account # Balance----- --------- ------- --------- ------- 0 10002 2000.00 10003 3000.00 1 10002 2008.33 10003 3012.50 2 10002 2016.70 10003 3025.05 3 10002 2025.10 10003 3037.66 4 10002 2033.54 10003 3050.31 5…arrow_forwardUsing .java Eclipse, Write a program that prompts the user for a U.S. dollar amount and then converts it to Japanese Yen, British Pound, and New Zealand currency. Once you calculate the conversion, print a single line with each converted currency only showing two decimal places, and its respective code (as shown in the example below): 10 U.S. Dollars in Egyptian Pound (exchange rate = 15.9976) would print as follows after conversion: 10.00 USD in Egyptian Pound is 159.98 EGParrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,