Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
ompiling and Executing a Java Program
Summary
In this lab, you compile and execute a prewritten Java program.
Instructions
- Execute the program. There should be no syntax errors.
- Modify the program so it displays "I'm learning how to program in Java.". Execute the program.
- Modify the
Programming class so it prints two lines of output. Change the class name to Awesome. In Java, the file name must match the class name, so change the file name to Awesome.java. Add a second output statement that displays "That's awesome!". Execute the program.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images
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
- ZOOM + Press Esc to exit full screen Create a new java project named CH46EX 1. Create a class named Student 1. 2 private instance data fields – student name, student id 2. 1 final and static constant for a COLLEGE, set to "Fullerton" Create one programmer written constructor that accepts parameters for two instance data fields during instantiation Create a static method named demoStaticMethod ()-see output 3. | - print message, print college 4. Create a non-static method named demoObjectMethod ()– see output - print message, college, student name, student id 2. Create an application named StudentDemo 1. Create/instantiate 1 student object 2. Call each method correctly This demo is a static method Fullerton 3. Expected Output > This demo is a non-static method Fullerton Name: Wyle Coyote ID: 456arrow_forwardFix all the errors and send the code please // Application looks up home price // for different floor plans // allows upper or lowercase data entry import java.util.*; public class DebugEight3 { public static void main(String[] args) { Scanner input = new Scanner(System.in); String entry; char[] floorPlans = {'A','B','C','a','b','c'} int[] pricesInThousands = {145, 190, 235}; char plan; int x, fp = 99; String prompt = "Please select a floor plan\n" + "Our floorPlanss are:\n" + "A - Augusta, a ranch\n" + "B - Brittany, a split level\n" + "C - Colonial, a two-story\n" + "Enter floorPlans letter"; System.out.println(prompt); entry = input.next(); plan = entry.charAt(1); for(x = 0; x < floorPlans.length; ++x) if(plan == floorPlans[x]) x = fp; if(fp = 99) System.out.println("Invalid floor plan code entered")); else { if(fp…arrow_forwardProgramming Exercise 2-4 Instructions QuartsToGallons,.java + >- Terminal + 1 // QuartsToGallons.java 2 class QuartsToGallons { sandbox $ I Write a program that declares a constant named QUARTS_IN_GALLON public static void main(String[] args) { // Write your code here } 3 which holds the number of quarts in a gallon (there are 4 quarts to a gallon). 4 Also declare a variable named quartsNeeded to represent the number of 5 quarts needed for a painting job, and assign an appropriate value. Compute 6 } and display the number of gallons and quarts needed for the job. Display explanatory text with the values-for example, A job that needs 18 quarts requires 4 gallons plus 2 quarts. When submitting the program for testing/grading, assign the value 18 to quartsNeeded. Grading Write your Java code in the area on the right. Use the Run button to compile and run the code. Clicking the Run Checks button will run pre-configured tests against your code to calculate a grade. Once you are happy with…arrow_forward
- #4. Task Programming Language and Technologies▪ C# Programming Language.▪ Visual Studio 2019. Build a method called Encrypt to receive a string and return another string.The method will be a static.Build a method called Decrypt to return original string.The encryption method will be a very simple one: to encrypt add 1 to eachcharacter and to decrypt subtract 1 to each character.Note: we do not need to create any object of type Encrypter..arrow_forwardPlease help me with these two java programs. Don’t make it complex.arrow_forwardPlease show your code and result to solve this.arrow_forward
- This is Java Programming! We are working with MaxHeap Instructions: Don't modify the two codes below. You need to make a MaxHeapInterface.java that implements the bstMaxHeap in the Driver.java code. If you haven't look at the code, look at them now. Driver.java code: /** A driver that demonstrates the class BstMaxHeap. @author Frank M. Carrano @author Timothy M. Henry @version 5.0*/public class Driver {public static void main(String[] args) { String jared = "Jared"; String brittany = "Brittany"; String brett = "Brett"; String doug = "Doug"; String megan = "Megan"; String jim = "Jim"; String whitney = "Whitney"; String matt = "Matt"; String regis = "Regis"; MaxHeapInterface<String> aHeap = new BstMaxHeap<>(); aHeap.add(jared); aHeap.add(brittany); aHeap.add(brett); aHeap.add(doug); aHeap.add(megan); aHeap.add(jim); aHeap.add(whitney); aHeap.add(matt); aHeap.add(regis); if (aHeap.isEmpty()) System.out.println("The heap is empty -…arrow_forwardTASK 3. Console Input and Output. Review Scanner class and its methods, Implement the following code, make sure it runs without errors. 1 package 1lessons; 3 import java.util.Scanner; 4 5 public class ReportSum3 { public static void main(String args[]) { Scanner sc = new Scanner(System. in); 60 7 8 // Prompt the user to enter the first integer System.out.println("Enter the value for 'a' and press Enter: "); int a = sc.nextInt(); // Prompt the user to enter the second integer System.out.println("Enter the value for 'b' and press Enter: "); int b = sc.nextInt(); 10 11 12 13 14 15 16 17 18 19 20 21 22 } //Close the Scanner. It's a good practice to release the resource that was acquired sc.close(); // Display the result System.out.printf( "Provided Integers: %4d and %4d, the total is %5d\n", a, b, (a + b)); } To simplify the task, we came out with the idea to use Methods. Implement a method to add two integers.arrow_forwardWrite a java code that does the following: Opens a file named NumberList.txt, uses a loop to write the numbers 1 through 100 to the file, and then closes the file. Opens the NumberList.txt file and reads all of the numbers from the file and displays them, and then closes the file. Opens the NumberList.txt file and reads all of the numbers from the file, calculate the sum of these numbers and displays their total. Opens a file named NumberList.txt for writing, but does not erase the contents of the file if it already exists.arrow_forward
- Integer userValue is read from input. Assume userValue is greater than 1000 and less than 99999. Assign tensDigit with userValue's tens place value. Ex: If the input is 15876, then the output is: The value in the tens place is: 7 2 3 public class ValueFinder { 4 5 6 7 8 9 10 11 12 13 GHE 14 15 16} public static void main(String[] args) { new Scanner(System.in); } Scanner scnr int userValue; int tensDigit; int tempVal; userValue = scnr.nextInt(); Your code goes here */ 11 System.out.println("The value in the tens place is: + tensDigit);arrow_forwardDesign a class named CustomerRecord that holds a customer number, name, and address. Include separate methods to 'set' the value for each data field using the parameter being passed. Include separate methods to 'get' the value for each data field, i.e. "return" the field's value. Pseudocode:arrow_forward1. Instructions: The program you will analyze is shown below. The program listing contains a class definition followed by a main program. Your task is to find and write the missing code lines to make the program work correctly. Use the output statements from the print() statements to reveal this mystery :-) Please write the missing code lines clearly in the empty boxes. ###### start of Rectangle class class Rectangle: def init (self, length, width): self.length length self.width = width def GetLength (self): return self.length def GetWidth(self): return self.width def GetArea (self): return self.length * self.width def SetScale(self, scale): self.length self.length * scale self.width self.width * scale #### start of main program rec Rectangle (3,5) %3D print ('Rectangle Area: ', rectangleArea) for ES in range (2,5) : width = rec.GetWidth()arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- 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
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education