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]
3 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]3 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
I dunno what to write my memo thing about ⁻³⁻
Alex73 [517]

Answer:

Wdym? I could help u

Explanation:

5 0
3 years ago
Read 2 more answers
Technician A says that wheel speed sensors are a highly probable cause of illuminated EBC warning lamps. Technician B says that
Blababa [14]

Technician A because

3 0
3 years ago
The blank method returns an integer between the two provided numbers. It can take the value of either of the provided numbers
Elis [28]

Answer:random

Explanation:

A random method returns a number between zero and one.

4 0
3 years ago
Knowledge Spark, a school with no current job openings, wants to change to a completely virtual environment and offer classes to
Sedaia [141]

Answer:

AMONG

Explanation:

US

6 0
3 years ago
It is easier to make an object move across the screen by using the tweening function rather than creating each individual frame
Vesna [10]
Uhhhh I believe it’s true if it’s wrong I’m srry ....
3 0
3 years ago
Other questions:
  • When you were configuring Encrypting File System (EFS) in the lab, a __________ on the Documents folder in the File Explorer ind
    5·1 answer
  • Discuss some design considerations that you should keep in mind when you want to design a professional-looking flyer or newslett
    5·2 answers
  • How do you create a logo on Adobe illustrator
    8·1 answer
  • Write a Unix (Linux) find-like command (myFind) in Python3 where the function will return the full paths of all the files contai
    9·1 answer
  • During which geologic era was nearly all of Earth's land concentrated into one giant mass called Pangaea?
    6·1 answer
  • If you want to insert a column into an existing table, what would you do?
    13·2 answers
  • Jonas is creating a presentation for students about volunteering. He wants to begin by speaking about the various opportunities
    11·1 answer
  • Please help me !!
    10·1 answer
  • State the difference between a monitor and a television​
    5·2 answers
  • Lance is at a bus station. his friend is using the atm machine to withdraw some money. lance notices a stranger deceptively watc
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!