Study the following
// The Works of Wolfgang
public class Wolfgang
{
public static void main(String[] args)
{
System.out.print(“The works of Wolfgang\ninclude ”);
System.out.print(“the following”);
System.out.print(“\nThe Turkish March ”);
System.out.print(“and Symphony No. 40 ”);
System.out.println(“in G minor.”);
}
}
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Additional Engineering Textbook Solutions
Java: An Introduction to Problem Solving and Programming (7th Edition)
C Programming Language
Problem Solving with C++ (9th Edition)
Differential Equations: Computing and Modeling (5th Edition), Edwards, Penney & Calvis
Computer Systems: A Programmer's Perspective (3rd Edition)
Starting Out with C++: Early Objects (9th Edition)
- use javaarrow_forwardpublic static void printIt(int value) { if(value 0) { } System.out.println("Play a paladin"); System.out.println("Play a white mage"); }else { } }else if (value < 15) { System.out.println("Play a black mage"); System.out.println("Play a monk"); } else { public static void main(String[] args) { printit (5); printit (10); printit (15); Play a black mage Play a white mage (nothing/they are all printed) Play a paladin Play a monkarrow_forwardQuestion public class MyProgram { if (h 18) { public static void main(String[] args) { int h=10, t-22; System.out.print ("Good "); } } else } } What is the output displayed by the following lines of code?" System.out.print ("Morning"); t = t + 2; if (t > 30) System.out.println(" Every one!"); System.out.println("The Your answer system.out.print("Evening"); t = t + 5; temperature is " System.out.println(" Brink water?"); Degree.");arrow_forward
- // Some circle statistics public class DebugFour2 { publicstaticvoidmain(Stringargs[]) { double radius =12.6; System.out.println("Circle statistics"); double area = java.Math.PI * radius * radius; System.out.println("area is " + area); double diameter =2- radius; System.out.println("diameter is + diameter); } }arrow_forwardclass class { public static void main(String args[]) { int a =5; int b =10; first: { second: { third: { if(a == b >>1) break second; } System.out.println(a); } System.out.println(b); } } } Give result for the code Java Try to do ASAParrow_forwardPROBLEM 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_forward
- Java: ShowStudent.java: class ShowStudent { public static void main (String args[]) { Student pupil = new Student(); pupil.setIdNumber(234); pupil.setPoints(47); pupil.setHours(15); pupil.showIdNumber(); pupil.showPoints(); pupil.showHours(); System.out.println("The grade point average is " + pupil.getGradePoint()); } } ShowStudent2.java: class ShowStudent2 { public static void main (String args[]) { Student pupil = new Student(); pupil.showIdNumber(); pupil.showPoints(); pupil.showHours(); System.out.println("The grade point average is " + pupil.getGradePoint()); } } Student.java: class Student { // the private data members private int idNumber; private int hours; private int points; // Constructor added in part c Student() { } // end of constructor added in part c // the public get and set methods public void…arrow_forwardclass Exam { public static void main(String[] args) { X x = new X(); System.out.printIn(x.value); } } O a. public O b. private O c. protected O d. None of the abovearrow_forwardpublic class MysteryReturn2 {3 public static void main(String[] args)4 {5 int x = 1;6 int y = 2;7 int z = 3;89 z = mystery(x, z, y);10 System.out.println(x + " " + y + " " + z);11 }1213 public static int mystery(int c, a, int b);14 {15 c--;16 a = 2 * b + c;17 b = a - 1;18 System.out.println(b + " " + c);1920 return a;21 }22 } 1. Line 13 contains 2 errors. What are they? 2. Rewrite line 13 with the errors identifed in Question 1 corrected.arrow_forward
- public class MysteryReturn2 {3 public static void main(String[] args)4 {5 int x = 1;6 int y = 2;7 int z = 3;89 z = mystery(x, z, y);10 System.out.println(x + " " + y + " " + z);11 }1213 public static int mystery(int c, a, int b);14 {15 c--;16 a = 2 * b + c;17 b = a - 1;18 System.out.println(b + " " + c);1920 return a;21 }22 } 1. The mystery method has three parameter variables, a, b, and c. What is the scope of these variables (that is, where can they be used by their name)?arrow_forwardFix all logic and syntax errors. Results Circle statistics area is 498.75924968391547 diameter is 25.2 // Some circle statistics public class DebugFour2 { public static void main(String args[]) { double radius = 12.6; System.out.println("Circle statistics"); double area = java.Math.PI * radius * radius; System.out.println("area is " + area); double diameter = 2 - radius; System.out.println("diameter is + diameter); } }arrow_forward// Simulates a simple car with operations to drive and check the odometer.public class SimpleCar { // Number of miles driven private int miles; public SimpleCar(){ miles = 0; } public void drive(int dist){ miles = miles + dist; } public void reverse(int dist){ miles = miles - dist; } public int getOdometer(){ return miles; } public void honkHorn(){ System.out.println("beep beep"); } public void report(){ System.out.println("Car has driven: " + miles + " miles"); } }arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education