ISM3255 Assignment 5 Solved

35.00 $

Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . zip solution files instantly, after Payment


5/5 - (1 vote)

Similar to last assignment, in this assignment, you will create two classes: A MainClass and a second class which is used in the main class.

  • Choose any entity/concept that can be modeled as class and object (except “course” and “car” which we have already modeled), and define a class for it (hereafter referred to as YourClass).

YouClass should have:

  1. One meaningful integer attribute and one meaningful string attribute that can be read and written. (e.g. attributes “year” and “color” for class/object “car”)

Hint1: The attributes should be private

Hint2: use get and set for each attribute (in a public property)

  1. A method SetAttributes() that takes two parameters for and initializes the two attributes to those parameters (do not use constructors)

Hint: use the convention for naming the parameters as “inAttribute

  1. A method PrintInfo () which will print out the two attributes of any object of your class

Hint: use Console.WriteLine(….) syntax inside your method

Once you have designed YourClass, write a MainClass with a main method. Your main method should:

  1. Instantiate 2 objects of YourClass (hereafter referred to as obj1 and obj2) and initialize them with inputs from the user.

Hint1: user Console.Readline() for input from user

Hint2: use your SetAttributes to initialize your attributes

Hint: Do not forget to compile and debug your code at this point. Your code should compile and run without any error so far.

  1. Compare the integer attributes of the two objects and identify the object (objX, where X is 1 or 2) with the larger integer attribute.
  2. Print this object’s attributes using the PrintInfo() method you created

Hint: Use objX.PrintInfo() syntax in your main class


Instructions for Submission


1.      Your code should start with these two lines:

a.       //Group Number: <your group number>

b.      //Your full name

2.      Save your main class as yourGroupNumber_yourLastName.cs.

3.      Submit both classes that you created as attachments using the E-Learning Assignment tool.

Not following the instruction will result in losing some of your assignment points