SlideShare a Scribd company logo
Write a program that uses the DrawingPanel to produces the following figure.
Solution
import java.awt.*;
public class DrawingEx
{
public static void main(String [] args)
{
DrawingPanel panel= new DrawingPanel(500,400);
Graphics g = panel.getGraphics();
g.setFont(new Font ("Monospaced",Font.Bold,14));
Scanner s=new Scanner(System.in);
System.out.println("enter number of lines");
int n= Integer.parseInt(s.readLine());
int m=n;
for(int i=0;i<n;i++)
{
for(int j=0;j<m-1;j++)
{
System.out.println(" ");
g.drawLine(m-1,0,m,n)
m--;
n--;
}
}
}

More Related Content

More from drosa1

You are a security consultant for a company that has a location in Hou (1).docx
You are a security consultant for a company that has a location in Hou (1).docxYou are a security consultant for a company that has a location in Hou (1).docx
You are a security consultant for a company that has a location in Hou (1).docx
drosa1
 
You are a security consultant for a company that has a location in Hou (3).docx
You are a security consultant for a company that has a location in Hou (3).docxYou are a security consultant for a company that has a location in Hou (3).docx
You are a security consultant for a company that has a location in Hou (3).docx
drosa1
 
You are a security consultant for a company that has a location in Hou (2).docx
You are a security consultant for a company that has a location in Hou (2).docxYou are a security consultant for a company that has a location in Hou (2).docx
You are a security consultant for a company that has a location in Hou (2).docx
drosa1
 
You are a security consultant for a company that has a location in Hou.docx
You are a security consultant for a company that has a location in Hou.docxYou are a security consultant for a company that has a location in Hou.docx
You are a security consultant for a company that has a location in Hou.docx
drosa1
 
You and another tech are discussing the relative merits of SCSI interf.docx
You and another tech are discussing the relative merits of SCSI interf.docxYou and another tech are discussing the relative merits of SCSI interf.docx
You and another tech are discussing the relative merits of SCSI interf.docx
drosa1
 
Write a program in C++ that will return 1 if the elements of an n-elem.docx
Write a program in C++ that will return 1 if the elements of an n-elem.docxWrite a program in C++ that will return 1 if the elements of an n-elem.docx
Write a program in C++ that will return 1 if the elements of an n-elem.docx
drosa1
 
Write a java program that reads 10 integers from the keyboard and stor.docx
Write a java program that reads 10 integers from the keyboard and stor.docxWrite a java program that reads 10 integers from the keyboard and stor.docx
Write a java program that reads 10 integers from the keyboard and stor.docx
drosa1
 
writing formulas for compounds chart Writing Formulas for Compounds Ch.docx
writing formulas for compounds chart Writing Formulas for Compounds Ch.docxwriting formulas for compounds chart Writing Formulas for Compounds Ch.docx
writing formulas for compounds chart Writing Formulas for Compounds Ch.docx
drosa1
 
Write the expression as the logarithm of a single quantity- 1.docx
Write the expression as the logarithm of a single quantity-      1.docxWrite the expression as the logarithm of a single quantity-      1.docx
Write the expression as the logarithm of a single quantity- 1.docx
drosa1
 
Write and implement a recursive version of the binary search algorithm.docx
Write and implement a recursive version of the binary search algorithm.docxWrite and implement a recursive version of the binary search algorithm.docx
Write and implement a recursive version of the binary search algorithm.docx
drosa1
 
write a file declaration that holds text charaters and can be stored i.docx
write a file declaration that holds text charaters and can be stored i.docxwrite a file declaration that holds text charaters and can be stored i.docx
write a file declaration that holds text charaters and can be stored i.docx
drosa1
 
Write a program that calculates the final value of a ten year- $10-000.docx
Write a program that calculates the final value of a ten year- $10-000.docxWrite a program that calculates the final value of a ten year- $10-000.docx
Write a program that calculates the final value of a ten year- $10-000.docx
drosa1
 
Write the equation in the slope-intercept form- Solution.docx
Write the equation in the slope-intercept form-       Solution.docxWrite the equation in the slope-intercept form-       Solution.docx
Write the equation in the slope-intercept form- Solution.docx
drosa1
 
Write the balanced neutralization reaction between H2S04 and KOH in aq.docx
Write the balanced neutralization reaction between H2S04 and KOH in aq.docxWrite the balanced neutralization reaction between H2S04 and KOH in aq.docx
Write the balanced neutralization reaction between H2S04 and KOH in aq.docx
drosa1
 
Write an outline for the following research paper topic- Managerial Ac.docx
Write an outline for the following research paper topic- Managerial Ac.docxWrite an outline for the following research paper topic- Managerial Ac.docx
Write an outline for the following research paper topic- Managerial Ac.docx
drosa1
 
write a vb program that uses a while loop that prompts a user to enter.docx
write a vb program that uses a while loop that prompts a user to enter.docxwrite a vb program that uses a while loop that prompts a user to enter.docx
write a vb program that uses a while loop that prompts a user to enter.docx
drosa1
 
Write a temperature conversion program that converts from Fahrenheit t.docx
Write a temperature conversion program that converts from Fahrenheit t.docxWrite a temperature conversion program that converts from Fahrenheit t.docx
Write a temperature conversion program that converts from Fahrenheit t.docx
drosa1
 
Write a function file in matlab that utilizes Eulers method to solve t.docx
Write a function file in matlab that utilizes Eulers method to solve t.docxWrite a function file in matlab that utilizes Eulers method to solve t.docx
Write a function file in matlab that utilizes Eulers method to solve t.docx
drosa1
 

More from drosa1 (18)

You are a security consultant for a company that has a location in Hou (1).docx
You are a security consultant for a company that has a location in Hou (1).docxYou are a security consultant for a company that has a location in Hou (1).docx
You are a security consultant for a company that has a location in Hou (1).docx
 
You are a security consultant for a company that has a location in Hou (3).docx
You are a security consultant for a company that has a location in Hou (3).docxYou are a security consultant for a company that has a location in Hou (3).docx
You are a security consultant for a company that has a location in Hou (3).docx
 
You are a security consultant for a company that has a location in Hou (2).docx
You are a security consultant for a company that has a location in Hou (2).docxYou are a security consultant for a company that has a location in Hou (2).docx
You are a security consultant for a company that has a location in Hou (2).docx
 
You are a security consultant for a company that has a location in Hou.docx
You are a security consultant for a company that has a location in Hou.docxYou are a security consultant for a company that has a location in Hou.docx
You are a security consultant for a company that has a location in Hou.docx
 
You and another tech are discussing the relative merits of SCSI interf.docx
You and another tech are discussing the relative merits of SCSI interf.docxYou and another tech are discussing the relative merits of SCSI interf.docx
You and another tech are discussing the relative merits of SCSI interf.docx
 
Write a program in C++ that will return 1 if the elements of an n-elem.docx
Write a program in C++ that will return 1 if the elements of an n-elem.docxWrite a program in C++ that will return 1 if the elements of an n-elem.docx
Write a program in C++ that will return 1 if the elements of an n-elem.docx
 
Write a java program that reads 10 integers from the keyboard and stor.docx
Write a java program that reads 10 integers from the keyboard and stor.docxWrite a java program that reads 10 integers from the keyboard and stor.docx
Write a java program that reads 10 integers from the keyboard and stor.docx
 
writing formulas for compounds chart Writing Formulas for Compounds Ch.docx
writing formulas for compounds chart Writing Formulas for Compounds Ch.docxwriting formulas for compounds chart Writing Formulas for Compounds Ch.docx
writing formulas for compounds chart Writing Formulas for Compounds Ch.docx
 
Write the expression as the logarithm of a single quantity- 1.docx
Write the expression as the logarithm of a single quantity-      1.docxWrite the expression as the logarithm of a single quantity-      1.docx
Write the expression as the logarithm of a single quantity- 1.docx
 
Write and implement a recursive version of the binary search algorithm.docx
Write and implement a recursive version of the binary search algorithm.docxWrite and implement a recursive version of the binary search algorithm.docx
Write and implement a recursive version of the binary search algorithm.docx
 
write a file declaration that holds text charaters and can be stored i.docx
write a file declaration that holds text charaters and can be stored i.docxwrite a file declaration that holds text charaters and can be stored i.docx
write a file declaration that holds text charaters and can be stored i.docx
 
Write a program that calculates the final value of a ten year- $10-000.docx
Write a program that calculates the final value of a ten year- $10-000.docxWrite a program that calculates the final value of a ten year- $10-000.docx
Write a program that calculates the final value of a ten year- $10-000.docx
 
Write the equation in the slope-intercept form- Solution.docx
Write the equation in the slope-intercept form-       Solution.docxWrite the equation in the slope-intercept form-       Solution.docx
Write the equation in the slope-intercept form- Solution.docx
 
Write the balanced neutralization reaction between H2S04 and KOH in aq.docx
Write the balanced neutralization reaction between H2S04 and KOH in aq.docxWrite the balanced neutralization reaction between H2S04 and KOH in aq.docx
Write the balanced neutralization reaction between H2S04 and KOH in aq.docx
 
Write an outline for the following research paper topic- Managerial Ac.docx
Write an outline for the following research paper topic- Managerial Ac.docxWrite an outline for the following research paper topic- Managerial Ac.docx
Write an outline for the following research paper topic- Managerial Ac.docx
 
write a vb program that uses a while loop that prompts a user to enter.docx
write a vb program that uses a while loop that prompts a user to enter.docxwrite a vb program that uses a while loop that prompts a user to enter.docx
write a vb program that uses a while loop that prompts a user to enter.docx
 
Write a temperature conversion program that converts from Fahrenheit t.docx
Write a temperature conversion program that converts from Fahrenheit t.docxWrite a temperature conversion program that converts from Fahrenheit t.docx
Write a temperature conversion program that converts from Fahrenheit t.docx
 
Write a function file in matlab that utilizes Eulers method to solve t.docx
Write a function file in matlab that utilizes Eulers method to solve t.docxWrite a function file in matlab that utilizes Eulers method to solve t.docx
Write a function file in matlab that utilizes Eulers method to solve t.docx
 

Recently uploaded

Odoo 17 Social Marketing - Lead Generation On Facebook
Odoo 17 Social Marketing - Lead Generation On FacebookOdoo 17 Social Marketing - Lead Generation On Facebook
Odoo 17 Social Marketing - Lead Generation On Facebook
Celine George
 
Odoo 17 Events - Attendees List Scanning
Odoo 17 Events - Attendees List ScanningOdoo 17 Events - Attendees List Scanning
Odoo 17 Events - Attendees List Scanning
Celine George
 
Power of Ignored Skills: Change the Way You Think and Decide by Manoj Tripathi
Power of Ignored Skills: Change the Way You Think and Decide by Manoj TripathiPower of Ignored Skills: Change the Way You Think and Decide by Manoj Tripathi
Power of Ignored Skills: Change the Way You Think and Decide by Manoj Tripathi
Pankaj523992
 
How to Manage Access Rights & User Types in Odoo 17
How to Manage Access Rights & User Types in Odoo 17How to Manage Access Rights & User Types in Odoo 17
How to Manage Access Rights & User Types in Odoo 17
Celine George
 
SEQUNCES Lecture_Notes_Unit4_chapter11_sequence
SEQUNCES  Lecture_Notes_Unit4_chapter11_sequenceSEQUNCES  Lecture_Notes_Unit4_chapter11_sequence
SEQUNCES Lecture_Notes_Unit4_chapter11_sequence
Murugan Solaiyappan
 
Edukasyong Pantahanan at Pangkabuhayan 1: Personal Hygiene
Edukasyong Pantahanan at  Pangkabuhayan 1: Personal HygieneEdukasyong Pantahanan at  Pangkabuhayan 1: Personal Hygiene
Edukasyong Pantahanan at Pangkabuhayan 1: Personal Hygiene
MJDuyan
 
BRIGADA ESKWELA OPENING PROGRAM KICK OFF.pptx
BRIGADA ESKWELA OPENING PROGRAM KICK OFF.pptxBRIGADA ESKWELA OPENING PROGRAM KICK OFF.pptx
BRIGADA ESKWELA OPENING PROGRAM KICK OFF.pptx
kambal1234567890
 
"DANH SÁCH THÍ SINH XÉT TUYỂN SỚM ĐỦ ĐIỀU KIỆN TRÚNG TUYỂN ĐẠI HỌC CHÍNH QUY ...
"DANH SÁCH THÍ SINH XÉT TUYỂN SỚM ĐỦ ĐIỀU KIỆN TRÚNG TUYỂN ĐẠI HỌC CHÍNH QUY ..."DANH SÁCH THÍ SINH XÉT TUYỂN SỚM ĐỦ ĐIỀU KIỆN TRÚNG TUYỂN ĐẠI HỌC CHÍNH QUY ...
"DANH SÁCH THÍ SINH XÉT TUYỂN SỚM ĐỦ ĐIỀU KIỆN TRÚNG TUYỂN ĐẠI HỌC CHÍNH QUY ...
thanhluan21
 
Individual Performance Commitment Review Form-Developmental Plan.docx
Individual Performance Commitment Review Form-Developmental Plan.docxIndividual Performance Commitment Review Form-Developmental Plan.docx
Individual Performance Commitment Review Form-Developmental Plan.docx
monicaaringo1
 
How to Create a New Article in Knowledge App in Odoo 17
How to Create a New Article in Knowledge App in Odoo 17How to Create a New Article in Knowledge App in Odoo 17
How to Create a New Article in Knowledge App in Odoo 17
Celine George
 
DANH SÁCH THÍ SINH XÉT TUYỂN SỚM ĐỦ ĐIỀU KIỆN TRÚNG TUYỂN ĐẠI HỌC CHÍNH QUY N...
DANH SÁCH THÍ SINH XÉT TUYỂN SỚM ĐỦ ĐIỀU KIỆN TRÚNG TUYỂN ĐẠI HỌC CHÍNH QUY N...DANH SÁCH THÍ SINH XÉT TUYỂN SỚM ĐỦ ĐIỀU KIỆN TRÚNG TUYỂN ĐẠI HỌC CHÍNH QUY N...
DANH SÁCH THÍ SINH XÉT TUYỂN SỚM ĐỦ ĐIỀU KIỆN TRÚNG TUYỂN ĐẠI HỌC CHÍNH QUY N...
thanhluan21
 
The Cruelty of Animal Testing in the Industry.pdf
The Cruelty of Animal Testing in the Industry.pdfThe Cruelty of Animal Testing in the Industry.pdf
The Cruelty of Animal Testing in the Industry.pdf
luzmilaglez334
 
modul ajar kelas x bahasa inggris 24/254
modul ajar kelas x bahasa inggris 24/254modul ajar kelas x bahasa inggris 24/254
modul ajar kelas x bahasa inggris 24/254
NurFitriah45
 
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...
Nguyen Thanh Tu Collection
 
How To Update One2many Field From OnChange of Field in Odoo 17
How To Update One2many Field From OnChange of Field in Odoo 17How To Update One2many Field From OnChange of Field in Odoo 17
How To Update One2many Field From OnChange of Field in Odoo 17
Celine George
 
View Inheritance in Odoo 17 - Odoo 17 Slides
View Inheritance in Odoo 17 - Odoo 17  SlidesView Inheritance in Odoo 17 - Odoo 17  Slides
View Inheritance in Odoo 17 - Odoo 17 Slides
Celine George
 
Allopathic M1 Srudent Orientation Powerpoint
Allopathic M1 Srudent Orientation PowerpointAllopathic M1 Srudent Orientation Powerpoint
Allopathic M1 Srudent Orientation Powerpoint
Julie Sarpy
 
Genetics Teaching Plan: Dr.Kshirsagar R.V.
Genetics Teaching Plan: Dr.Kshirsagar R.V.Genetics Teaching Plan: Dr.Kshirsagar R.V.
Genetics Teaching Plan: Dr.Kshirsagar R.V.
DrRavindrakshirsagar1
 
formative Evaluation By Dr.Kshirsagar R.V
formative Evaluation By Dr.Kshirsagar R.Vformative Evaluation By Dr.Kshirsagar R.V
formative Evaluation By Dr.Kshirsagar R.V
DrRavindrakshirsagar1
 
The basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxThe basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

Odoo 17 Social Marketing - Lead Generation On Facebook
Odoo 17 Social Marketing - Lead Generation On FacebookOdoo 17 Social Marketing - Lead Generation On Facebook
Odoo 17 Social Marketing - Lead Generation On Facebook
 
Odoo 17 Events - Attendees List Scanning
Odoo 17 Events - Attendees List ScanningOdoo 17 Events - Attendees List Scanning
Odoo 17 Events - Attendees List Scanning
 
Power of Ignored Skills: Change the Way You Think and Decide by Manoj Tripathi
Power of Ignored Skills: Change the Way You Think and Decide by Manoj TripathiPower of Ignored Skills: Change the Way You Think and Decide by Manoj Tripathi
Power of Ignored Skills: Change the Way You Think and Decide by Manoj Tripathi
 
How to Manage Access Rights & User Types in Odoo 17
How to Manage Access Rights & User Types in Odoo 17How to Manage Access Rights & User Types in Odoo 17
How to Manage Access Rights & User Types in Odoo 17
 
SEQUNCES Lecture_Notes_Unit4_chapter11_sequence
SEQUNCES  Lecture_Notes_Unit4_chapter11_sequenceSEQUNCES  Lecture_Notes_Unit4_chapter11_sequence
SEQUNCES Lecture_Notes_Unit4_chapter11_sequence
 
Edukasyong Pantahanan at Pangkabuhayan 1: Personal Hygiene
Edukasyong Pantahanan at  Pangkabuhayan 1: Personal HygieneEdukasyong Pantahanan at  Pangkabuhayan 1: Personal Hygiene
Edukasyong Pantahanan at Pangkabuhayan 1: Personal Hygiene
 
BRIGADA ESKWELA OPENING PROGRAM KICK OFF.pptx
BRIGADA ESKWELA OPENING PROGRAM KICK OFF.pptxBRIGADA ESKWELA OPENING PROGRAM KICK OFF.pptx
BRIGADA ESKWELA OPENING PROGRAM KICK OFF.pptx
 
"DANH SÁCH THÍ SINH XÉT TUYỂN SỚM ĐỦ ĐIỀU KIỆN TRÚNG TUYỂN ĐẠI HỌC CHÍNH QUY ...
"DANH SÁCH THÍ SINH XÉT TUYỂN SỚM ĐỦ ĐIỀU KIỆN TRÚNG TUYỂN ĐẠI HỌC CHÍNH QUY ..."DANH SÁCH THÍ SINH XÉT TUYỂN SỚM ĐỦ ĐIỀU KIỆN TRÚNG TUYỂN ĐẠI HỌC CHÍNH QUY ...
"DANH SÁCH THÍ SINH XÉT TUYỂN SỚM ĐỦ ĐIỀU KIỆN TRÚNG TUYỂN ĐẠI HỌC CHÍNH QUY ...
 
Individual Performance Commitment Review Form-Developmental Plan.docx
Individual Performance Commitment Review Form-Developmental Plan.docxIndividual Performance Commitment Review Form-Developmental Plan.docx
Individual Performance Commitment Review Form-Developmental Plan.docx
 
How to Create a New Article in Knowledge App in Odoo 17
How to Create a New Article in Knowledge App in Odoo 17How to Create a New Article in Knowledge App in Odoo 17
How to Create a New Article in Knowledge App in Odoo 17
 
DANH SÁCH THÍ SINH XÉT TUYỂN SỚM ĐỦ ĐIỀU KIỆN TRÚNG TUYỂN ĐẠI HỌC CHÍNH QUY N...
DANH SÁCH THÍ SINH XÉT TUYỂN SỚM ĐỦ ĐIỀU KIỆN TRÚNG TUYỂN ĐẠI HỌC CHÍNH QUY N...DANH SÁCH THÍ SINH XÉT TUYỂN SỚM ĐỦ ĐIỀU KIỆN TRÚNG TUYỂN ĐẠI HỌC CHÍNH QUY N...
DANH SÁCH THÍ SINH XÉT TUYỂN SỚM ĐỦ ĐIỀU KIỆN TRÚNG TUYỂN ĐẠI HỌC CHÍNH QUY N...
 
The Cruelty of Animal Testing in the Industry.pdf
The Cruelty of Animal Testing in the Industry.pdfThe Cruelty of Animal Testing in the Industry.pdf
The Cruelty of Animal Testing in the Industry.pdf
 
modul ajar kelas x bahasa inggris 24/254
modul ajar kelas x bahasa inggris 24/254modul ajar kelas x bahasa inggris 24/254
modul ajar kelas x bahasa inggris 24/254
 
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH LỚP 12 - GLOBAL SUCCESS - FORM MỚI 2025 - ...
 
How To Update One2many Field From OnChange of Field in Odoo 17
How To Update One2many Field From OnChange of Field in Odoo 17How To Update One2many Field From OnChange of Field in Odoo 17
How To Update One2many Field From OnChange of Field in Odoo 17
 
View Inheritance in Odoo 17 - Odoo 17 Slides
View Inheritance in Odoo 17 - Odoo 17  SlidesView Inheritance in Odoo 17 - Odoo 17  Slides
View Inheritance in Odoo 17 - Odoo 17 Slides
 
Allopathic M1 Srudent Orientation Powerpoint
Allopathic M1 Srudent Orientation PowerpointAllopathic M1 Srudent Orientation Powerpoint
Allopathic M1 Srudent Orientation Powerpoint
 
Genetics Teaching Plan: Dr.Kshirsagar R.V.
Genetics Teaching Plan: Dr.Kshirsagar R.V.Genetics Teaching Plan: Dr.Kshirsagar R.V.
Genetics Teaching Plan: Dr.Kshirsagar R.V.
 
formative Evaluation By Dr.Kshirsagar R.V
formative Evaluation By Dr.Kshirsagar R.Vformative Evaluation By Dr.Kshirsagar R.V
formative Evaluation By Dr.Kshirsagar R.V
 
The basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxThe basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptx
 

Write a program that uses the DrawingPanel to produces the following f.docx

  • 1. Write a program that uses the DrawingPanel to produces the following figure. Solution import java.awt.*; public class DrawingEx { public static void main(String [] args) { DrawingPanel panel= new DrawingPanel(500,400); Graphics g = panel.getGraphics(); g.setFont(new Font ("Monospaced",Font.Bold,14)); Scanner s=new Scanner(System.in); System.out.println("enter number of lines"); int n= Integer.parseInt(s.readLine()); int m=n; for(int i=0;i<n;i++) { for(int j=0;j<m-1;j++) {