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
How to engage more underrepresented and under resourced students in stem programs?
Nady [450]

Answer:

Through after school programs

Explanation:

Under represented and under resourced students can be better engaged in STEM programs through the establishment of after school state of the arts learning centres that can augment for the vacuum in the regular school system.

In such programs, the use of technological platforms with an integrated electronic learning system is necessary, because it avails the students the opportunity to brace up with the evolving impact of information technology to learning and personal developments.

Secondly, the use of immediate resources within the reach of these under privileged and under resourced students is a necessity. for example, a student in a rural community could start become more engage in engineering designs, building technology, instrumentation and architecture through the use of disposed cartons used to construct buildings, cars etc.

8 0
3 years ago
9. The voltage of a replacement capacitor must
nasty-shy [4]

Answer:

B

Explanation:

It is the capacity (in Farad) of the capacitor that determines its behaviour in the circiut. The voltage is merely a qualification of what it can handle. Higher is "better".

6 0
3 years ago
How will advertising and communications change as technology improves?????? HELP PLEASE :0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
drek231 [11]

Technology changes advertising and communications by increasing the outreach of people that will get the message, and increasing the speed at which they get the message. Which in turn makes the advertising more relevent because they can release more product to a wider audience during a specific time period.


6 0
3 years ago
A. True
svetlana [45]

Answer : True  

Explanation: Vectors can hold, data of the same type and can automatically expand accordingly and change it’s size. The date stored in vectors should be linear.  

- The syntax for vector is vector<int>v;

- Mostly this is used in C++ as an alternative to arrays  

- If you want to use vector in your program then define it in the header first  i.e.

#include <vector>

- Push back is a function, that is used to insert an element into the vector  

- Pop back removes the element from the vector  


6 0
3 years ago
The DNS server at your headquarters holds a standard primary zone for the abc domain. A branch office connected by a slow WAN li
mafiozo [28]

Answer:

In the SOA tab of the zone's Properties dialog box, increase the refresh interval.

Explanation:

5 0
3 years ago
Other questions:
  • Which Game Is Better &amp; Favorite For You?
    12·2 answers
  • Name the component used in first generation of computer​
    10·1 answer
  • What is output? Select all that apply.
    15·1 answer
  • A junior administrator is having issues connecting to a router's console port using a TIA/EIA 568B standard cable and a USB seri
    5·1 answer
  • A ____ object is used to hold data that is retrieved from a database via the OleDbDataAdapter connection. a. DataRecord b. DataS
    12·2 answers
  • In the textbox below, write an email that you, as an administrative assistant at Techno Inc., would write to request information
    7·1 answer
  • Reports produced by the United Nations are considered
    11·2 answers
  • The first page of a website is what?​
    5·2 answers
  • Using C, Write a program that reads a series of strings from standard input and prints only those strings beginning with the let
    8·1 answer
  • Keira is creating an app for her cross-country team. Users will input their race times and the output will be a graph showing th
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!