Big Java Late Objects
2nd Edition
ISBN: 9781119330455
Author: Horstmann
Publisher: WILEY
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
Chapter 1, Problem 6RE
Explanation of Solution
a.
Java files:
- Java file contain program source code written in java
programming language. The java file uses object oriented approach, to create structured data type called “class” and is used to instantiate objects at runtime. - The java file has the extension “.java”. The java files then compiled to “...
Explanation of Solution
b.
“.exe” file:
- “.exe” is short form of executable. The “.exe” files contains programs that are able to being executed or can run by some other program.
- “java...
Explanation of Solution
c.
JAR file:
- JAR file is short for Java Archive and is a package file format.
- This file is used to make a collection of many java files and its associated metadata in to one file. This file also contains resources like texts, images and so on...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
This assignment is specifically designed to help you practice writing short Java programs and executing them at the command line. You are given a sample program and a description of what it is supposed to do. But there are errors, so you need to fix the errors
and run the program.
Start by launching a text editor, save the file as "Payroll.java" into your IST140 directory. Here is the code for your program (don't try to copy and paste, it will include unprintable characters and you will have errors when you compile):
public class Payroll{
public static void main(String[] args) {
double hrlyWage, hrsWorked, salary;
hrlyWage
15.5;
HrsWorked = 20;
}
}
//Bug here
salary hrlyWage + hrsWorked; // Bug here
System.out.print("Salary: $" + salary);
Save the file when you are done adding the code from above. Then, navigate back to the command window. Now if you type 'dir' on a windows machine (or Is on a mac), you should see the new file.
Compile the new program using javac Payroll.java
After it…
Do you write java programs according to the conditions ?
the java file is here. and the question is attached as a photo.
i
// ****************************************************************
// ParseInts.java Authors: Lewis, Loftus & DuVall-Early
// Date: 4/17/21
//
// Reads a line of text and prints the integers in the line.
//
// ****************************************************************
import java.util.Scanner;
public class ParseInts
{
//---------------------------------------------
// main method
//---------------------------------------------
public static void main(String[] args)
{
int val, sum=0;
Scanner scan = new Scanner(System.in);
System.out.println("Enter a line of text");
Scanner scanLine = new Scanner(scan.nextLine());
while (scanLine.hasNext())
{
val = Integer.parseInt(scanLine.next());
sum += val;
}
System.out.println("The sum of the integers on this line is " + sum);
scan.close();
scanLine.close();
}
}
Chapter 1 Solutions
Big Java Late Objects
Ch. 1.1 - What is required to play music on a computer?Ch. 1.1 - Why is a CD player less flexible than a computer?Ch. 1.1 - What does a computer user need to know about...Ch. 1.2 - Prob. 4SCCh. 1.2 - Which part of the computer carries out arithmetic...Ch. 1.2 - A modern smartphone is a computer, comparable to a...Ch. 1.3 - What are the two most important benefits of the...Ch. 1.3 - Prob. 8SCCh. 1.4 - Prob. 9SCCh. 1.4 - Prob. 10SC
Ch. 1.5 - How do you modify the HelloPrinter program to...Ch. 1.5 - How would you modify the HelloPrinter program to...Ch. 1.5 - Would the program continue to work if you replaced...Ch. 1.5 - What does the following set of statements print?...Ch. 1.5 - What do the following statements print?...Ch. 1.6 - Suppose you omit the "" characters around Hello,...Ch. 1.6 - Suppose you change println to Printline in the...Ch. 1.6 - Suppose you change main to hello in the...Ch. 1.6 - Prob. 19SCCh. 1.6 - Prob. 20SCCh. 1.7 - Prob. 21SCCh. 1.7 - Suppose your cell phone carrier charges you 29.95...Ch. 1.7 - Consider the following pseudocode for finding the...Ch. 1.7 - Suppose each photo in Self Check 23 had a price...Ch. 1.7 - Prob. 25SCCh. 1.7 - Prob. 26SCCh. 1 - Explain the difference between using a computer...Ch. 1 - Prob. 2RECh. 1 - Prob. 3RECh. 1 - Prob. 4RECh. 1 - Prob. 5RECh. 1 - Prob. 6RECh. 1 - What does this program print? public class Test {...Ch. 1 - What does this program print? Pay close attention...Ch. 1 - Prob. 9RECh. 1 - Write three versions of the HelloPrinter.java...Ch. 1 - How do you discover syntax errors? How do you...Ch. 1 - The cafeteria offers a discount card for sale that...Ch. 1 - Write an algorithm to settle the following...Ch. 1 - Consider the question in Exercise R1.13. Suppose...Ch. 1 - In order to estimate the cost of painting a house,...Ch. 1 - In How To 1.1, you made assumptions about the...Ch. 1 - Suppose you put your younger brother in charge of...Ch. 1 - Write pseudocode for an algorithm that describes...Ch. 1 - The ancient Babylonians had an algorithm for...Ch. 1 - Write a program that prints a greeting of your...Ch. 1 - Write a program that prints the sum of the first...Ch. 1 - Write a program that prints the product of the...Ch. 1 - Write a program that prints the balance of an...Ch. 1 - Write a program that displays your name inside a...Ch. 1 - Write a program that prints your name in large...Ch. 1 - Write a program that prints your name in Morse...Ch. 1 - Write a program that prints a face similar to (but...Ch. 1 - Write a program that prints an imitation of a Piet...Ch. 1 - Write a program that prints a house that looks...Ch. 1 - Write a program that prints an animal speaking a...Ch. 1 - Write a program that prints three items, such as...Ch. 1 - Write a program that prints a poem of your choice....Ch. 1 - Write a program that prints the United States...Ch. 1 - Type in and run the following program. Then modify...Ch. 1 - Type in and run the following program. Then modify...Ch. 1 - Modify the program from Exercise E1.16 so that the...Ch. 1 - Prob. 18PECh. 1 - Write a program that prints a two-column list of...Ch. 1 - In the United States there is no federal sales...Ch. 1 - To speak more than one language is a valuable...Ch. 1 - You want to decide whether you should drive your...Ch. 1 - You want to find out which fraction of your cars...Ch. 1 - The value of can be computed according to the...Ch. 1 - Imagine that you and a number of friends go to a...Ch. 1 - Write an algorithm to create a tile pattern...Ch. 1 - Write an algorithm that allows a robot to mow a...Ch. 1 - Consider a robot that is placed in a room. The...Ch. 1 - Consider a robot that has been placed in a maze....Ch. 1 - Suppose you received a loyalty promotion that lets...Ch. 1 - A television manufacturer advertises that a...Ch. 1 - Cameras today can correct red eye problems caused...
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
- Write a Java program that print its own source code. Note: Don't use any file patharrow_forwardThis assignment will help you to get started with NetBeans and using Java compiler: To begin, put a block comment at the beginning of your Java file (and every Java source file in the future) with the assignment number, assignment title, program author [your name], and the date it's due. Next, similar to the programs presented in the first chapter of the textbook, use System.out object to display the following information: Your first name The name of the operating system you are using The name of your project (or simply the folder name if not using the IDE) The name of the class that contains the main() method in your source file. Note: Your program should print each of the above items on a separate output line. "The name of the class that contains the main() method in your source file.public class MyClass { public static void main(String[]) { System.out.println( "Hi" ); }}arrow_forwardIn Java Suppose you are given a text file that contains the names of people. Every name in the file consistsof a first name and a last name. Unfortunately, the programmer that created the file of names hada strange sense of humor and did not guarantee that each name was on a single line of the file.Write a program that reads this file of names and writes them to a new text file, one name per line.For example, if the input file (Names.txt) contains:Bob Jones FredCharles EdMarstonJeffWilliamsThe output file (RecoveredName.txt) should be:Bob JonesFred CharlesEd MarstonJeff WilliamsSample Output:Enter the name of the input file:Names.txtEnter the name of the output file: RecoveredName.txtFile processing completed.arrow_forward
- Write a complete Java program: You have text file called "file.txt" read the contents of the text file and display them on the screen.arrow_forwardIN PYTHON PLEASE, THANK YOU!!!arrow_forwardneed help with the following. Do programming project P4.2 in Big Java: Early Objects 7th Edition. Edit the file Easter java.arrow_forward
- You are required to implement a preprocessor in Java. Your preprocessor should be able to perform the following tasks on an input file, which will be a Java source file: 1. Removing comments 2. Identifying built-in language constructs 3. Identifying loops and methodsarrow_forwardWrite a Java program to file student information in a student directory of your project folder. Create a student directory in your project directory to store all student file. Each file should have the student name, age, major and gender. Each of these student entriesshould be on a separate line.arrow_forwardPlease solve this by using python.arrow_forward
- Write a java program that: 1. Create a file with the name "BankAccount.txt" and has the following content (the account name, account number and balance of each account) The file will look like this: Amani Ali 12345432 500 Sarah Mohammad 456663343 4000 Omimah khalid 998787655 2000 Monirah Ahmad 55433424 10000 2. Read the file "BankAccount.txt" content one by one and increase the balance by 50% for each account, then write the result in a new file with the name "UpdatedAccount.txt". The new file content should have the following structure: Amani Ali 12345432 750 Sarah Mohammad 456663343 6000 Omimah khalid 998787655 3000 Monirah Ahmad 55433424 15000 3. Read an account number from the user and search the file "UpdatedAccount.txt", then print all the information of this account if exists, otherwise display a message "this account not found". Note:- Search google to find some of the built-in methods to help you in this program, such as trim(), split(), equals(), Integer.parseInt().arrow_forwardIn Python: So this is part of a large project I am working on but I'm having a hard time finding out how to read from one text file and then correct that information to another or same txt file as well as to do it alphabetically. Any help is appreciated. The code I've added was from a previous project that was similar as to what this one wants. Problem #1: How much should I study outside of class? Issue: Your fellow students liked the 2nd version of study hour’s application and want to expand it again by adding the features listed below. Minimum Study Hours per Week per Class Grade 15 A 12 B 9 C 6 D 0…arrow_forwardIn Python: So this is part of a large project I am working on but I'm having a hard time finding out how to read from one text file and then correct that information to another or same txt file as well as to do it alphabetically. Any help is appreciated. The code I've added was from a previous project that was similar as to what this one wants. I can't use custom classes and I believe I'm supposed to be opening the bad information file, writing it and corrections to a temp file and then creating a new file with the right information. I'm in a beginner class and we haven't covered anything past lists. Problem #1: How much should I study outside of class? Issue: Your fellow students liked the 2nd version of study hour’s application and want to expand it again by adding the features listed below. Minimum Study Hours per Week per Class Grade 15 A 12…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
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