SlideShare uma empresa Scribd logo
1 de 2
Baixar para ler offline
Paste the following code in the w3 editor
using System;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
Rectangle rectangle1 = new Rectangle(8,8);
rectangle1.display();
}
}
class Rectangle
{
int length;
int width;
public Rectangle(int l, int w)
{
length = l;
width = w;
}
public int area()
{
return length * width;
}
public void display()
{
string line = "";
for (int i = 0; i < width+2; i++)
{
if (i == 0 || i == width+1)
{
for (int j = 0; j < length*2; j++)
{
line = line + "-";
}
Console.WriteLine(line);
line = "";
}
else
{
for (int j = 0; j < length*2; j++)
{
if (j == 0 || j == length*2-1)
{
line=line+"|";
}
else
{
line = line+" ";
}
}
Console.WriteLine(line);
line = "";
}
}
}
}
}
2. In the main function, create two new rectangles rectangle2 and rectangle3 with different
dimensions than the first and different dimensions from each other. Print both of these rectangles
to the screen using the display function.

Mais conteúdo relacionado

Semelhante a Paste the following code in the w3 editorusing System;namespace .pdf

please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...
hwbloom27
 
UserInputHandlerjava package midterm2023 import javautil.pdf
UserInputHandlerjava package midterm2023 import javautil.pdfUserInputHandlerjava package midterm2023 import javautil.pdf
UserInputHandlerjava package midterm2023 import javautil.pdf
adityknits
 
KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian KomputerKOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
Aiman Hud
 
C# I need assitance on my code.. Im getting an error message Us.pdf
C# I need assitance on my code.. Im getting an error message Us.pdfC# I need assitance on my code.. Im getting an error message Us.pdf
C# I need assitance on my code.. Im getting an error message Us.pdf
eyezoneamritsar
 
import java.uti-WPS Office.docx
import java.uti-WPS Office.docximport java.uti-WPS Office.docx
import java.uti-WPS Office.docx
Katecate1
 

Semelhante a Paste the following code in the w3 editorusing System;namespace .pdf (20)

Java practical
Java practicalJava practical
Java practical
 
Tools and Techniques for Understanding Threading Behavior in Android*
Tools and Techniques for Understanding Threading Behavior in Android*Tools and Techniques for Understanding Threading Behavior in Android*
Tools and Techniques for Understanding Threading Behavior in Android*
 
please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...
 
C#.net
C#.netC#.net
C#.net
 
UserInputHandlerjava package midterm2023 import javautil.pdf
UserInputHandlerjava package midterm2023 import javautil.pdfUserInputHandlerjava package midterm2023 import javautil.pdf
UserInputHandlerjava package midterm2023 import javautil.pdf
 
Chapter i(introduction to java)
Chapter i(introduction to java)Chapter i(introduction to java)
Chapter i(introduction to java)
 
Sam wd programs
Sam wd programsSam wd programs
Sam wd programs
 
Operators
OperatorsOperators
Operators
 
Pemrograman visual
Pemrograman visualPemrograman visual
Pemrograman visual
 
Base de-datos
Base de-datosBase de-datos
Base de-datos
 
KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian KomputerKOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
KOLEJ KOMUNITI - Sijil Aplikasi Perisian Komputer
 
Ch3
Ch3Ch3
Ch3
 
C++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfC++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdf
 
Java_practical_handbook
Java_practical_handbookJava_practical_handbook
Java_practical_handbook
 
C# I need assitance on my code.. Im getting an error message Us.pdf
C# I need assitance on my code.. Im getting an error message Us.pdfC# I need assitance on my code.. Im getting an error message Us.pdf
C# I need assitance on my code.. Im getting an error message Us.pdf
 
Oops lab manual2
Oops lab manual2Oops lab manual2
Oops lab manual2
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_paper
 
Lecture 9_Classes.pptx
Lecture 9_Classes.pptxLecture 9_Classes.pptx
Lecture 9_Classes.pptx
 
Arrays, Structures And Enums
Arrays, Structures And EnumsArrays, Structures And Enums
Arrays, Structures And Enums
 
import java.uti-WPS Office.docx
import java.uti-WPS Office.docximport java.uti-WPS Office.docx
import java.uti-WPS Office.docx
 

Mais de alicesilverblr

Part 1 � 10 marksAster Turane Computers uses a perpetual accountin.pdf
Part 1 � 10 marksAster Turane Computers uses a perpetual accountin.pdfPart 1 � 10 marksAster Turane Computers uses a perpetual accountin.pdf
Part 1 � 10 marksAster Turane Computers uses a perpetual accountin.pdf
alicesilverblr
 
Part 1 Refer to pages 92-100 in your text as you answer these quest.pdf
Part 1 Refer to pages 92-100 in your text as you answer these quest.pdfPart 1 Refer to pages 92-100 in your text as you answer these quest.pdf
Part 1 Refer to pages 92-100 in your text as you answer these quest.pdf
alicesilverblr
 
page 6-7 Fraud (previously referred to as irregularities) -Inten.pdf
page 6-7 Fraud (previously referred to as irregularities) -Inten.pdfpage 6-7 Fraud (previously referred to as irregularities) -Inten.pdf
page 6-7 Fraud (previously referred to as irregularities) -Inten.pdf
alicesilverblr
 
page 9 STAFF DISCUSSION OF THE RISK OF MATERIAL MISSTATEMENT DUE T.pdf
page 9 STAFF DISCUSSION OF THE RISK OF MATERIAL MISSTATEMENT DUE T.pdfpage 9 STAFF DISCUSSION OF THE RISK OF MATERIAL MISSTATEMENT DUE T.pdf
page 9 STAFF DISCUSSION OF THE RISK OF MATERIAL MISSTATEMENT DUE T.pdf
alicesilverblr
 
page 8 III. OUTLINE OF STATEMENT ON AUDITING STANDARDS NO. 99, CON.pdf
page 8 III. OUTLINE OF STATEMENT ON AUDITING STANDARDS NO. 99, CON.pdfpage 8 III. OUTLINE OF STATEMENT ON AUDITING STANDARDS NO. 99, CON.pdf
page 8 III. OUTLINE OF STATEMENT ON AUDITING STANDARDS NO. 99, CON.pdf
alicesilverblr
 
page 10 (4) In-house legal counsel. E. Be aware in evaluating ma.pdf
page 10 (4) In-house legal counsel. E. Be aware in evaluating ma.pdfpage 10 (4) In-house legal counsel. E. Be aware in evaluating ma.pdf
page 10 (4) In-house legal counsel. E. Be aware in evaluating ma.pdf
alicesilverblr
 
p14-15 34. The risk of fraud may be so high as to cause the audi.pdf
p14-15 34. The risk of fraud may be so high as to cause the audi.pdfp14-15 34. The risk of fraud may be so high as to cause the audi.pdf
p14-15 34. The risk of fraud may be so high as to cause the audi.pdf
alicesilverblr
 
p13 29. The auditor should evaluate whether analytical procedure.pdf
p13 29. The auditor should evaluate whether analytical procedure.pdfp13 29. The auditor should evaluate whether analytical procedure.pdf
p13 29. The auditor should evaluate whether analytical procedure.pdf
alicesilverblr
 

Mais de alicesilverblr (20)

Part B Vulnerability Management Plan To prepare a vulnerability.pdf
Part B Vulnerability Management Plan To prepare a vulnerability.pdfPart B Vulnerability Management Plan To prepare a vulnerability.pdf
Part B Vulnerability Management Plan To prepare a vulnerability.pdf
 
Part 1 � 10 marksAster Turane Computers uses a perpetual accountin.pdf
Part 1 � 10 marksAster Turane Computers uses a perpetual accountin.pdfPart 1 � 10 marksAster Turane Computers uses a perpetual accountin.pdf
Part 1 � 10 marksAster Turane Computers uses a perpetual accountin.pdf
 
Part 1 Refer to pages 92-100 in your text as you answer these quest.pdf
Part 1 Refer to pages 92-100 in your text as you answer these quest.pdfPart 1 Refer to pages 92-100 in your text as you answer these quest.pdf
Part 1 Refer to pages 92-100 in your text as you answer these quest.pdf
 
Para arz B�y�k Buhran srasnda d�t� ��nk� __________. Yant se�enekl.pdf
Para arz B�y�k Buhran srasnda d�t� ��nk� __________. Yant se�enekl.pdfPara arz B�y�k Buhran srasnda d�t� ��nk� __________. Yant se�enekl.pdf
Para arz B�y�k Buhran srasnda d�t� ��nk� __________. Yant se�enekl.pdf
 
Pandas is a Python library used for working with data sets. It has f.pdf
Pandas is a Python library used for working with data sets. It has f.pdfPandas is a Python library used for working with data sets. It has f.pdf
Pandas is a Python library used for working with data sets. It has f.pdf
 
page 6-7 Fraud (previously referred to as irregularities) -Inten.pdf
page 6-7 Fraud (previously referred to as irregularities) -Inten.pdfpage 6-7 Fraud (previously referred to as irregularities) -Inten.pdf
page 6-7 Fraud (previously referred to as irregularities) -Inten.pdf
 
page 9 STAFF DISCUSSION OF THE RISK OF MATERIAL MISSTATEMENT DUE T.pdf
page 9 STAFF DISCUSSION OF THE RISK OF MATERIAL MISSTATEMENT DUE T.pdfpage 9 STAFF DISCUSSION OF THE RISK OF MATERIAL MISSTATEMENT DUE T.pdf
page 9 STAFF DISCUSSION OF THE RISK OF MATERIAL MISSTATEMENT DUE T.pdf
 
page 8 III. OUTLINE OF STATEMENT ON AUDITING STANDARDS NO. 99, CON.pdf
page 8 III. OUTLINE OF STATEMENT ON AUDITING STANDARDS NO. 99, CON.pdfpage 8 III. OUTLINE OF STATEMENT ON AUDITING STANDARDS NO. 99, CON.pdf
page 8 III. OUTLINE OF STATEMENT ON AUDITING STANDARDS NO. 99, CON.pdf
 
page 12 B. Conflicting or missing audit evidence, such as (1) Mis.pdf
page 12 B. Conflicting or missing audit evidence, such as (1) Mis.pdfpage 12 B. Conflicting or missing audit evidence, such as (1) Mis.pdf
page 12 B. Conflicting or missing audit evidence, such as (1) Mis.pdf
 
page 10 (4) In-house legal counsel. E. Be aware in evaluating ma.pdf
page 10 (4) In-house legal counsel. E. Be aware in evaluating ma.pdfpage 10 (4) In-house legal counsel. E. Be aware in evaluating ma.pdf
page 10 (4) In-house legal counsel. E. Be aware in evaluating ma.pdf
 
p14-15 34. The risk of fraud may be so high as to cause the audi.pdf
p14-15 34. The risk of fraud may be so high as to cause the audi.pdfp14-15 34. The risk of fraud may be so high as to cause the audi.pdf
p14-15 34. The risk of fraud may be so high as to cause the audi.pdf
 
p13 29. The auditor should evaluate whether analytical procedure.pdf
p13 29. The auditor should evaluate whether analytical procedure.pdfp13 29. The auditor should evaluate whether analytical procedure.pdf
p13 29. The auditor should evaluate whether analytical procedure.pdf
 
P1 Una entidad adquiere un elemento de equipo que no es de naturale.pdf
P1 Una entidad adquiere un elemento de equipo que no es de naturale.pdfP1 Una entidad adquiere un elemento de equipo que no es de naturale.pdf
P1 Una entidad adquiere un elemento de equipo que no es de naturale.pdf
 
Owner, Andy Pforzheimer, holds a meeting with his employees in which.pdf
Owner, Andy Pforzheimer, holds a meeting with his employees in which.pdfOwner, Andy Pforzheimer, holds a meeting with his employees in which.pdf
Owner, Andy Pforzheimer, holds a meeting with his employees in which.pdf
 
ow Effective Managers Use Information Systems Advances in computer-b.pdf
ow Effective Managers Use Information Systems Advances in computer-b.pdfow Effective Managers Use Information Systems Advances in computer-b.pdf
ow Effective Managers Use Information Systems Advances in computer-b.pdf
 
Overview of the Animal Kingdom (ch. 32)a. Describe the origins and.pdf
Overview of the Animal Kingdom (ch. 32)a. Describe the origins and.pdfOverview of the Animal Kingdom (ch. 32)a. Describe the origins and.pdf
Overview of the Animal Kingdom (ch. 32)a. Describe the origins and.pdf
 
Over the past ten years, if you had an innovative product like �EarP.pdf
Over the past ten years, if you had an innovative product like �EarP.pdfOver the past ten years, if you had an innovative product like �EarP.pdf
Over the past ten years, if you had an innovative product like �EarP.pdf
 
OTEL RIXOS PREMIUM BELEK OTEL POZSYON PAZARLAMA EKB COVID-19d.pdf
OTEL RIXOS PREMIUM BELEK OTEL POZSYON PAZARLAMA EKB COVID-19d.pdfOTEL RIXOS PREMIUM BELEK OTEL POZSYON PAZARLAMA EKB COVID-19d.pdf
OTEL RIXOS PREMIUM BELEK OTEL POZSYON PAZARLAMA EKB COVID-19d.pdf
 
other information provided is the answer for T T=-0.62 i still ne.pdf
other information provided is the answer for T T=-0.62 i still ne.pdfother information provided is the answer for T T=-0.62 i still ne.pdf
other information provided is the answer for T T=-0.62 i still ne.pdf
 
Please complete the fill in the box exercise by identify the federal.pdf
Please complete the fill in the box exercise by identify the federal.pdfPlease complete the fill in the box exercise by identify the federal.pdf
Please complete the fill in the box exercise by identify the federal.pdf
 

Último

Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Último (20)

FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 

Paste the following code in the w3 editorusing System;namespace .pdf

  • 1. Paste the following code in the w3 editor using System; namespace HelloWorld { class Program { static void Main(string[] args) { Rectangle rectangle1 = new Rectangle(8,8); rectangle1.display(); } } class Rectangle { int length; int width; public Rectangle(int l, int w) { length = l; width = w; } public int area() { return length * width; } public void display() { string line = ""; for (int i = 0; i < width+2; i++)
  • 2. { if (i == 0 || i == width+1) { for (int j = 0; j < length*2; j++) { line = line + "-"; } Console.WriteLine(line); line = ""; } else { for (int j = 0; j < length*2; j++) { if (j == 0 || j == length*2-1) { line=line+"|"; } else { line = line+" "; } } Console.WriteLine(line); line = ""; } } } } } 2. In the main function, create two new rectangles rectangle2 and rectangle3 with different dimensions than the first and different dimensions from each other. Print both of these rectangles to the screen using the display function.