EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
Chapter 2, Problem 10RQ
Program Description Answer
The Java statement “System.out.println(“w\nxyz”);” prints w on one line and xyz on the next line.
Hence, the correct answer is option “C”.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Question 2 [50 points]:
Write a Java program that reads from the user the result of a match between 2 teams in the
FIFA World Cup in a single line. Then computes and prints the winning team or indicates
that the teams tied!
Test your code when the winning team is the first one, when the winning team is second one
and when the match is drawn.
Hint: The user should insert the 4 values in the same line using only one prompt message.
Sample run1:
Insert the result of the match:
England 1 2 Italy
Italy is the winning team
Sample run2:
Insert the result of the match:
Brazil 1 1 Argentina
Brazil and Argentina tied!
Sample run3:
Insert the result of the match:
England 3 1 Brazil
England is the winning team
Problem: Write a Java language program the will accept username and five (5) score grades of students, Get the total and average of the five (5) scores of the students, and determine Average if "Passed" or "Failed". Passing score is 75.
Filename: Exam3.java
Write a program that
• Requests a temperature from the user.
• Also asks if the temperature is in Fahrenheit (F) or Celsius (C).
• Converts the entered temperature to the other scale.
• Prints out the result as illustrated below.
The conversion formulas are
c=등(F-32)
F =C+ 32
and
Chapter 2 Solutions
EBK JAVA PROGRAMMING
Ch. 2 - Prob. 1RQCh. 2 - Prob. 2RQCh. 2 - Prob. 3RQCh. 2 - Prob. 4RQCh. 2 - Prob. 5RQCh. 2 - Prob. 6RQCh. 2 - Prob. 7RQCh. 2 - Prob. 8RQCh. 2 - Prob. 9RQCh. 2 - Prob. 10RQ
Ch. 2 - Prob. 11RQCh. 2 - Prob. 12RQCh. 2 - Prob. 13RQCh. 2 - Prob. 14RQCh. 2 - Prob. 15RQCh. 2 - Prob. 16RQCh. 2 - Prob. 17RQCh. 2 - Prob. 18RQCh. 2 - Prob. 19RQCh. 2 - Prob. 20RQCh. 2 - Prob. 1PECh. 2 - Prob. 2PECh. 2 - Prob. 4PECh. 2 - Prob. 5PECh. 2 - Prob. 6PECh. 2 - Prob. 7PECh. 2 - Prob. 8PECh. 2 - Prob. 9PECh. 2 - Prob. 10PECh. 2 - Prob. 11PECh. 2 - Prob. 12PECh. 2 - Prob. 13PECh. 2 - Prob. 14PECh. 2 - Prob. 15PECh. 2 - Prob. 16PECh. 2 - Prob. 1GZCh. 2 - Prob. 3GZCh. 2 - Prob. 1CPCh. 2 - Prob. 2CP
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- USING C++ PROGRAMMING LANGUAGE A mobile phone service has three different data plans for its customers: PLAN A: For $19.99 per month, 2 gigabytes are provided. Additional usage costs $8.00 per gigabyte. PLAN B: For $59.99 per month, 8 gigabytes are provided. Additional usage costs $8.00 per gigabyte. PLAN C: For $79.99 per month, Unlimited data is provided. Write a program that calculates a customer’s monthly bill. It should input the customer name, which plan was purchased, and how many gigabytes were used. It should then create a bill that includes the input information and the total amount due. It should also display how much money plan A customers would save if they purchased plan B or C, and how much money plan B customers would save if they purchased plan C. If there would be no savings, no message should be printed. Wherever possible, use named constants instead of numbers.arrow_forwardcan you please write it in java.util.scanner form Write a program that prompts the user to enter a number within the range of 1 through 10. The program should display the Roman numeral version of that number. If the number is outside the range of 1 through 10, the program should display an error message. but use switch statement for the program.arrow_forwardPrint "Censored" if userlnput contains the word "darn", else print userlnput. End with newline. Ex: If userlnput is "That darn cat.", then output is: Censored Ex: If userlnput is "Dang, that was scary!", then output is: Dang, that was scary! Note: If the submitted code has an out-of-range access, the system will stop running the code after a few seconds, and report "Program end never reached." The system doesn't print the test case that caused the reported message. 1 import java.util.Scanner; 2 3 public class CensoredWords { public static void main (String [] args) { Scanner scnr = new Scanner(System.in); String userInput; 4 5 7 8 userInput scnr.nextLine(); 9. 10 /* Your solution goes here */ 11 } 13 } 12arrow_forward
- In Java code Write a program that takes in an integer in the range 11-100 as input. The output is a countdown starting from the integer, and stopping when both output digits are identical.arrow_forwardWrite a Java program to do the following task: Assign your id number (example .. 2019293086) to an integer variable id_num Using reminder operator% on the id_num get the last 4 digits (3086) and store it in num If the num is between 0 and 3,000 (both included), display "You are in Group 1" Otherwise if the num is between 3001 and 6,000 (both included), display "You are in Group 2" Otherwise (num is between 6,001 and 9,999 both included), display "You are in Group 3" Save your file as Q2.Java and upload it.arrow_forwardUsing java: Prompt the user for two characters. Output the movies that begin with those two characters. Test Case 3 Movie search by characters. Enter two characters.\nKnENTERMovies that start with Kn\nKnafayim\nKnal, wie vangt de bal?\nKnald eller fald\nKnald eller fald\nKnallerfrauen\nKneipenquiz\nKnevel & van den Brink\nKnevel op zaterdag\nKnievel's Wild Ride\nKnife to the Heart\nKnight & Daye\nKnight Errant Limited\nKnight Errant Limited\nKnight Five\nKnight Rider\nKnight Rider\nKnight Rider\nKnight Rider\nKnight Rider\nKnight Rider\nKnight Rider\nKnight Rider\nKnight School with Coach Bobby Knight\nKnight School\nKnight School\nKnightmare\nKnightmare\nKnightmare\nKnights and Warriors\nKnights of Bloodsteel\nKnights of Bloodsteel\nKnights of Bloodsteel\nKnights of Bloodsteel\nKnights of God\nKnights of God\nKnights of Mayhem\nKnightwatch\nKnightwatch\nKnit & Crochet Today\nKnit One, Purl Two\nKnitting Daily Television\nKnitty Gritty\nKnock &…arrow_forward
- In Java: Forms often allow a user to enter an integer. Write a program that takes in a string representing an integer as input, and outputs yes if every character is a digit 0-9. Ex: If the input is: 1995 the output is: yes Ex: If the input is: 42,000 or 1995! the output is: no Hint: Use a loop and the Character.isDigit() function.arrow_forwardWrite an application that will take a 5 digits integer from user and calculate the sumof all digits of theinteger.The application signature is as follows: (for example, for integer 34567 prints 25?arrow_forwardComplete the if-else statement to output "Below 90" if the value of userInput is below 90. Otherwise, output "90 or more". Ex: If the input is 88, then the output is: Below 90 1 import java.util.Scanner; 3 public class Relational { 345678 9 10 11 12 13 14 FREEdd public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int userInput; 15 16 } 17 } userInput = scnr.nextInt (); if (* Your code goes here */) { System.out.println("Below 90"); } else { } System.out.println("90 or more");arrow_forward
- Question6: Write a Java program to calculate the following function: sin (2x? + 1) where r = cos(x? – 2) + 1 x = 1arrow_forwardWrite a Java program to do the following task: Assign your id number (example... 2014299123) to an integer variable id_num Using reminder operator % on the id_num get the last 5 digits (99123) and store it in num If the num is between 0 and 30,000 (both included), display "You are in Group 1" Otherwise if the num is between 30001 and 60,000 (both included), display "You are in Group 2" Otherwise (num is between 60,001 and 99,999 (both included), display "You are in Group 3" Save your file as Q2.Java and upload it. Attach File Browse My Computerarrow_forwardNeed help writing the code in Java language. Allow a user to enter any number of double values up to 15. The user should enter 99999 to quit entering numbers. Display an error message if the user quits without entering any numbers; otherwise, display each entered value and its distance from the average.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT