Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
11th Edition
ISBN: 9780134743356
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 5, Problem 6.1E

What does the following program do?

  1. 1 // Exercise 5.10: Printing.java
  2. 2 public class Printing {
    1. 3 public static void main(String[] args)
      1. 4 for (int i = 1; i <= 10; i++) {
        1. 5 for (int j = 1; j <= 5; j++) {
          1. 6 System.out.print('@');
        2. 7 }
  3. 8
    1. 9 System.out.println();
  4. 10 }
    1. 11 }
  5. 12 }
Blurred answer
Students have asked these similar questions
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…
* CENGAGE MINDTAP Programming Exercise 3-6 Instructions BookstoreCredit.java + 1 import java.util.Scanner; 2 public class BookstoreCredit { To encourage good grades, Hermosa High School has decided to public static void main (String args[]) { // Write your code here 3 award each student a bookstore credit that is 10 times the student's 4 grade point average. 5 } 6 public static void computeDiscount(String name, double gpa) { // Write your code here } In other words, a student with a 3.2 grade point average receives a 8 $32.0 credit. 10 Create an application that prompts a student for a name and grade 11 } point average, and then passes the values to a method ( 12 computeDiscount ) that displays a descriptive message. The message uses the student's name, echoes the grade point average, and computes and displays the credit. An example of the program is shown below: Enter your name >> John Enter your gpa >>3.4 John, your GPA is 3.4, so your credit is $34.0 Grading Write your Java code in…
9 */ 10 public class TwoColors { 11 public static void main(String [] args) { Scanner in = new Scanner(System.in); 12 13 14 15 16 System.out.print("Enter your first favorite color: "); 17 // Step 2: Read in the next line of input and assign it to a String variable color1 18 19 // 20 21 22 // Step 3: Trim spaces from both end and convert the input to all lowercase and assign it back to the same variable 23 24 // 25 // 26 27 28 29 30 // Step 4: Read in the next line of input and assign it to a String variable color2 31 32 // 33 34 35 36 37 // Step 5: Trim spaces from both end and convert the // 38 input to all lowercase and assign it back 39 // to the same variable 40 41 42 43 // Step 6: Display a message according to the following: 44 // first color second color message 45 // light blue red red That's wonderful! 46 // light blue That's even better! 47 // otherwise That's also great! 48 49 50 51 ミミミ

Chapter 5 Solutions

Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)

Ch. 5 - State whether each of the following is true or...Ch. 5 - Prob. 2.5SRECh. 5 - State whether each of the following is true or...Ch. 5 - Prob. 2.7SRECh. 5 - Prob. 3.1SRECh. 5 - Prob. 3.2SRECh. 5 - Write a Java statement or a set of Java statements...Ch. 5 - Prob. 3.4SRECh. 5 - Find the error in each of the following code...Ch. 5 - Find the error in each of the following code...Ch. 5 - Find the error in each of the following code...Ch. 5 - Find the error in each of the following code...Ch. 5 - Describe the four basic elements of...Ch. 5 - Compare and contrast the while and for iteration...Ch. 5 - Prob. 3.1ECh. 5 - Compare and contrast the break and continue...Ch. 5 - Find and correct the error(s) in each of the...Ch. 5 - The following code should print whether integer...Ch. 5 - Prob. 5.3ECh. 5 - Find and correct the error(s) in each of the...Ch. 5 - What does the following program do? 1 // Exercise...Ch. 5 - (Find the Smallest Value) Write an application...Ch. 5 - (Calculating the Product of Odd Integers) Write an...Ch. 5 - (Factorials) Factorials are used frequently in...Ch. 5 - (Modified Compound-Interest Program) Modify the...Ch. 5 - (Triangle Printing Program) Write an application...Ch. 5 - (Bar-Chart Printing Program) One interesting...Ch. 5 - (Calculating Sales) An online retailer sells five...Ch. 5 - (Modified Compound-Interest Program) Modify the...Ch. 5 - Assume that i = 1, j = 2, k = 3 and m = 2. What...Ch. 5 - (Calculating the Value of ) Calculate the value of...Ch. 5 - (Pythagorean Triples) A right triangle can have...Ch. 5 - (Modified Triangle-Printing Program) Modify...Ch. 5 - (De Morgans Laws) In this chapter, we discussed...Ch. 5 - (Diamond-Printing Program) Write an application...Ch. 5 - Prob. 21.1ECh. 5 - A criticism of the break statement and the...Ch. 5 - What does the following program segment do? 1 for...Ch. 5 - Describe in general how youd remove any continue...Ch. 5 - Prob. 25.1E
Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Computational Software for Intelligent System Design; Author: Cadence Design Systems;https://www.youtube.com/watch?v=dLXZ6bM--j0;License: Standard Youtube License