Question: 1. Modify Astack class so that the program can process stack of class objects. The definition of the class Student is provided as below: class
1. Modify Astack class so that the program can process stack of class objects. The definition of the class Student is provided as below: class Student private String name; private int id; private int grade; public int ID get f return id; ) set { id = value; } public void Input () Console.Write("Enter name:") name Console.ReadLine(); Console.Write("Enter ID:); id = int.Parse(Console.ReadLine()); Console.Write("Enter Grade:); grade - int.Parse(Console.ReadLine)); public override string ToString) return string. Format("Name: eID: 1), Grade: [2)name, id, grade); The following is a test running output nter st sica Lee i King ere is the current content of the statck: nter 1 to pop. 2 to push. 3 to exit The iten poped out is: Name: Bi11 King. ID: 1003. Grade: 90 The itens in the St ter i to pop. 2 to push. 3 to eit nter a st to push into the Stack: r wood ter pushing are
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
