Java write a program that prompt user to insert his/her Salaries for the past three months and print "in a text file" there Salaries, and the average. The output should be appeard as shown : Enter your salaries for the three past monthes: 1000 2000 3000 and the txt file look like this : month 1 salary is 1000 month 2 salary is 2000 month 3 salary is 3000 the average of your salary for is = 2000
Q: Write a program that reads in three strings, sorts them lexicographically, calculates the size of…
A: required: To Write a program that reads in three strings, sorts them lexicographically, calculates…
Q: Write a program that prompts the user to enter an integer and prints the value of the following…
A: Output Screenshot: Sample run 1: Sample run 2:
Q: 1. Write a java program that asks the user to input two integers intStart and intEnd then computes…
A: Please find the answer below :
Q: Write a program in c ++ that inputs four numbers separated by spaces. The program should count how…
A:
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: Using Java Create a text file using the following books: And Then It's Spring Baby Bear Sees…
A: EXPLANATION: - The classes present in the io package named BufferedWriter, File, FileWriter, and…
Q: Write a program that reads from the user two integers and displays whether they have the same number…
A: Given:
Q: Problem: Write a Java program that will prompt for and read one word entered by the user, and…
A: The given problem is related to Java programming where the program will take a string input and…
Q: Write a java program that helps the Lebanese scout to create an online tombola (lottery). Your…
A: import java.lang.Math;import java.util.Scanner;public class Main{ public static void main(String[]…
Q: JAVA) Write a program that allows the user to enter the last names of five candidates in a local…
A: CODE:- import java.util.*;import java.text.NumberFormat; public class Main{ public static void…
Q: write a java program A twin prime is a prime number that is either 2 less or 2 more than another…
A: I have given an answer in step 2.
Q: Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Follow each…
A: The following corrections need to be made to the program: In the while loop, logical and…
Q: Write a program that reads from the user the initial KiloMeters of the car, the current KiloMeters,…
A: Answer
Q: Write a java program that helps the Lebanese scout to create an online tombola (lottery). Your…
A: Solution: Java program: import java.util.*; public class Main { // Main method public…
Q: Write a program to process a collection of daily high temperatures. Your program should count and…
A: Required:
Q: Write a program that gives simple math quizzes. The program should display two randomnumbers that…
A: CODE:- import randomdef main(): #Program message print(" Math Quiz" )print("Enter the result of…
Q: Q1) Find the output of the following Java application: public class Example{ public static void main…
A: We are going to write a println statement to print the followinng message The path of my file is:…
Q: Create a program that asks a character input. If the character input is 'Y', then it prints…
A: Below I have provided a Java program for the given question. Also, I have attached a screenshot of…
Q: Java: Write a program that prompts for a sequence of integer inputs and displays cumulative totals.…
A: Here, first you need to declare integer array. Then you can prompt user to enter how many elements…
Q: Create a Java program that uses a loop for • Reads from the console the names, weight in kg and…
A: public class Main { //Main Function public static void main(String[] args) { //Creating the…
Q: Build an application that will generate a random number and then have the user guess it. hints below…
A: Given:
Q: Write an application that asks a user to type an even number or the sentinel value 999 to stop. When…
A: Use a while loop to iterate and condition we have to specify is that the input value should not be…
Q: Write a program that interactively reads lines of input from the user and prints them back out,…
A: Approach Here, we have used a while loop that asks the user to input a line of text until the user…
Q: 1. Write a program that separately prompts the user for a first name and last name and outputs a…
A: As per our guidelines we are supposed to answer?️ only one question. Kindly repost other questions…
Q: (JAVA) Write a program that allows the user to enter the last names of five candidates in a local…
A:
Q: Build an application that will generate a random number and then have the user guess it. hints…
A: Given: Build an application that will generate a random number and then have the user guess it.
Q: using java language Scanners are handy for reading input that is stored in a file. For this…
A: The below given Java program will obey the following rubrics: Including necessary data packages. In…
Q: Write a program that begins by reading a number of cents from the users as an integer (this is input…
A: In the Python 3 programming language, set all needed currency named variables to 0 to make floor…
Q: reate a C++ hotel reservation program with a class that ask the user to enter a room number, enter…
A: Required: Create a C++ hotel reservation program with a class that ask the user to enter a room…
Q: Create a program which will read a phrase from the user and create a framed version of it for…
A: 1.#Begin 2.Phrase = input("Please Enter a Phrase:\t") 3.Position = input("Please Enter the…
Q: This question is for java. Write a program that plays the Hi-Lo guessing game with numbers. The…
A: Java program to solve the given problem is below.
Q: Write a program that displays the classic BINGO game, displays a BINGO card (5x5 square), and tests…
A: Given data is shown below: Write a program that displays the classic BINGO game, displays a BINGO…
Q: ISP-Java Write a program whose input is two integers, and whose output is the first integer and…
A: Given: ISP-Java Write a program whose input is two integers, and whose output is the first integer…
Q: Question 2: Write a java program that prompt the user for a string telephone number of the form…
A: According to the Question below the solution: Output:
Q: Using Java.. Write a program that reads the user's first name and last name, and then use them to…
A: Given data, Write a program that reads the user's first name and last name, and then use them to…
Q: Write a Java program correctly that generates a report of proof of vaccination against COVID-19 for…
A: We need to write Java program for given specifications.
Q: Write a program, named last10.java, whose input is an unknown number of integers. The program stops…
A: JAVA PROGRAM: import java.util.*; class Main { public static void main(String args[]) {…
Q: Write a program that prompts the user to input a sequence of characters and outputs the number of…
A: According to the Question below the Solution:
Q: Write a Java program below that does the following: /* Program randomly selécts secret number 122 */…
A: Java program to guess the random Number
Q: Write a program to compute the sum of the first N Fibonacci numbers, where N is an integer that is…
A: Introduction of the Program: The Java program takes the number of terms from the user and then the…
Q: Write a program that prompts the user to enter an integer from 1 to 15 and displays a pyramid, as…
A: import java.util.*;import java.lang.*;import java.io.*; class Codechef{ public static void main…
Q: IN JAVA. Write a program that takes in an integer in the range 20-98 as input. The output is a…
A: Program: import java.util.*; class Main { public static void main(String[] args) { //…
Q: Write a java program that prompts the user to enter two integers between 10 and 80 inclusive, finds…
A: Java program for given question - import java.util.*;class Main { public static void…
Q: Write a java program call CountVowelsDigits which prompts the user for a string, counts the number…
A: import java.util.Scanner;import java.lang.*;public class Main{ //method to print count and…
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: (B) Write Java Application to generate a digital signature for "Your Name in English followed by…
A: Digital Signature DefinitionDigital Signature is a technique for ensuring: Integrity: the message…
Q: Using Java to, write a program that asks the user for survey data about bus riders, and outputs a…
A: read muniline read number of days read number of riders calculate avg=(float)riders/days display avg…
Q: Write a program that records and displays league standings for a baseball league. The program will…
A: Here I have created functions with the same name as per the question. In the function…
Q: Write a program that begins by reading a number of cents from the users as an integer (this is input…
A: Initialize all required currency named variable with 0 in python3 programming language so that the…
Q: AVA Write a program that plays a number-guessing game to guess a secret number randomly generated…
A: PROGRAM STRUCTURE: Import the required classes. Start the definition of the public class. Start…
Java
write a program that prompt user to insert his/her Salaries for the past three months and print "in a text file" there Salaries, and the average. The output should be appeard as shown :
Enter your salaries for the three past monthes:
1000 2000 3000
and the txt file look like this :
month 1 salary is 1000
month 2 salary is 2000
month 3 salary is 3000
the average of your salary for is = 2000
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
- Create a java program that calculates the average test scores. Three employees in a company are ups for a special pay increase. You are given a file; ABCompany.txt, with the following data: Miller Andrew 65789.87 5 Green Sheila 75892.56 6 Sethi Amit 74900.50 6.1 Each input line consists of an employee’s last name, first name. Current salary and percent pay increase. For example, in the first input line, the last name of the employee is Miller, the first name is Andrew, the current salary is 65789.87 and the pay increase is 5%. Write a program that reads the data from the specified file and stores the output in the file ABCoutput.dat. For each employee, the data must be output in the following form: firstname lastname updated salary. Format the output of decimal numbers to two decimal places. Send a copy of the following: the java code Screenshot of the results screenshot of input file screenshot of output fileCreate a java program that calculates the average test scores. Three employees in a company are ups for a special pay increase. You are given a file; ABCompany.txt, with the following data: Miller Andrew 65789.87 5 Green Sheila 75892.56 6 Sethi Amit 74900.50 6.1 Each input line consists of an employee’s last name, first name. Current salary and percent pay increase. For example, in the first input line, the last name of the employee is Miller, the first name is Andrew, the current salary is 65789.87 and the pay increase is 5%. Write a program that reads the data from the specified file and stores the output in the file ABCoutput.dat. For each employee, the data must be output in the following form: firstname lastname updated salary. Format the output of decimal numbers to two decimal places. Send a copy of the following: the java code code Screenshot of the code screenshot of input file screenshot of output fileWrite a JAVA program to read in a list of electric vehicles. Print out the vehicle with the longest range. Data is stored in the following format: <automobile name><newline><list price><space><range> Here is a sample datafile. File: cars.txt Ford Focus Electric 32103 185 Nissan Leaf S 36398 241 Tesla Model S 97600 536 Kia Soul EV 35895 179 The following is a sample run, user input is shown in bold underline: Enter the input filename: c:/temp/cars.txt Car with the longest range = Tesla Model S Price $97600.00 Range = 536
- This 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 53Create a java program that calculates the average test scores. Given the student’s name and five test scores, calculate the test scores. The student’s name, five test scores and the average test score is stored in the file testaverage.txt. The data is input from the file test.txt. Sample Run Input file (Contents of the file test.txt) Andrew Miller 87.50 89 65.75 37 98.5 Output file (Contents of the testaverage.txt) Student Name: Andrew Miller Test Scores: 87.50 89.00 65.75 37.00 98.50 Average test score: 75.75Write a program that reads a text file named as “input.txt” and performs the following operations:1. Write each word in the text file in reverse order to the file named as“output.txt” . (Example: If the text file contains ”Hello World!”, then itshould write to the output file ”olleH dlroW!”)2. Print the number of words.3. Print the number of words starting with a capital letter.4. Print the number of words that contain no characters other than Englishletters.In this challenge you are supposed to:1. Comment every function with a description explaining what it does andhow it does it.2. Research and learn how to read and write into text files by using properlibrary functions in C.In your program, you can assume that1. Both the input file (input.txt) and the output file (output.txt) will beplaced on the same folder as your program’s executable (.exe).2. In the input file, the length of the words will be at most 100.
- In a file called Stars.java, write a program that: Asks the user to enter a positive integer N > 0. It is OK if your program crashes when the user does not enter a valid integer. If N <= 0, the program terminates. If N > 0, the program prints out: A line with one character '*'. A line with two characters '*'. A line with three characters '*'. And so on, up to and including a line with N characters '*'. For example: if the user enters 5, your program output should look EXACTLY like this:Enter a positive integer N > 0: 5 * ** *** **** ***** Exiting... As another example: if the user enters 0, your program output should look EXACTLY like this:Enter a positive integer N > 0: 0 Exiting... As another example: if the user enters 1, your program output should look EXACTLY like this:Enter a positive integer N > 0: 1 * Exiting...Write a program using while loop and for loops to print first 50 prime numbers in 5 lines, each line containing 10 numbers. 1. Create a program called CountCharacters.java. 2. At the top of your java file add the following documentation comments. Replace the italicized text with the appropriate content. /** @author Your Name CS 110 Section 012 Lab 9 Final Today's Date 3. Import the Scanner class and ask user to enter a line. Implement the while loop so that the user can input any number of lines and one line at a time. To stop entering lines, the user can write "quit. (Hint: Use the string method <str>.equals() in the while condition to stop the while loop OR a break keyword). 4. Implement the for loop inside the while loop to iterate through the line one character at a time to count and output the number of blank spaces, alphabetic characters, digit characters, and other characters in all the lines. You need to use different methods of character class like charAt(), isDigit(),…Update the program to rate an input value from user (prompt the user to input rate, double value). Then run the program with the update and provide sample output (screen shot) package mypackage; public class Interest { public static void main(String[] args) { double principal = 1000.0; double rate = 0.05; System.out.printf("%s%20s%n" , "Year", "Amount of deposit"); for ( int year = 1; year <= 10; ++year) { double amount = principal * Math.pow(1.0 + rate, year); System.out.printf("%4d%,20.2f%n" , year, amount); } } }
- Create a text file called randomWords.txt and a Java file calledalphabeticalWords.java. Inside, write a program that reads words fromthe text file and displays all the words (duplicates allowed) in ascendingalphabetical order. The words must start with a letterWrite a program that reads in from a file a starting month name, anending month name, and then the monthly rainfall for each monthduring that period. As it does this, it should sum the rainfall amountsand then report the total rainfall and average rainfall for the period.For example, the output might look like this:During the months of March–June, the total rainfall was 7.32 inchesand the average monthly rainfall was 1.83 inches.Java Your program must read a file called personin.txt. Each line of the file will be a person's name, the time they arrived at the professor's office, and the amount of time they want to meet with the professor. These entries will be sorted by the time the person arrived. Your program must then print out a schedule for the day, printing each person's arrival, and printing when each person goes in to meet with the professor. You need to print the events in order of the time they happen. In other words, your output will be sorted by the arrival times and the times the person goes into the professor's office. In your output you need to print out a schedule. In the schedule, new students go to the end of the line. Whenever the professor is free, the professor will either meet with the first person in line, or meet with the first person in line if nobody is waiting. Assume no two people arrive at the same time. You should solve this problem using a stack and a queue. You can only…