THIS IS IN JAVA. A restaurant serves breakfast before 11 am, after which they serve lunch. Which expression for XXX outputs the correct string for any time? Variable time ranges from 0 to 23 (e.g., 13 means 1 pm). mealString=XXX; // Output mealString A. (time > 11) ? "Breakfast" : "Lunch" B. (time == 11) ? "Breakfast" : "Lunch" C. (time < 11) ? "Breakfast" : "Lunch" D. (time != 11) ? "Breakfast" : "Lunch"
Q: In Java, Suppose x = 7.8. The value of the expression (int)(x + 0.5) is 8. True or False
A: The question has been answered in step2
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 JAVA program that declares a variable that represents the minutes worked on a job and assign…
A: Here is the easy approach :- Create three variables one to hold the minutes then second to hold…
Q: Suppose you have a real number variable x. Write a Java expression that computes the following value…
A: Given : Suppose you have a real number variable x. Write a Java expression that computes the…
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 Java program that reads two positive integers num1 and num2 (assume num1 < num2). Then, the…
A: I give the code in Java along with output and code screenshots.
Q: Write a Java program that reads two positive integers num1 and num2 (assume num1 < num2). Then, the…
A: Here we need to define a separate method to find whether a number is perfect or not. Let it called…
Q: Using java language, write a program with total change amount in pennies as an integer input, and…
A: Actually, java is a object oriented programming language. It is a platform independent.
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: Write a Java program that reads two positive integers num1 and num2 (assume num1 < num2). Then, the…
A: Dear learner , hope you are doing well , I will try my best to answer this question. Thank You!!
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: 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 an application that asks a user to type an even number or the sentinel value 999 to stop. When…
A: CODE : import java.util.*; public class EvenEntryLoop { public static void…
Q: Write a program using if, and elif and else, that asks the user what their favorite food is. Then…
A: According to the information given:- We have to create the program in that we as user to tell his…
Q: Write a program that gets two car information from the user, compares them, and print out the…
A: First, we need to define Car class with the attributes and methods and then define the main function…
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: THIS IS MEANT TO BE IN JAVA Mad Libs are activities that have a person provide various words, which…
A: Solution: Given, Write a program that takes a string and an integer as input, and outputs a…
Q: Write a program that reads the following information and prints a payroll statement: Employee’s name…
A: Answer:
Q: Write a Java program that reads two positive integers num1 and num2 (assume num1 < num2). Then, the…
A: Solution:-- 1)The given question has required for the solution with the help of an Java program to…
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: java method that receives two strings called s1 and s2 and then returns the number of rotations of…
A: Java is an object-oriented programming language, that is used to build web browser applications and…
Q: Write a Java program that reads two positive integers num1 and num2 (assume num1 < num2). Then, the…
A: The question is to write JAVA code for the given problem.
Q: In Java, Write a program that prompts the user to enter a full name consisting of three names…
A: Here I have asked user to enter full name, and then stored it into the string variable. Now to print…
Q: U is upward, D is downward, L is left and R is right : Using the methods pickDir() and exractInt()…
A: The program is written in java. MAXLOOPS is set to 20.
Q: In java, create a program that uses printf to format currency in the proper form. The value in…
A: According to the information given:- We have to define the program that uses printf to format…
Q: Write a program that prompts the user for a U.S. dollar amount and then converts it to Japanese Yen,…
A: Please find the answer below :
Q: Write a program with total change amount in pennies as an integer input, and output the change using…
A: Java program with total change amount in pennies as an integer input, and output the change using…
Q: THIS IS MEANT TO BE IN JAVA So far we've learned variables, branches, loops, and some array. The…
A: Here I have taken input from the user and stored it into a variable. Next, I have checked for the…
Q: Write a Java program called IntCheck that examines the integer variable x, printing GT (greater…
A: // Defining the Main Classpublic class Main{ // Function to check the Number x public void…
Q: 4. Is It You, Cody? by CodeChum Admin Can you identify if Cody's name is spelled right? If so, then…
A: Java code for the given problem as follows :- import java.util.Scanner;public class MyClass {…
Q: IN JAVA. Write a program that takes in a line of text as input, and outputs that line of text in…
A: Program description: The java program objective is to reverse the user input string into reverse…
Q: Using Java programming language write a program to manage a hotel with 24 rooms; 10 rooms are…
A: Given 10 rooms are Executive, with price Gh ₵ 2500.00 per night,7 rooms are Chalets, with amounts…
Q: Write a Java program that reads two positive integers num1 and num2 (assume num1 < num2). Then, the…
A: A perfect number is one whose sum of factors (except the number itself) is equal to the number. In…
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: Write a Java program that prompts the user to enter the seconds as a String (e.g., “1500500500”),…
A: One year has 365*24*60*60 seconds One day has 24*60*60 seconds
Q: Write a Java program that reads two positive integers num1 and num2 (assume num1 < num2). Then, the…
A: here is the full working code in java. import java.util.Scanner;public class Main { public…
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: I have been working on writing a java program (that goes with another I just got finished- see below…
A: The changes are highlighted. for showing output, i have changed number of students 10 to 1. you can…
Q: The output of running the following Java Code is: 20 int x = 3, y = 9, == 7; if (* 1-2 46 (y < 5) 11…
A: Given Code: int x=3, y=9,z=7; if((x!=2) && !(y < 5) || (z<0))…
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 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 lets the user enter the monthly interest rate, number of years, and loan…
A: In this question we are asked to display monthly payment and total payment as per the formula given.…
Q: THIS IS MEANT TO BE WRITTEN IN JAVA. The assignment is to get an integer from input, and output…
A: /*Get an integer from input, and output that integer squared, ending with newline.*/ import…
Q: Write a java program that asks the user to enter the coordinates of 4 points that draw two different…
A: import java.util.*; class Main { public static void main(String args[]){ Scanner in =…
Q: I need to write a JAVA program that will allow me to insert "movies.csv" and output "Wonders of the…
A: Java Programming code for the given problem is given in step 2
Q: Write a program java that reads a number of feet from the user, then prints out either the same…
A: Output Screenshot:
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: Write a program java that reads a number of feet from the user, then prints out either the same…
A: Explanation Scanner class is used for input long miles = totalFeet/5280; long foot =…
Q: Write a java program which reads the number between 0 to 100 and find out how many such numbers are…
A: Code: public class Repeat { public static void main(String args[]) {…
THIS IS IN JAVA.
A restaurant serves breakfast before 11 am, after which they serve lunch. Which expression for XXX outputs the correct string for any time? Variable time ranges from 0 to 23 (e.g., 13 means 1 pm).
// Output mealString
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
- Write a program that takes in a string that holds the values "day" or "night" and an integer that holds a person's age, and outputs a movie ticket price. Movie prices are free for everyone under the age of 4. Daytime prices are $8 for everyone age 4 or higher. Nighttime prices are $12 for ages 4 - 16, $15 for ages 17 - 54 and $13 for ages 55 and above. (in java)in Java Write a program that establishes two savings accounts with saver1 having account number10002 with an initial balance of $2,000, and saver2 having account 10003 with an initialbalance of $3,000. Set a common rate of interest at 5% per year. At the end of each month,update the balance by adding one month’s interest to the balance, so that the balancecompounds monthly. Print an output that displays the month number and the account numberand the balance for each of the two accounts. Use month 0 to display the initial balances, month1 to display the balances after the first month’s interest, and so on. At the end of the year,display the total balance for both accounts combined, like this:Output:Monthly balances for one year with 0.05 annual interest:Month Account # Balance Account # Balance----- --------- ------- --------- ------- 0 10002 2000.00 10003 3000.00 1 10002 2008.33 10003 3012.50 2 10002 2016.70 10003 3025.05 3 10002 2025.10 10003 3037.66 4 10002 2033.54 10003 3050.31 5…In Java, Implement a simple weekly payroll program. The input will consistof the employee’s full name, employee’s ID (String), the number of hoursworked per week (double), the hourly rate (double), the income tax is 6%.Your program should calculate the total gross pay, and the net pay anddisplay a paycheck like:Employee’s name: John SmithEmployee’s number: js1200Hourly rate of pay: 10.50Hours worked: 36.00Total Gross Pay: $378.00DeductionsTax (6 %): $22.68Net Pay: 355.32 DollarsYour program must include the class Employee whose private attributesare:- fullName: String- employeeNumber: String- payRate: double- hoursWorked: double-(Don’t add any variables to the class Employee)In addition to that, equip the class Employee with these methods:- Employee (String fullName, String employeeNumber, double payRate,double hoursWorked)This constructor assigns the parametres fullName, employeeNumber,payrate, hoursWorked to the data members.- For each of the private data members above, add the…
- IN JAVA. Write a program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical. Ex: If the input is: 93 the output is: 93 92 91 90 89 88 Ex: If the input is: 77 the output is: 77 Ex: If the input is: 15 or any number not between 20 and 98 (inclusive), the output is: Input must be 20-98In Java, Write a program that prompts the user to enter a full name consisting of three names (first middle last) into one String variable. Then use methods of class String to: print the number of characters in the full name, including spaces print just the middle name and the number of characters in it. print the three initials of the name print the last name in all upper case. print the full name in the usual alphabetical format (last, first middle) and proper case.** in java** 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:
- in java Read two strings and two integers from input and call printInfo() to output as follows. Ex: If the input is Rome Suva 2868104 84410, then the output is: Rome has 2868104 people. Suva has 84410 peopleWrite a Java program that reads two positive integers num1 and num2 (assume num1 < num2). Then, the program will display all perfect numbers between num1 and num2. A positive integer is called a perfect number if it is equäl to the sum of all of its positive divisors, excluding itself. For example, 6 is the first perfect number because 6 = 3 + 2 + 1. The next is 28 = 14 + 7 + 4 + 2 + 1. Hint: use modulus (%) to find the divisor of a number. Sample Input/Output Enter two numbers: 6 1001 6 is a perfect number 28 is a perfect number 496 is a perfect number Note: Your answer should follow the given sample input / output.THIS IS MEANT TO BE IN JAVA Mad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (and hopefully funny) ways. Write a program that takes a string and an integer as input, and outputs a sentence using the input values as shown in the example below. The program repeats until the input string is quit and disregards the integer input that follows. Ex: If the input is: apples 5 shoes 2 quit 0 the output is: Eating 5 apples a day keeps you happy and healthy. Eating 2 shoes a day keeps you happy and healthy. Please show the code.
- 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.IN JAVA - Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 5 as long as the value is less than or equal to the second integer. End with a newline. Ex: If the input is: -15 10 the output is: -15 -10 -5 0 5 10 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. For coding simplicity, output a space after every integer, including the last. BASE CODE: import java.util.Scanner; public class LabProgram { public static void main(String[] args) { /* Type your code here. */ }}Write a Java program correctly that generates a report of proof of vaccination against COVID-19 for the peoplewho received their dose of vaccination. Write a program which:1. Display a welcome message.2. Then prompts the user to enter the following:• First name, with first letter uppercase, which is then stores in a variable of type String.• Last name, with first letter uppercase which is then stores in a variable of type String.• Day of birth, set as a number between 1 and 31, which is then stores in a variable of typeint.• Month of birth, set as a number between 1 and 12, which is then stores in a variable of typeint.• Year of birth, set as a number between 1920 and 2006, which is then stores in a variable oftype int.• Day of vaccination, set as a number between 1 and 31, which is then stores in a variable oftype int.• Month of vaccination. set as a number between 1 and 12, which is then stores in a variableof type int.• Year of vaccination, set as a number between 2020 and 2021,…