Modify the following
public class
{
public static void main(String[] args)
{
System.out.print(“Hearing in the distance”);
System.out.print(“Two mandolins like creatures in the”);
System.out.print(“dark”);
System.out.print(“Creating the agony of ecstasy.”);
System.out.println(“ -George Barker”);
}
}
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
MyLab Programming with Pearson eText -- Access Code Card -- for Starting Out with Java: From Control Structures through Objects
Additional Engineering Textbook Solutions
Introduction To Programming Using Visual Basic (11th Edition)
Degarmo's Materials And Processes In Manufacturing
Web Development and Design Foundations with HTML5 (8th Edition)
Modern Database Management
Mechanics of Materials (10th Edition)
Starting Out With Visual Basic (8th Edition)
- //Assignment 06 */public static void main[](String[] args) { String pass= "ICS 111"; System.out.printIn(valPassword(pass));} /* public static boolean valPassword(String password){ if(password.length() > 6) { if(checkPass(password) { return true; } else { return false; } }else System.out.print("Too small"); return false;} public static boolean checkPass (String password){ boolean hasNum=false; boolean hasCap = false; boolean hasLow = false; char c; for(int i = 0; i < password.length(); i++) { c = password.charAt(1); if(Character.isDigit(c)); { hasNum = true; } else if(Character.isUpperCase(c)) { hasCap = true; } else if(Character.isLowerCase(c)) { hasLow = true; } } return true; { return false; } }arrow_forwardKey stroke enacted moving of a ball 1. Start (a) Write a Java program that uses the Up, ↑, Down ↓, Right → (and possibly Left) arrows of the keyboard (or keypad) to move a ball. (note the Up arrow is called “Up" with ASCII code 38, Down arrow is called "Down" with ASCII code 40, Right arrow is called "Right" with ASCII code. You can also use the 4 keys, commonly used in ODS game programming. Start Pond Figure 1. Initially Pond End End Start Pond Start Figure 2. After 3 moves up using up arrow End Pond End Figure 3. 3 moves later with right arrows Figure 4. Finally one at the lower right corner. (b) Using Java class JFrame to draw a grid of 5 horizontal lines, 5 vertical lines, a blue pond in the middle occupying 5 squares with a text Pond in the middle, a ball at the lower left corner, and texts called Start and End. This is shown exactly as in Figure 1 here. Change the color of ball from green to another color.arrow_forwardJava Program (Display the prime factors) Write a program that prompts the user to enter a positive integer and displays all its smallest factors in decreasing order. For example, if the integer is 120, the smallest factors are displayed as 5, 3, 2, 2, 2.arrow_forward
- The Huntington High School basketball team has five players named Art, Bob, Cal, Dan, and Eli. Accept the number of points scored by each player in a game and create a bar chart that illustrates the points scored by displaying an asterisk for each point. The output looks similar to the chart in Figure 6-34. import java.util.Scanner; public class BarChart { public static void main (String[] args) { Scanner input = new Scanner(System.in); int artPoints; int bobPoints; int calPoints; int danPoints; int eliPoints; System.out.print("Enter points earned by Art >> "); artPoints = input.nextInt(); System.out.print("Enter points earned by Bob >> "); bobPoints = input.nextInt(); System.out.print("Enter points earned by Cal >> "); calPoints = input.nextInt(); System.out.print("Enter points earned by Dan >> "); danPoints = input.nextInt();…arrow_forwardComplete the following program so it performs the following actions 10 times:• Generates a random number that is either 0 or 1.• Displays either the word “Yes” or the word “No” depending on the random number that was generated.// Write the necessary import statement(s) here.public class ReviewQuestion16{public static void main(String[] args){// Write the necessary code here.}}arrow_forwardCode that need debugging fix with no errors // Gets a String from user // Converts the String to lowercase, and // displays the String's length // as well as a count of letters import java.util.*; public class DebugSeven4 { public static void main(String[] args) { Scanner kb = new Scanner(System.in); String aString ; int numLetters = 0; int stringLength; System.out.println("Enter a String. Include"); System.out.println("some uppercase letters, lowercase"); System.out.print("letters, and numbers >> "); aString = kb.nextLine(); stringLength = aString.length(); System.out.print("In all lowercase, the String is: "); for(int i = 0; i <= stringLength; i++) { char ch = Character.toLowerCase(aStringcharAt(i)); System.out.print(ch); if(!Character.isLetter(ch)) numLetters++; } System.out.println(); System.out.println ("The number of CHARACTERS…arrow_forward
- Exercise 3: The following code asks a user to enter her/his age then determines if a user is an adult or not. Trace the code, to find and solve the syntax errors. You need to identify the errors and rewrite the correct code. import java.util.Scanner; public class Ex3 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println(("Enter your age:"); int age = input.nextInt(); double flag = isAdult(double age); if(flag) { System.out.println("You are an adult."); } else { System.out.println("You are not an adult."); } } public boolean isAdult(int age) { if(age > 18) { return true; } else { return false;arrow_forwardWrite an application that counts by five from 5 through 500 inclusive, and that starts a new line after every multiple of 50 (50, 100, 150, and so on). public class CountByFives { public static void main (String args[]) { // Write your code here } }arrow_forwardpRogramming Java Matcherarrow_forward
- JAVA Input. class Modulus { publicstaticvoid main(String args[]) { double a =25.64; int b =25; a = a % 10; b = b % 10; System.out.println(a +" "+ b); } } Find output.arrow_forwardForms 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_forwardDirection: Answers must be explained properly and thoroughly. You have to insert a screenshot of the results. Include the observations of your code. Python download: https://www.python.org/downloads/ Any Python Version 3.8 and later is recommendedarrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT