1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
liraira [26]
4 years ago
13

Create an application named ShirtDemo that declares several Shirt objects and includes a display method to which you can pass di

fferent numbers of Shirt objects in successive method calls. The Shirt class contains auto-implemented properties for a Material, Color, and Size (all of type string).
Computers and Technology
1 answer:
kvv77 [185]4 years ago
4 0

Answer:

//Shirt.cs

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ShirtApplication

{

   class Shirt

   {

       public string Material { get; set; }

       public string Color { get; set; }

       public string Size { get; set; }

       public Shirt()

       {

           Material = "";

           Color = "";

           Size = "";

       }

       public Shirt(string material, string color, string size)

       {

           this.Material = material;

           this.Color = color;

           this.Size = size;

       }

   }

}

//Program.cs

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ShirtApplication

{

   class Program

   {

       static void Main(string[] args)

       {

           Shirt shirt = new Shirt("cotton", "white", "L");

           Console.WriteLine("{0,-12}{1,10}{2,10}", "Material", "Color","Size");

           display(shirt);

           shirt = new Shirt("cotton", "blue", "XL");

           display(shirt);

           shirt = new Shirt("polyester", "pink", "M");

           display(shirt);

           Console.WriteLine();

           Console.WriteLine("{0,-12}{1,10}{2,10}", "Material", "Color", "Size");

           shirt = new Shirt("cotton", "white", "L");

           display(shirt);

           shirt = new Shirt("cotton", "blue", "XL");

           display(shirt);

           shirt = new Shirt("polyester", "pink", "M");

           display(shirt);

           shirt = new Shirt("silk", "yellow", "S");

           display(shirt);

           Console.WriteLine();

           Console.WriteLine("{0,-12}{1,10}{2,10}", "Material", "Color", "Size");

           //Create an instance of Shirt

           shirt = new Shirt("cotton", "white", "L");

           //call display method

           display(shirt);

           //Create an instance of Shirt

           shirt = new Shirt("cotton", "blue", "XL");

           //call display method

           display(shirt);

           shirt = new Shirt("polyester", "pink", "M");

           //call display method

           display(shirt);

           //Create an instance of Shirt

           shirt = new Shirt("silk", "yellow", "S");

           display(shirt);

           shirt = new Shirt("silk", "white", "XXL");

           //call display method

           display(shirt);

           Console.ReadKey();

       }        

       public static void display(Shirt shirt)

       {

           Console.WriteLine("{0,12}{1,10}{2,10}", shirt.Material, shirt.Color, shirt.Size);

       }

   }

}

Explanation:

  • In the program.cs file, create an instance of Shirt .
  • Call the display method  with relevant values.
  • Define a method to display that takes Shirt object and prints the properties of shirt object to console .
You might be interested in
The high-latitude climate is _____________ the equator.<br><br> closest to<br> farthest from
BARSIC [14]
I believe it’s farthest from
5 0
3 years ago
A) What is the initial configuration BPDU for B4? B) What is the configuration BPDU of B3 after receiving the initial configurat
Dmitry [639]

Answer: b is good

Explanation:

5 0
3 years ago
Question 4 of 20
Verdich [7]

Answer:

B

Explanation:

8 0
3 years ago
Windows 10 features a storage solution called Storage Spaces. What is the name of the Storage Spaces feature that allows allocat
rewona [7]

Answer:

Data resiliency.

Explanation:

Spaces for storage may involve resilience to the information. Selecting a resiliency solution implies whether they assign capacity towards redundant details. The information resiliency choice regarding storage facilities.

Two-way mirror needs two capacity units or more. The information is engraved on both computers. Two-way mirror enables twice the volume of storage assigned to that of the storage capacity as such system capacity. This choice will prevent you against loss of a specific storage unit.

7 0
4 years ago
In the formula =SUM(A6:A9), which of the following best describes A6:A9
lianna [129]

Arguments are indeed the values used by <em>functions to perform computations</em>, and the further discussion can be defined as follows:

  • <em>Functions</em> in spreadsheet programs including Excel Sheets are simply built-in formulas that perform predefined calculations.
  • In this, the majority of these functions require data to be supplied, either by the user or from another source, to deliver a result.
  • It is a real value that is provided to the function, as well as the parameters, are initialized to the value of the arguments supplied.
  • In this question, a method "SUM(A6:A9)" is declared that takes value from A6 to A9, in its parameter(Argument) that <em>adds value from</em>.  

Therefore, the final answer is "Option A".

Learn more:

brainly.com/question/12269471

6 0
3 years ago
Read 2 more answers
Other questions:
  • To gain experience of using and combing different sorting algorithms: election sort, insertion sort, merge sort, and quick sort.
    14·1 answer
  • You have implemented a network where each device provides shared files with all other devices, what kind of network is it?
    6·1 answer
  • __________________ are evaluations of a network
    6·1 answer
  • Consider the following code.
    10·1 answer
  • What is the group scope for domain admins, domain controllers, and domain users default groups?
    9·1 answer
  • Roblox published a series of videos to help their audience use their creation engine, what are they called?
    7·2 answers
  • Difference between private and confidential data?​
    5·1 answer
  • Ok for whoever answers this, Ill wager 20 points...
    11·2 answers
  • How to test someone elese internet speed from a distance
    15·1 answer
  • 56- What is the term used when you press and hold the left mouse key and more the mouse
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!