Java....There are 3 parts to this question.  Please give me the code with comments for all the 3 parts. Any kind of help is appreciated. Thank you.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Java....There are 3 parts to this question.  Please give me the code with comments for all the 3 parts. Any kind of help is appreciated. Thank you.  

Assume the only console output method available is display(c), shown below, which you include in your solution.This means you are not permitted to use System.out.print(), System.out.println(), nor System.out.printf() in your methods.


public static void display (char c)
{
System.out.print (c);
}


-Implement the following methods in a program class, that has a main() method to simply test each methods.

-Apply the concept of overloading, where best, and that the methods can call themselves to reduce repeating the same code.


Part 1: Common output methods:
- display (String str) – displays all the characters in the String str

- displayln (String str) – displays all the characters in the String str, following by newline character ('\n')

- display (int val) – displays the integer in variable val

- display (double val) – displays the double in variable val

- displayln () – displays only a newline character


Part 2: Special output methods:

- displayRepeat (String str, int rep) – displays the String str, repeated as many times indicated in variable rep

- displayTriangle(String str)) – displays all the characters in the String str, in a triangle form,


ex: displayTriangle("pies") shows:
p
ii
eee
ssss


Part 3: Include the methods in your own utility class

- name the utility class whatever you want ( Util, Special, or own name, such as: YanniUtil )

- move the methods you wrote into your utility class

- adjust your test program class to call the methods from your utility class

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Math class and its different methods
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
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education