Write a Java program that allows the user to enter the expenses’ in term of AED by using a while loop to calculate the average. The number of expenses is unknown. To stop entering the expenses, the user needs to enter a negative value. Show the total, average and the count.
Q: Write a java program that asks a user to enter a set of positive integer values. When the user stops…
A: Given: Write a java program that asks a user to enter a set of positive integer values. When the…
Q: Write a java program that asks user to enter a set of positive integer values. When the user stops…
A: The below given Java program will obey the following rubrics: Importing required packages. In the…
Q: Write a Java program that: • Ask user to enter the last two digits of the Student ID number and…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: Write a Java program to calculate user's average test scores. Your program can be used for any…
A: In the main method Run an infinite loop Print: "Enter a score or enter -1 to stop."…
Q: Write a java program that reads an integer and check whether it is negative, zero or positive
A: Required:- Write a java program that reads an integer and check whether it is negative, zero, or…
Q: Write a Java program that prompts the user to enter two positive integers and find their greatest…
A: PROGRAM CODE: import java.util.*; // import the java utility packagepublic class Main {…
Q: Create a Java program that asks the user to input a student number. The format of the student number…
A: Java Program for the above scenario
Q: Write a Java program using a for loop or a while loop that reads a word and prints the word in…
A: Given: Write a Java program using a for loop or a while loop that reads a word and prints the word…
Q: Write a JAVA program for loop that will print out all the multiples of 3 from 3 to 36, that is: 3 6…
A: Algorithm Start var n=3 for i=n to 36, go to step 4 else to step 6 if(i%3==0), go to step 5 else to…
Q: Write a Java program that prompts for and reads in the sales for cach of 5 sales persons in a…
A: I have provided Java code which will find out the total and average sales of 5 persons. Also,…
Q: How would I go about writing this program?
A: Program AlgorithmImport the required package and create a class called Pattern.Define the main() and…
Q: Write a Java program to print the first 20 positive odd numbers using a loop
A: For this problem statement, I used a do-while loop. In this loop check number is odd or not using if…
Q: Write a Java program to take the temperature from the user in Celsius, convert it into Fahrenheit…
A: Please find the answer below :
Q: Write a java program to find the recoil momentum of the atom of an isolated hydrogen atom emits a…
A: Required:- Given the atomic number of atom: 5 and we have to find the energy required to remove the…
Q: Write a Java program to find the calculate the average of 3 subjects for 5 students using do… while…
A: This code have written java as asked in the problem. we get input from user to get average of mark…
Q: I need to write a java program with a simple while loop to print the numbers between 100 and 1000…
A: Program: //definition of main class public class Main { //definition of main method public…
Q: Write a JAVA program to take input the number of hours, minutes and seconds and print the total…
A: GIVEN:
Q: Write a Java program with screenshot output that does the Following: a. Print the numbers from 10 to…
A: a. Print the numbers from 10 to 1 (using while loop). b. Print the numbers (that are divisible by…
Q: Write a java program to find the depreciation using the amount = 1000 and rate = -7 and year is 5
A: 1) Below is JAVA program to calculate depreciation of amount 1000 after 5 years at rate of -7…
Q: Write a Java program (using while loop) that’s asks the user to choose from the tickets ( 1:one…
A:
Q: Write a program by using Java while loop, which gets a positive number from the user. Te program…
A: In this question, we are asked to write a java program where user enter positive number and program…
Q: Write a Java program to get the mobility after taking magnitude of drift velocity per unit electric…
A: Required:- Write a Java program to get the mobility after taking the magnitude of drift velocity per…
Q: Write a Java program to generate a user's daily average number of walking steps for a given month of…
A: In this question, we are asked to write a java program which calculate the average of walking…
Q: Write a JAVA program to count the number of total iterations of the nested loops given below and…
A: Write a JAVA program to count the number of total iterations of the given nested loops and also…
Q: Write a Java program that uses the while loop to produce the following output by calculating the…
A: Answer :
Q: Write a Java program using a LOOP to print the date of all Fridays in a month, if the date of the…
A: Java code: import java.util.Scanner; public class Main{ public static void main(String[] args) {…
Q: Write a JAVA program that asks the user to input the instructor Salary (double) and Academic Rank…
A: START PRINT "Input instructor Salary: " INPUT salary PRINT "Input Academic Rank: " INPUT rank…
Q: Create a Java program that reads the monthly due of the electricbill from January to December. Use…
A: Java, C, and C++, etc are among the programming languages available. The software reads the user's…
Q: Write a Java program that returns the result of the division of two numbers that were given by the…
A: CODE:- import java.util.Scanner; public class Main { public static void main(String[] args) {…
Q: How would I go about writing this program?
A: Create a class and get int type data from a user, to print the number of lines on console.Use three…
Q: a program that repeatedly asks the user whether they wish to calculate another square root. If the…
A: Program: import java.util.Scanner; public class Main{ public static double sqrt(double n) {…
Q: Write a Java program that will ask the user for a starting number (high), ending number (low), and a…
A: Input : Starting number Ending number Decrement number Output : Print number in each line. Print if…
Q: make this into a problem: Here we have implemented the program that displays whether the user input…
A: Note:- always mention programming language name. This program is done using c++. logic:- read A, B…
Q: Write a Java program to input 2 integers and check if they both the numbers are even, one of them is…
A: Sample Response: //Java program to input 2 integers and check if they both the numbers are even, one…
Q: I need the code please | java program | loop
A: Algorithm: Start Read no.of days in a month n Read date of 1st Friday m Iterate through the loop…
Q: Write a Java program to prompt the user to enter a test score, the program asks user to input the…
A: import java.util.Scanner; public class Practice7 { public static void main(String[] args) {…
Q: Write a java program to take user input for two numbers and print true if one of them is 50 Or their…
A: Algorithm: Take 2 value form the user then we have to check the first and second value seperately…
Q: Write a complete JAVA program that display 5 types of fruit with their price. Then ask the user to…
A: Java program is as follows: import java.util.ArrayList; import java.util.List; import…
Q: Create a Java program that loops around getting two fractions from the user, output their sum, and…
A: PROGRAM EXPLANATION: - The Fraction is a Zero fraction if the numerator is 0 and the denominator is…
Q: This java program outputs a downwards facing arrow composed of a rectangle and a right triangle. The…
A: PROGRAM CODE: // import required libariesimport java.util.*;public class Main{ // start…
Q: Write a java program to help the student to arrange his Diploma Marks of 12 subjects from high to…
A: Ascending order: Sorting the elements of the array from low values to high values is called…
Q: Write a Java program that displays the prime numbers between A and B
A: Program: import java.util.*; public class Main { public static void main(String[] args) {…
Q: Write a Java program that will ask the user to input any integer number. Print "NEGATIVE" if the…
A: 1. Declare variable num of type int 2. Create object of scanner class 3. Prompt user to enter a…
Q: Write a java program to find the charge flown through the wire when there is current through a wire…
A: Required:- Write a java program to find the charge flown through the wire when there is current…
Q: Write a Java program that: Ask user to enter the last two digits of the Student ID number and store…
A: Program code: import java.util.*; class Main { public static void main(String ...args) { //…
Q: Write a Java program to find the total runs scored by 11 players of a team, take input runs of all…
A: Write a Java program to find the total runs scored by 11 players of a team, take input runs of all…
Q: Write a Java program to print the following pattern using a loop: * ** *** ****
A: The number of the loop depends on the complexity of pattern or logic.
Q: Write one Java program with screenshot output that Print the numbers from 10 to 1 (using while…
A: java program
Q: Write a Java program that uses the nested-while loops to produce the following output, with each…
A: I have implemented the given requirements in Java to print the above output. The code is as follows:…
Write a Java
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Create a Java program that loops around getting two fractions from the user,output their sum, and state whether or not they are equal. Keep looping untilthe first fraction entered is a zero fraction.Create a Java program that reads the monthly due of the electricbill from January to December. Use any type of loop. Determine and output which month and respective monthly due of the greatest and least amount due.Create a JAVA program Write a program that reads total marks of 5 students and give their grades according to the following table. (Can we use switch?) Total mark Grade Equal or above 90 A Between 80 and less than 90 B Between 70 and less than 80 C Between 60 and less than 70 D Less than 60 F
- Write a Java program to find the calculate the average of 3 subjects for 5 students using do… while loop. Ouput Enter the Student Name:xxxx Sub1=99 Sub2=99 Sub=99 Sum=sum of 3 subjects Average= sum/3Write a Java program that asks a user to enter a number and prints out if it is odd or even.Write a Java program that asks the user to input the jackets quality in any letter case (HQL for high quality , LQL for low quality ) and their prices in factory, until the user enter QUIT in any case letter to stop. your program should count the number og HQL and LQL jackets, as well as the HQL price of jackets, then print the result on the screen. your program should ignore any unknown jacket quality.
- Write a java program that uses the Scanner to ask the user for an integer, but forces the user to re-enter the number if they enter a negative value. Then if the number is odd, print it out. Otherwise, check if the number is greater than 10 and if so, print it out twice. For example: 3 is printed once 8 is not printed 13 is printed once 40 is printed twiceWrite a Java program called Decision that includes a while loop to prompt the user to enter 5 marks using the JOptionPane statement and a System.out statement to output a message inside the loop huhglighting a pass mark >=50 and <=100. Any other mark will output a message stating it's a fail. Example of the expected output is as follows: 55 is a pass 12 is a failWrite a Java program that asks a user to enter a time of the day (integer number from 0 to 24). If time is between 0 and 5, the program prints "Good night!". If time is less than 10:00, then print “Good morning!”. If time is less than 20:00, then print “Good day!”, otherwise it prints “Good evening!”.
- Write a java program to help the student to arrange his Diploma Marks of 12 subjects from high to low and Advanced diploma marks of 12 subjects low to high and also find the lowest mark in the advanced diploma.Write a Java program that asks a user to enter his/her age. If the user's age is in the range of [18, 150] (18 ≤ age ≤ 150), program prints “Old enough!”, when the given age is smaller than the given range it must print “Too young”, and otherwise prints "Incorrect age."create a Java program that repeatedly asks the user whether they wish to calculate another square root. If the response is "y", then the program should proceed; if it is anything else, then the program should quit. Whenever it proceeds, the program should prompt the user for a number (a positive double, and your program may simply assume the input is consistent with this requirement) and then report the square root of that number to within a relative error of no more than 0.01%. The computation must be done using Newton iteration. The intuitive idea of Newton iteration for computing square roots is fairly straightforward. Suppose you have a guess r for x1/2 that is too large; the argument is similar if it is too small. If r is too large to be the square root of x, then x/r must be too small, so the average of r and x/r should be a better guess than either r or x/r. This suggests that if you repeatedly replace your current guess r by (r + x/r)/2, then your sequence of guesses should…