The following program will compile and run, but it uses poor
Want to see the full answer?
Check out a sample textbook solutionChapter 1 Solutions
Absolute Java (6th Edition)
Additional Engineering Textbook Solutions
INTERNATIONAL EDITION---Engineering Mechanics: Statics, 14th edition (SI unit)
Mechanics of Materials (10th Edition)
Management Information Systems: Managing The Digital Firm (16th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Degarmo's Materials And Processes In Manufacturing
Web Development and Design Foundations with HTML5 (8th Edition)
- PROBLEM STATEMENT: An anagram is a word that has been rearranged from another word, check tosee if the second word is a rearrangement of the first word. public class AnagramComputation{public static boolean solution(String word1, String word2){// ↓↓↓↓ your code goes here ↓↓↓↓return true;}} Can you help me with this java question the language is java please use the code I gavearrow_forwardpublic class Errors{public static void main (String[] args){System.out.println("Welcome to my first program!\n")String ageStr = "24 years";int age = Integer.parseInt(ageStr);System.out.println("I'm " + age + " years old.");int three = "3";int answerYears = age + three;System.out.println("Total number of years: " + answerYears);int answerMonths = answerYears * 12; System.out.println("In 3 years and 6 months, I'll be " + answerMonths + " months old");//Once you've corrected all the errors, the answer should be 330.}}arrow_forwardRemaining Time: 1 hour, 28 minutes, 35 seconds. * Question Completion Status: QUESTTON 11 There are five syntax errors in the following java program. Explain them by mentioning the line number with each error. public class public static void main (String [] args) { { double a = 9; 4 double b = 9.0; int x; System.out.println ("Sum of a and b is if( a = b) + (a+b)) 80 X = a; switch (a+b) { case 0: System.out.println (x); default: System.out.println (x) ; 10 11 12 13 14arrow_forward
- in this code, the integer on each line shows the line number that is not part of code: what are the parameters of sum: ____ 1 public static int sum(int x, int y){ 2 int z = x +y; 3 return z; 4 } 5 public static void main(String[] args){ 6 … 7 sum(a+2, b); 8 … 9 }arrow_forwardclass Output{public static void main(String args[]){Integer i = new Integer(557);float x = i.floatValue();System.out.print(x);}} What will the given code prints on the output screen.arrow_forwardin this code, the integer on each line shows the line number that is not part of code: what is he local variables of sum: ____ 1 public static int sum(int x, int y){ 2 int z = x +y; 3 return z; 4 } 5 public static void main(String[] args){ 6 … 7 sum(a+2, b); 8 … 9 }arrow_forward
- PROGRAMMING LANGUAGE: JAVA SUBJECT: ADVANCED OOP WITH JAVA QUESTION NO 2: Make a class cube with x3 (x cube) function using package. Donot use maths class.arrow_forward? ParameterMysteryExam1 ♡ Language/Type: Java parameters return The following console program uses parameters and produces five lines of output. What are they? public class ParameterMysteryExam1 { } public static void main(String[] args) { String x = "java"; String y = "tyler"; String z = "tv"; String rugby = "hamburger"; String java = "donnie"; } hamburger (x, y, z); hamburger (z, x, y); hamburger ("rugby", z, java); y = hamburger (y, rugby, "x"); hamburger (y, y, "java"); and " + x + ” like + y); System.out.println(z + public static String hamburger (String y, String z, String x) { return z; } 9 M 31 marrow_forwardWrite in C#arrow_forward
- mport java.util.Scanner; public class ParkingCharges { // function to calculate the basic charge using the asked hours static double getBasicCharge(int hours) { if (hours >= 7 && hours <= 8) return 5.50; else if (hours >= 5 && hours <= 6) return 4.50; else if (hours >= 2 && hours <= 4) return 4.00; return 3.00; } // function to return the amount to subtract based on local living and OAP static double getDiscount(String isLocal, String isOAP) { if (isOAP.equals("Yes") && isLocal.equals("Yes")) return 2.0 + 1.0; else if (isOAP.equals("Yes")) return 2.0; else if (isLocal.equals("Yes")) return 1.0; return 0; } public static void main(String[] args) { // create a new Scanner object Scanner sc = new Scanner(System.in); // prompt the user to ask if they are disabled…arrow_forwardSolve with Java languagearrow_forwardDebug the program and make it run.arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage