Test Case 1 Enter number of seconds \n
Q: Code the following statments in JAVA If your average time to run each mile is under 11 minutes,…
A: Step-1: StartStep-2: Declare variable avgTime and take input from userStep-3: if avgTime is greater…
Q: Create a Java class that accepts a number The input number must be between 10 and 99. You must…
A: Your java program is given below as you required with an output.
Q: e an application that reads English-Language phrase and encodes it into morse code. also write an…
A: Hey there, fellow coder! Let's build a Java application to encode English phrases into Morse code…
Q: Write an application that reads an integer value from the user and prints the sum of all even…
A: Solution :
Q: A software company sells a package that retails for $99. Quantity discounts are given. Purchasing…
A: Algorithm: Start Read no.of packages n Calculate total=n*99 Initialize discount to 0 If n>=10…
Q: Write a program that allows a user to enter a series of numbers and displays frequency of each…
A: Required: Write a program that allows a user to enter a series of numbers and displays frequency…
Q: company has 5 stores {1, 2, 3, 4, 5}. The sales for each store is as follows: {200, 300, 400, 500,…
A: Program Approach: 1- Create a class name as Main.2- Inside the class name declare the java main…
Q: In Java 2.25 LAB: Leap year A year in the modern Gregorian Calendar consists of 365 days. In…
A: Prompt the user to input a year.Read the input year.Check if the year is divisible by 4 and not…
Q: in java First, read the first floating-point number from input. Then, read the remaining…
A: The objective of the question is to read floating-point numbers from the input and count the number…
Q: Write a program java that reads a number of feet from the user, then prints out either the same…
A: Start Input feet If the feet is less than 1 print Number out of range endif else if feet < 5280…
Q: answer in java: How cold is it outside? The temperature alone is not enough to provide the answer.…
A: import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner input…
Q: you are asked to test the log10 function (double log10(double a)) in Java Math library. You do not…
A: In order to guarantee the accuracy, dependability, and robustness of software applications, software…
Q: A half-life is the amount of time it takes for a substance or entity to fall to half its original…
A: I have provided JAVA CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT------------------
Q: Please make a Huffman program code that will allow the user to do the following: Input a series of…
A: Description: A java program that does the following is described in the next sections: Input a…
Q: Ask the user for a number of seconds. Display the number of minutes, seconds, and hours accordingly.…
A: Here, Code instruction is given.
Q: Ask the user for a name and for a list of test scores. Show the number of tests taken and the…
A: Here I have taken input from the user for the name and then created a list to store the marks. Next,…
Q: write a program in java for converting binary numbers to decimal numbers, and conversely. [You can…
A: import java.util.*;public class Main{ // function to convert binary to decimal public static int…
Q: In Java Please. Write a unit conversion program that asks the users from which unit they want to…
A: Here is the java program of the above problem. See below steps.
Q: I need help with creating a Java program described below: A Game of Twenty-One: Write a…
A: 1. Create a Die class to simulate rolling a six-sided die: - Define a Die class with a method…
Q: **This is programming with Java. Im a bit confused.. When answering if you could be kind enough to…
A: Answer: Our instruction is answer the first three part from the first part and I have done code…
Q: Output a half pyramid of stars with a height determined by the user. If the user enters a number…
A: Given: To write a java program to Output a half pyramid of stars with a height determined by the…
Q: in java: Write a program that reads the following information and prints a payroll statement:…
A: To create a payroll statement in Java, we need to read the employee's information (name, hours…
Q: 1. Write a program that reads a Celsius degree in a double value from the console, then converts it…
A: As per the requirement program is completed. Algorithm: Step 1: Write the main() method Step 2:…
Q: In java Write a program that does the following:- reads an unspecified number of integers-…
A: Create an object for a Scanner class to take the inputs. Take a variable to insert the numbers. Take…
Q: Write a code in Java: Write a program that will prompt the user for a temperature, and a choice to…
A: Java Code: import java.util.Scanner; public class Main{ public static void main(String[] args) {…
Q: in Java Tasks Write a program that lets the user play the game of Rock, Paper, Scissors against the…
A: import java.util.Scanner; public class Main{ //Function to return computer Choice public…
Q: Java Programming: Write a command line game that plays a simple version of blackjack. The program…
A: Algorithm: Step 1 Start. Step 2 Import the Scanner and Random classes from the java.util package.…
Q: The number of innings (rounds) should be set by a constant Each inning, collect the score for the…
A: The program is written in Java. Check the program screenshot for the correct indentation. Please…
Q: Writing a Modular Program in Java Summary In this lab, you add the input and output statements to a…
A: Java code with given sample syntax is provided below :
Q: The following problem shows up in a number of Java texts, including Savitch's textbook: The…
A: The below program prompts the user to enter weight, height, age and sex, then calculates the basal…
Q: Java Class: Fundraiser You are a fundraising distributor who needs to to pre-sell a limited number…
A: A java program is defined as a class with a main function defined inside the class. The main program…
Q: In Java inputs and output values can easily be manipulated, for example when dealing with money the…
A: The, code has given below:
Q: Write a java program named: CoinConverter.java (Note: We do not need loops for this program.) This…
A: Here have to determine about the coin conversation code in java.
Q: Write a Java regular expression for each of the following: a. Phone numbers, such as (609) 555-1234…
A: Introduction: A string of letters called a regular expression creates a search pattern. This search…
Q: generate three single digit integers and prompt the user to enter the sum
A: In Java Write a program that generates two integers and prompts the user to enter the sum of these…
Q: In Java 8, I want the program to capture the current year and compare it to an input value.…
A: Step-1: StartStep-2: Declare variable currentYear and get current year with the help of Year…
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 7 images
- Output a half pyramid of stars with a height determined by the user. If the user enters a number less than one, exit. Write in java that will results like test case examplesIn java Write a program that computes the average of 5 students grades which are entered by the user.First code is top, second code is on bottom. This is for Java. What makes these two codes different? (a) If x = 3, what will the first (code) print out? (b) If x = 3, what will the second (code) print out? (c)If x = 1, what will the first (code) print out? (d) If x = 1, what will the second (code) print out?
- JAVA CODE Write a program that quizzes the user on the names of the capital cities for all the states in the United States. Each state is presented to the user, and they must enter the name of the capital. The program then either tells the user they're correct or tells them the correct answer. The user's answer should not be case-sensitive. At the end, the program tells the user the total number they got correct. Here's an example: What is the capital of Alabama? Montogomery The correct answer is Montgomery. What is the capital of Alaska? juneau That is the correct answer! ... You got 32 out of 50 correct! The state capitals will be stored in a 2D String array of size 2 x 50, with the first column the name of the state and the second the name of the capital city, for all 50 states. To create the state capitals array, follow these instructions: Copy the String from the attached file into your program (found below these instructions). The String is a pipe delimited list of states and…Java Calculating the User's Sum Write a complete program that reads in numbers and calculates the sum of the numbers in that range. Code Specifications In the main method, read input from the user. Read in two integers from the user: a lower end of the range and an upper end of the range. Check if the numbers are valid: the lower number cannot be greater than the upper number. If the numbers are invalid, use a loop to ask for new numbers. Continue looping until you get two valid values. Write a method called calculateTheSum. The method takes in a lower and upper end of the range. The method calculates the sum of all values from lower (inclusive) to upper (inclusive). Invoke the method from main the output the result. Test Cases I recommend testing your code using the test cases below. I've listed the user inputs along with a sample of the result. User Inputs Result lower = 10, upper = 1 the program should ask for new input lower = 5, upper = -5 the program should ask…Any help with this question would really help!! Write the following exercise using Java code. Add comments in the program to explain what your code is doing. Duke Shirts sells Java t-shirts for $24.95 each, but discounts are possible for quantities as follows: 1 or 2 shirts, no discount and total shipping is $10.003-5 shirts, discount is 10% and total shipping is $8.006-10 shirts, discount is 20% and total shipping is $5.0011 or more shirts, discount is 30% and shipping is free Write a Java program that prompts the user for the number of shirts required. The program should then print the extended price of the shirts, the shipping charges, and the total cost of the order. Use currency format where appropriate.
- Prompt the user for a number x and output the sum of all numbers from 1 to x. If the number entered it less than zero, output an error message. Write a code in Java that will result like test case examples .Intro to Java Instuctions: Design and implement a program that reads a series of 10 integers from the user and prints their average For each of the 10 numbers input from the user: one at a time, prompt the user to enter a number. Then read input from the user as a string. Attempt to convert it to an integer using the "Integer.parseInt" method. If the process throws a "NumberFormatExeption", print an appropriate error message and prompt the user for the number again. Continue prompting and reading in number until 10 valid integers have been read Print "The average is" and then print the average of the 10 numbers Code: import java.util.Scanner; public class Lab1MainClass { public static final int VALUES_TO_READ = 10; public static void main(String[] args) { // local variables int[] values = new int [VALUES_TO_READ]; double average; Scanner scan = new Scanner(System.in); int values Read = 0; // how many numbers the user has given us, a count of where we are String userInput; // read…A company has 5 stores {1, 2, 3, 4, 5}. The sales for each store is as follows: {200, 300, 400, 500, 600}. The tax rate is 6% Write a java program that: 1) Calculates the sales tax for each store and the total sales tax for the company.
- I need help with creating a Java program described below: Counting primes. ESP GameWrite a program that tests your ESP (extrasensory perception). The program should randomly select the name of a color from the following list of words:Red, Green, Blue, Orange, Yellow To select a word, the program can generate a random number. For example, if the number is 0, the selected word is Red, if the number is 1, the selected word is Green, and so forth. Next, the program should ask the user to enter the color that the computer has selected. After the user has entered his or her guess, the program should display the name of the randomly selected color. The program should repeat this 10 times and then display the number of times the user correctly guessed the selected color.In java Develop a function that takes two integers and returns the sum of the values from the first to the second (the two inputs may be in any order). Call the function at least twice with different arguments Develop a void function PrintLineOfChar that accepts a single character and an integer. The function prints a single line of the character repeated the integer number of times. Call the function at least twice with different arguments.Hey all, Need some help on best way to go about this question. All coding is done in Java. I am using the IntelliJ Idea, as the base for the code if it helps. Question is as follows: A car’s miles-per-gallon (MPG) can be calculated with the following formula: MPG = Miles driven / Gallons of gas used Write a java program that prompts the user for the number of miles driven and the gallons of gas used. It should calculate the car’s miles-per-gallon and display the result on the screen.