In Java Write a program that lets the user guess whether the flip of a coin results in heads or tails. The program randomly generates an integer 0 or 1, which represents head or tail. The program prompts the user to enter a guess and reports whether the guess is correct or incorrect.
Q: Write a program that asks for the names of three runners and the time, in minutes, it took each of…
A: The Comparable interface: Is used to sort objects of user-defined classes. Is found in the package-…
Q: In Java Write a program to which lets the user enter weight and height (feet, and inches). For…
A: GIVEN: In Java Write a program to which lets the user enter weight and height (feet, and inches).…
Q: Write an application that reads an integer value from the user and prints the sum of all even…
A: Solution :
Q: Write a program in java that is going to read m donors' name surname and the amount donated, and…
A: PROGRAM EXPLANATION : - For sorting the Donors based on amount they have donated, it is good idea to…
Q: Question 2: Write a Java program that prompts the user to enter an integer consisting of 3 digits,…
A: According to the Question below the Solution: Output:
Q: s shown in the Figure. (Hint: A point is in the rectangle if its horizontal distance to (0, 0) is…
A: Analysis of the problem: There is a rectangle with vertices a,b,c,d(let). The position of the…
Q: Write a simple java program that accepts as input: a student’s name, ID number, Major, GPA, and…
A: Input from User: Student’s name ID number Major GPA Bi-weekly paycheck Output to Console: All the…
Q: In this exercise, you will create a java program that reads words from the user until the user…
A: Code:
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: (1) Write a Java program named ConeVolume. (1 mark) (2) The program should read and store Cone's…
A: PROGRAM CODE: import java.util.*; // import java utility packagepublic class Main{…
Q: Required is a Java program that receives the names of 250 students via a keyboard, and their…
A: import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import…
Q: You are asked to write a java program for an embassy to help with the visa process. Your program…
A: To solve the given question first you need to take input in the given format then you have to…
Q: For the code in java below it shows a deck of 52 cards and asks the name of the two players and…
A:
Q: Write the following java programs: 1. A program that declares and initializes an integer number.…
A: As per the rules of Bartleby I can only solve 1 question at a time if they are not interlinked. I…
Q: ) The Bahraini Charity Club is conducting a fundraiser by selling chilli dinners to go. The price is…
A: PROGRAM INTRODUCTION: Import the required libraries. Start the definition of the main function.…
Q: n Java: Many documents use a specific format for a person's name. Write a program whose input is:…
A: The Scanner in the first step is used to take the input from the user and then print the result n…
Q: of her graduation photo. The ladder is placed at 2 feet away from the wall. The angle that is formed…
A: Let consider the given data and construct a triangle as shown below:
Q: For the code in java below it shows a deck of 52 cards and asks the name of the two players and…
A: User Need: For the code in java below it shows a deck of 52 cards and asks the name of the two…
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: in java write a program that reads an unspecified number of integers, determines how many positive…
A: //import the required packages import java.util.Scanner; //define a class AvgWithLoop public class…
Q: Write a Java Program that the video game machines at your local arcade output coupons according to…
A: the answer is given below:-
Q: For the code in java below it shows a deck of 52 cards and asks the name of the two players and…
A: Note: As you have not given the Player class description, that part of the code has been commented…
Q: For the code in java below it shows a deck of 52 cards and asks the name of the two players and…
A: Given: Solution for Java program
Q: Write an application in java that prints the sum of cubes.
A: As mentioned we have asked a user to enter 2 values. We have kept them in a and b variables. After…
Q: Write a program that lets a user calculate their body mass index . BMI is calculated using height…
A: Java program to take height and weight from the user and print BMI on the console.
Q: Write a Java program that initializes then displays values based on the table below. Print all the…
A: Given: Dr student we need to Write a Java program that initializes then displays values based on…
Q: Write a program in java which display the burger Sizes and its prices in tabular form as display…
A: Required: Write a program in java which display the burger Sizes and its prices in tabular form as…
Q: 1. Write a program in Java to calculate and print the Electricity Generator Bill, the user should…
A: As per the requirement program is completed in java. Algorithm: Step 1: Write the main() method Step…
Q: 2. Write a Java program to calculate and print the monthly paycheck for an employee. The net pay is…
A: Program description: The java program, PayCheck.java that prompts the user to enter the employee id…
Q: write a program for you have to take first name and last name from user and print whole name
A: Requirement : - write a program for you have to take first name and last name from user and print…
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: n Java, I want the user to enter in a 5-digit number, and if they enter incorrectly, I want to give…
A: import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner…
Q: he following program takes two numbers as input from the user when run and is supposed to add those…
A: Consider the given code: public class Example { public static void main(String[] args) { int…
Q: Write an java application that allows a user to enter any number of student quiz scores, as…
A: Program: import java.util.*; class Main { public static void main(String args[]) { Scanner sc =…
Q: Write a program with which you can convert a human height given in feet and inches to centimeters.…
A: Encapsulation is a mechanism of wrapping the data (data member) and methods that act on the data…
Q: Code a complete Java program that performs the following operations by reading the weight of…
A: The complete code is given below with output .
Q: For this assignment, write a program called Payday.java that will compute and print a person's…
A: Given:
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: Write a program in Java Write a program that calculates and displays a person’s body mass index…
A: import java.util.Scanner; public class Main{ //Function to calculate the BMI and printing the…
Q: Write a program that computes the average of 5 students grades which are entered by the user.
A: Here we can accept the 5 student grades in an array of integer called grades[5].
Q: In Java 1-make a program that prompt the user enter a shape name (Circle or Rectangle or line ) and…
A: The complete code is given below with output.
Q: Write a complete Java program that prints out the following information: 1. Ask the user to enter…
A: GIVEN: Create a Java program that gets the last three digits of the student ID from the user. Then…
Q: Write a program in java Write a program that asks the user to enter five test scores. The program…
A: Program Approach: Importing the necessary package Creating the main class Declaring the main method…
Q: s a deck of 52 cards and asks the name of the two players and makes both players draw five cards…
A: For the code in java below it shows a deck of 52 cards and asks the name of the two players and…
Q: linear equation can be solved using Cramer’s rule given in Programming. In Java Write a program that…
A: Given: A linear equation can be solved using Cramer’s rule given in Programming. In Java Write a…
Q: For this assignment, write a program called Payday.java that will compute and print a person's…
A: Required: For this assignment, write a program called Payday.java that will compute and print a…
Q: Java Write a program that prompts the user to enter the number of students and each student's name…
A: Use Scanner instance to accept input from user and store all the names and scores in two different…
Q: Write a program that prompts the user to enter a number within the range of 1 through 10. The…
A: JAVA Code for above: import java.io.*;import java.util.Scanner; class Program { public static void…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- Java Write a program that prompts the user to enter the number of students and each student's name and score, and finally displays the name of the student with the lowest score.Using C# in Microsoft Visual Studio create an application that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows:1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Do not display the computer’s choice yet.)2. The user selects his or her choice of rock, paper, or scissors. To get this input you can use Button controls, or clickable PictureBox controls displaying some of the artwork that you will find in the student sample files.3. The computer’s choice is displayed.4. A winner is selected according to the following rules:• If one player chooses rock and the other player chooses scissors, then rock wins. (Rock smashes scissors.)• If one player chooses scissors and the other player chooses paper, then scissors wins. (Scissors…JAVA Create a program using JAVA that asks the user to enter the amount that he or she has budgeted for a month. A loop should then prompt the user to enter each of his or her expenses for the month and keep a running total. When the loop finishes, the program should display the first and last name, each entry, and the total amount that the user is over or under budget. EXAMPLE: Paul RuddMonthly Budget Starting Balance: $1,000.00 Restaurant: - $300.00Remaining balance: $800.00 Electric: -$100.00Remaining balance: $600.00 Final Balance: $600.00
- PYTHON PROGRAMMING Reza Enterprises sells tickets for buses, tours, and other travel services. Because Reza frequently mistypes long ticket numbers, Reza Enterprises has asked his students to write an application that shows if a ticket is invalid. Your application/program tells the ticket agent to enter a six-digit ticket number. Ticket numbers are designed so that if you lose the last digit of the number, then divide by 7, the remainder of the division is exactly the same to the last dropped digit. This process is shown below: Step 1: Enter the ticket number; for example 123454 Step 2: Remove the last digit, leaving 12345 Step 3: Determine the remainder when the ticket number from step 2 is divided by 7. In this case, 12345 divided by 7 leaves a remainder of 4. Step 4: Display a message to the ticket agent indicating whether the ticket number is valid or not. If the ticket number is valid, save the number to a .txt file called “tickets.txt” and continue to loop your program…Computer Science Write a java program that asks the user to enter 10 numbers then the program will find the maximum, second maximum, and third maximum numbersPYTHON CODE Reza Enterprises sells tickets for buses, tours, and other travel services. Because Reza frequently mistypes long ticket numbers, Reza Enterprises has asked his students to write an application that shows if a ticket is invalid. Your application/program tells the ticket agent to enter a six-digit ticket number. Ticket numbers are designed so that if you lose the last digit of the number, then divide by 7, the remainder of the division is exactly the same to the last dropped digit. This process is shown below: Step 1: Enter the ticket number; for example 123454 Step 2: Remove the last digit, leaving 12345 Step 3: Determine the remainder when the ticket number from step 2 is divided by 7. In this case, 12345 divided by 7 leaves a remainder of 4. Step 4: Display a message to the ticket agent indicating whether the ticket number is valid or not. If the ticket number is valid, save the number to a .txt file called “tickets.txt” and continue to loop your program asking…
- Computer Science PYTHON PROGRAMMING Write a program that generates a random number in the range of 1 through 100, and asks the user to guess what the number is. If the user's guess is higher than the randomly generated number, the program should display "Too high, try again." If the user's guess is lower, the program prints "Too low, try again." If the user guesses the number, the application should congratulate the user and generate a new random number so the game can start over. Keep track of the number of guesses a user makes before guessing the correct one and display it with the congratulatory message when the user guesses the number correctly. For this assignment, create functions that: generate and return a random number between 1 and 100. format and return the failure and congratulatory messages. Put these function in a module called helper.py and put the rest of the code in game.py. The game module must import the helper module. Please provide both helper.py & game.py…Transcribed Image Text Write a Java program that asks the user to enter 5 odd integers. When the user enters an even number, the program discards the entry and resumes reading until exactly 5 odd integers have been entered. In the end, the program displays the average of all accepted entries.Microsoft Visual C# 7th edition, programming exercise 11-3 Instructions: Write the program FindSquareRoot that finds the square root of a user’s input value. The Math class contains a static method named Sqrt() that accepts a double and returns the parameter’s square root. If the user’s entry cannot be converted to a double, display an appropriate message, and set the square root value to 0. Otherwise, test the input number’s value. If it is negative, throw a new ApplicationException to which you pass the message “Number can’t be negative.” and again set sqrt to 0. If the input value is a double and not negative, pass it to the Math.Sqrt() method, and display the returned value. An example of the program is shown below: Enter a number 9 Square root is 3 or Enter a number -9 Error: Number can't be negative. Square root is 0 Here is my code. How can I pass the message to a new ApplicationException and display the error message? Thank you. using System; using static System.Console;…
- 1. Write a program that lets the user guess whether a randomly generated integer would be even or odd. The program randomly generates an integer and divides it by 2. The integer is even if the remainder is 0, otherwise odd. The program prompts the user to enter a guess and reports whether the guess is correct or incorrect.JAVA Programming Language: According to the American Heart Association, as you exercise you should periodically check your heart rate to ensure you are in your target zone. Your target zone is a range that is 50% to 85% of your maximum heart rate. The formula for calculating a persons maximum heart rate is 220 minus your age in years. Write a program that reads the users current heart rate, birthday, and the current day (each consisting of month, day, and year). The program should calculate the persons age (in years), the person's maximum heart rate, and the person's target heart rate zone range. Output the users age, current heart rate, target zone range. If their heart rate is in the target zone congratulate them, if it is out of their target zone warn them. Required Methods (Write these first and use them in your algorithm): (your code, particularly for computeAge, must be 100% clear and documented - it's the core of this assignment!) int computeAge(int birthMonth, int birthDay,…JAVA PROGRAM Chapter 5. PC #2. Retail Price Calculator (page 312) Write a program that asks the user to enter an item’s wholesale cost and its markup percentage. It should then display the item’s retail price. For example: • If an item’s wholesale cost is 5.00 and its markup percentage is 100 percent, then the item’s retail price is 10.00. • If an item’s wholesale cost is 5.00 and its markup percentage is 50 percent, then the item’s retail price is 7.50. The program should have a method named calculateRetail that receives the wholesale cost and the markup percentage as arguments, and returns the retail price of the item. Class name: RetailPriceCalculator PLEASE MODIFY THIS JAVA PROGRAM SO WHEN I UPLOAD IT TO HYPERGRADE IT PASSES ALL TEST CASSES PLEASE. RIGHT NOW IT SAYS 0 OUT 5 PASSED. THE PROGRAM IS NOT WORKING IN HYPERGRADE FIX IT SO IT WILL WORK IN HYPERGRADE. THANK YOU. import java.util.Scanner;public class Main { public static double calculateRetail(double…