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
Consider a system that uses a 32-bit unique salt where users have a 4-digit number as a password (e.g. 6813). Eve wants to crack
Alenkasestr [34]

Answer:

18000 seconds or 300 minutes.

Explanation:

In the example given in the question, it is stated that the system uses 32-bit unique salt which is equal to 4 bytes where every digit takes up 1 byte thus forming the 4 digit passwords.

Considering that the passwords are 4 digits, starting from 1000 and up to 9999, there are 9000 possible password combinations.

If Eve has to go through the whole range of possible password combinations and it takes her 1 second to guess 1 password. Then in the worst case scenario, it would take her 18000 seconds or 300 minutes to crack both accounts, assuming that it is possible for them to use the same passwords.

I hope this answer helps.

6 0
3 years ago
Read 2 more answers
As a computer science student, which career you will select and what do you predict about the future of that specific IT-Career.
miv72 [106K]

Answer:

A cyber security agent

Explanation:

That will mean protecting organizations from being hacked by other ethical hackers

4 0
3 years ago
Sorry but, what are brainliest for?
Advocard [28]

Answer:

smartest and accurate answer

Explanation:

5 0
3 years ago
Read 2 more answers
Which statement is true about encoding in Python?
vovangra [49]

Answer:

In Python 3, strings are automatically encoded using Unicode.

Explanation:

i just tookthe test

6 0
2 years ago
Identifying the problem is crucial when trying to solve a problem. There are several techniques that you can use to aide you in
erica [24]
Consensus Building is NOT a technique that you can use to help you in identifying a problem.
8 0
3 years ago
Other questions:
  • Which should you use to find a saved file?
    15·2 answers
  • What was the attitude of the U.S. Senate towards the Treaty of Versailles, and why did they have that attitude?​
    9·1 answer
  • What method is used to manage contention-based access on a wireless network?
    7·1 answer
  • Why is compression a "hard problem" for computers? Draw on your own experience compressing text with the text compression widget
    12·1 answer
  • Which of the following is a true statement?
    12·2 answers
  • A communication medium that carries a large amount of data at a fast speed is called
    6·1 answer
  • It is important to know the terms of use of any website because why
    12·2 answers
  • What is 4x+2x(-3-3) thanku
    11·2 answers
  • KAPWING Video Editing Software allows you to use existing You Tube Videos in your design.
    8·1 answer
  • What is the significance of the scientific method?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!