Homework01. Write a Java program that prompts the user to enter the seconds as a String (e.g., "1500500500"), converts the received value to long, and displays the number of years and days for the received seconds. For simplicity, assume a year has 365 days. Here is a sample run: Enter the number of seconds: 1500500500 '1500500500' seconds is approximately '4' years and '2766' days
Q: Write a java program called PalinPerfect that finds all palindrome perfect squares between two…
A: Code : import java.util.Scanner; public class PalinPerfect { public static void main(String[]…
Q: Write a java program that reads in three strings and sorts them alphabetically. You can ask to enter…
A: In Java, we have s1.compareTo(s2) method which compares the given strings. and on the basis of…
Q: Write a Java program to generate two random numbers between 0 and 100. After that ask user to…
A: In the main fucntion Randomly generate two numbers print prompt "Enter the sum of the two…
Q: Write a Program that take 2 string from user and print the whole with greetings. Those 2 strings are…
A: Requirements :- Write a Program that take 2 string from user and print the whole with greetings.…
Q: Write a program that reads from the user two integers and displays whether they have the same number…
A: Given:
Q: Write a Java program that reads from the user a positive integer, then separates the integer into…
A: 1. To get a number from user. 2. To then read each integer in a number and add the sum 3.to then…
Q: Write a JAVA program that reads one line of input text and breaks it up into words. The (solution)…
A: Program is: import java.util.*; import java.util.Scanner; //Defining class Words public class Words…
Q: Write a program that generates 1,000 lowercase letters randomly, counts the occurrence of each…
A: Program Plan: • In HistoGram class, o Create a window, set its title. o Create a canvas and add it…
Q: Write a Java program Instructions: Convert a number to a string, the contents of which depend on…
A: Step 1 : Start Step 2 : Take user input of the number Step 3 : Using modular division checking if…
Q: A user enters 6 different strings of different lengths. Write a JAVA program to input all the…
A: According to the Question below the Solution: Output:
Q: Write a Java program to take a string, print a "rotated right 2" version where the last 2 chars are…
A: Required:- Write a Java program to take a string, and print a "rotated right 2" version where the…
Q: Write a Java program which reads a String composed of one or many words and prints out the number of…
A: import java.util.*;public class Main{ public static void main(String[] args) { String s; int…
Q: Write a Java program that prompts the user to enter a positive integer value between 5 and 45 and…
A: The program reads a value from the user using the Scanner object. Then declare and initialize the…
Q: Write a program with total change amount in pennies as an integer input, and output the change using…
A: Actually, 000Java is a programming language originally developed by James Gosling at Sun…
Q: Write a Java program that gets a string from the user and reports whether or not there are repeated…
A: In main a while loop is used to ask for user input of a character. If character equals a then…
Q: Starting 2019, you are going to recruit a new employee for a period of 10 years with a monthly…
A: Note: This code should be rewritten instead of copying to the compiler otherwise it will throw a…
Q: How would I do this program? I am stuck.
A: Program DesignPrompt user for inputs and use Scanner object to read the inputs into double…
Q: Write a Java application which prompts the user for enter a String, counts the number of vowels (a,…
A: In this question, we are asked to write a java program in such way that user enter a string are…
Q: Write a Java program that computes the sum of two rational numbers given by the user. [Note: If two…
A: Here have to determine about java code for sum of rational numbers.
Q: Write a program that reads an integer between0 and 1000 and multiplies all the digits in the…
A: Since, programming language is not mentioned in the question, we will answer this question in Java…
Q: Write a Java program that computes the sum of two rational numbers given by the user. [Note: If two…
A: We need to read the input values a,x,b and y from keyboard ,compute the number and display the…
Q: Java, a real estate office handles 50 apartment units. When rent is $600 per month, all the units…
A: Actually, java is a object oriented programming language.
Q: Write a Java program based on the following situations. · Generate two random single-digit…
A: Step 1:- Program Approach:- Use the Math.random() function for random number Use the if-else…
Q: Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's…
A: Program: File name: “LabProgram.java” import java.util.Scanner; //Create a class public class…
Q: Write a Java program that reads an integer, which represents a year, and determines and prints…
A: logic here:- // if the InputYear is multiple of 4 if (InputYear % 4 == 0) { // if the…
Q: In java language has three different method Write the method xyzMiddle(). * * Given a String str,…
A: Objective: This program works with strings, three methods on strings are executed to check middle…
Q: In Python, Write a program whose input is two integers. Output the first integer and subsequent…
A: #get the input from the user num1=int(input()) num2=int(input()) #check if num1 is greater than…
Q: Write a Java program that reads from the user the result of a match between 2 teams in the FIFA…
A: Please find the answer below :
Q: Write a java program to find "nth" Fibonacci number where the value of "n" will be given by the…
A: i have provided this answer with full description in step-2.
Q: Write a program that reads an integer value and prints the sum of all even integers between 2 and…
A: Solution: Given, Write a program that reads an integer value and prints the sum of all even…
Q: Write a Java program that computes the sum of two rational numbers given by the user. [Note: If two…
A: I have provided java code to find the sum of two rational numbers.
Q: Write a java program that reads a line of input as a sentence and displays: • Only the uppercase…
A: We need to create a Java program that reads a line of input as a sentence and prints- only…
Q: Write a java program An Abundant number is a number for which the sum of its proper factors is…
A: GIVEN:
Q: Write a program in Java to make such a pattern like right angle triangle with number increased by 1.…
A: Input : Size of triangle i.e number of rows Output : Pattern like right angle triangle
Q: Write a program that reads a person's first and last names, separated by a space. Then the program…
A: The program will read entered name and stores into a variable. using the split method, it splitas…
Q: Write a program that takes in a line of text as input, and outputs that line of text in reverse. The…
A:
Q: Write a Java program that asks the user to enter positive numbers, and store it into (myArray) of…
A: import java.util.*;public class Main{ public static void main(String[] args) { Scanner scan =…
Q: Write a JAVA program using loop that asks the user to input seven integer numbers representing-..…
A: I have given an answer in step 2.
Q: Write a program using integers userNum and divNum as input, and output userNum divided by divNum…
A: JAVA Program: import java.util.Scanner; class Number { public static void main(String[] args) {…
Q: Write program in Java: Sites like Zillow get input about house prices from a database and provide…
A: PROGRAM: //Header file import java.util.Scanner; //Defining class public class LabProgram {…
Q: Write a Java program to take a string, print a string where for every char in the original, there…
A: Required: Write a Java program to take a string, print a string where for every char in the…
Q: Write a program in Java to find the sum of even and odd number between two numbers by getting the…
A: We need to write a Java language program that takes the input of two numbers from the user and…
Q: Write a program that reads from the user the initial KiloMeters of the car, the current KiloMeters,…
A: Step-1: Start Step-2: Declare variable currentKm, initialKM, fuelAmount and fuelConsumption Step-3:…
Q: Write a Java program that generates a random number between 50 and 150 that repre temperature in…
A: - We need to code the bean boiling problem in java.
Q: Implement a python version of the game Hangman in which a player attempts to guess a secret word one…
A: Solution:-- 1)The given question has required for the solution which is to be provided as the…
Q: THIS IS IN JAVA. A restaurant serves breakfast before 11 am, after which they serve lunch. Which…
A: Ternary operator ( ?:) A ternary operator is a short form of the java if-else conditional statement.…
Q: Many companies use telephone numbers like 555-GET-FOOD so the number is easier for their customers…
A: Actually, python is a easiest programming language. It has a concise(less) code. It is a dynamically…
Q: Write a Java program that displays a temperature conversion table for degrees Celsius and degrees…
A: As per the given problem, we need to display a temperature conversion table for conversion from…
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
- JAVA Given an airplane’s acceleration a and take-off speed v, you can compute the minimum runway length needed for an airplane to take off using the following formula: length = v2 / 2 * a Write a program that prompts the user to enter v in meters/second (m/s) and the acceleration a in meters/second squared ( m/s2 ) , then displays the minimum runway length needed to take off. Here is a sample run: Enter speed and acceleration: 60 3.5 [enter] The minimum runway length for this airplane is 514.286write a program in python Write a program that will allow a student to enter their name and then ask them to solve 10 mathematical equations. The program should display two random numbers that are to be added, such as: 247 + 129 The program should allow the student to enter the answer. The program should then display whether their answer was right or wrong, and accumulate the right values. After the 10 questions are asked, calculate the average that was correct. Then display the student name, the number correct, and the average correct in both decimal and percentage format. In addition to any system functions you may use, you might consider the following functions: A function that allows the student to enter their name. A function that gets two random numbers, anywhere from 1 to 500. A function that displays the equation and asks the user to enter their answer. A function that checks to see if the answer is correct and accumulates the number correct. A function that calculates the…Java program At a certain university, students have to submit their exams online. The administration decides that for each minute of late submission, 5 points are deducted. Write a program that asks the user for his initial grade and the late submission time (in minutes), and then displays the final result. Sample Run 1: Enter your initial grade: 82 Enter the late submission time (in minutes): 6 Your final grade is 52 Sample Run 2: Enter your initial grade: 115 Grades should be between 0 and 100 Sample Run 3: Enter your initial grade: 43 Enter the late submission time (in minutes): 10 Your final grade is 0 Sample Run 4: Enter your initial grade: 72 Enter the late submission time (in minutes): -2 Time should be positive
- JAVA Write a program that prompts the user to enter a line of text and displays the letter that has the most occurrences with the number of occurrences. For example, if “I ate an apple.” was entered, the letter ‘a’ occurred the most often. If not one but several letters have the most occurrences, all of them should be reported. For example, since ‘o’ and ‘t’ appear three times in “I went to the zoo.”, both occurrences should be reported. Sample Run: Enter a line of text: I ate an apple. The following letter(s) occurred most [3 time(s)]: a Enter a line of text: I went to the zoo. The following letter(s) occurred most [3 time(s)]: o t Write the program allowing the user to input a string. If the user inputs a capitalized letter within the string, such as ‘A’, have the program change all capitalized letters to lowercase. This program should display the letter that has the most occurrences with the number of occurrences.Use java code Body Mass Index (BMI) is a measure of health on weight. It can be calculated by taking your weight in kilograms and dividing by the square of your height in meters. The interpretation of BMI for people 16 years or older is as follows: BMI below 16 16-18 19-24 25-29 30-35 above 35 Interpretation seriously underweight underweight normal weight overweight seriously overweight gravely overweight Write a Java program that prompts the user to enter a weight in kilograms and height in meter and display the BMI. Use nested if- else statements to solve this exercise. Here is a sample run: Enter weight in kilograms: 66.22 Enter height in meters: 1.788 Your BMI is 20.71353142 You are normal weightA Newton number is a 4-digit integer number for which the sum of its digits to power 4 is equal to the number itself. Example of a Newton number is 1634 since: 1634 1*1*1*1+6*6*6*6+3*3*3*3+4*4*4*4 which is: 1+ 1296+256+81. Write a Java program that checks whether or not a number is a Newton number. Sample Run1: Enter an integer number of 4 digits: 3712 3712 is not a Newton number Sample Run2: Enter an integer number of 4 digits: 1634 1634 is not a Newton number Sample Run2: Enter an integer number of 4 digits: 234 Invalid input!!
- An Armstrong number is a 3-digit integer number for which the sum of cube of its digit is equal to the number itself. Example of Armstrong number is 153 as 153= 1*1*1 + 5*5*5 + 3*3*3. which is: 1+ 125+27. Another Armstrong number is 371. Write a Java program that checks whether a number is an Armstrong number or not Sample Run1: Enter an integer number of 3 digits: 371 371 is an Armstrong number Sample Run2: Enter an integer number of 3 digits: 171 171 is not an Armstrong number Sample Run2: Enter an integer number of 3 digits: 2345 Invalid input!!JAVA: Write a program that reads an integer and prints how many digits the number has, by checking whether the number is ≥ 10, ≥ 100, and so on. (Assume that all integers are less than ten billion.) If the number is negative, first multiply it with –1.10-6. Addition: One common problem when prompting for numerical input occurs when people provide text instead of numbers. When you try to convert the input to an int, you’ll get a ValueError. Write a program that prompts for two numbers. Add them together and print the result. Catch the ValueError if either input value is not a number, and print a friendly error message. Test your program by entering two numbers and then by entering some text instead of a number.
- 10-6. Addition: One common problem when prompting for numerical input occurs when people provide text instead of numbers. When you try to convert the input to an int, you’ll get a ValueError. Write a program that prompts for two numbers. Add them together and print the result. Catch the ValueError if either input value is not a number, and print a friendly error message. Test your program by entering two numbers and then by entering some text instead of a number. 10-7. Addition Calculator: Wrap your code from 10-6 in a while loop so the user can continue entering numbers even if they make a mistake and enter text instead of a number.Java Class: Fundraiser You are a fundraising distributor who needs to to pre-sell a limited number of doughnut coupon books. Each buyer can buy as many as 4 coupon books. No more than 100 coupon books can be sold. Implement a program called Fundraiser that prompts the user for the desired number of coupon books and then displays the number of remaining coupon books. Repeat until all coupon books have been sold, and then display the total number of buyers.ISP-Java Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer. For coding simplicity, output a space after every integer, including the last. Ex: If the input is: -15 30 the output is: -15 -5 5 15 25 Ex: If the second integer is less than the first as in: 20 5 the output is: Second integer can't be less than the first.