Example #1
0
        public static bool simulatePayment(debtStats student)
        {
            int pay = randNum.Next(0, 2);

            if (pay == 1)
            {
                int payment = randNum.Next(500, 5001);
                student.makePayment(payment);
            }
            return(student.loanDecrease);
        }
Example #2
0
        static void Main(string[] args)
        {
            const int numStudents = 5;

            debtStats[] debtArray = new debtStats[numStudents];

            initialize(debtArray);

            GoToSchool(debtArray);

            printStudentInfo(debtArray);
        }
Example #3
0
        public static int calcAmortization(debtStats student, int years)
        {
            int amortization = student.loanTotal() / years;

            return(amortization);
        }
Example #4
0
 public static bool testThreshold(debtStats student, int threshold)
 {
     return(student.testThreshold(threshold));
 }
Example #5
0
        static void Main()
        {
            debtStats[] studentDebts;
            int[]       testStuIDs;
            Console.Write("Please enter the number of students you wish to manage: ");
            debtStatsDriver functions   = new debtStatsDriver();
            int             numStudents = functions.randomNumStu();

            Console.Write(numStudents);
            //numStudents = randomNumStu();
            studentDebts = new debtStats[numStudents];
            testStuIDs   = new int[numStudents];
            Console.WriteLine();

            Console.Write("Please enter the debt threshold: $");
            int debtThresh = randomMoney();
            int tempMoney  = randomMoney();

            studentDebts[COUNT_START]         = new debtStats();
            studentDebts[COUNT_START].DebtCap = tempMoney;
            Console.Write(tempMoney);

            int studentCount = new int();

            studentCount = COUNT_START;
            Console.WriteLine();

            foreach (debtStats element in studentDebts)
            {
                Console.WriteLine();
                studentDebts[studentCount] = new debtStats();

                Console.Write("Enter the student ID for student ");
                Console.Write(studentCount + COUNT_OFFSET);
                Console.Write(": ");
                int tempID = functions.generateID();
                studentDebts[studentCount].StudentID = tempID;
                Console.Write(tempID);
                Console.WriteLine();
                testStuIDs[studentCount] = tempID;

                Console.Write("Enter the matriculation date for student ");
                Console.Write(studentCount + COUNT_OFFSET);
                Console.Write(" (YYYYMMDD): ");
                int tempMatr = randomMatr();
                studentDebts[studentCount].Matriculation = tempMatr;
                Console.Write(tempMatr);
                Console.WriteLine();

                Console.Write("Enter the anticipated graduation date for student ");
                Console.Write(studentCount + COUNT_OFFSET);
                Console.Write(" (YYYYMMDD): ");
                int tempGrad = randomGrad();
                studentDebts[studentCount].OrigGrad = tempGrad;
                Console.Write(tempGrad);
                Console.WriteLine();

                Console.Write("Enter the loan amount for student ");
                Console.Write(studentCount + COUNT_OFFSET);
                Console.Write(": $");
                int tempLoan = randomMoney();
                studentDebts[studentCount].OrigLoan = tempLoan;
                Console.Write(tempLoan);
                Console.WriteLine();

                Console.Write("Enter the grant amount for student ");
                Console.Write(studentCount + COUNT_OFFSET);
                Console.Write(": $");
                int tempGrant = randomMoney();
                studentDebts[studentCount].OrigGrant = tempGrant;
                Console.Write(tempGrant);
                Console.WriteLine();

                ++studentCount;
            }

            Console.WriteLine();
            Console.WriteLine("Please enter the ID of the student whose loan amount you with to update: ");
            //int tempID = Convert.ToInt32(Console.ReadLine());
            studentCount = COUNT_START;

            //if (studentDebts[studentCount].idMatch(tempID))

            Console.ReadKey();
        }
Example #6
0
        static void Main()
        {
            debtStats[] studentDebts;
            int[] testStuIDs;
            Console.Write("Please enter the number of students you wish to manage: ");
            debtStatsDriver functions = new debtStatsDriver();
            int numStudents = functions.randomNumStu();
            Console.Write(numStudents);
            //numStudents = randomNumStu();
            studentDebts = new debtStats[numStudents];
            testStuIDs = new int[numStudents];
            Console.WriteLine();

            Console.Write("Please enter the debt threshold: $");
            int debtThresh = randomMoney();
            int tempMoney = randomMoney();
            studentDebts[COUNT_START] = new debtStats();
            studentDebts[COUNT_START].DebtCap = tempMoney;
            Console.Write(tempMoney);

            int studentCount = new int(); 
            studentCount = COUNT_START;
            Console.WriteLine();

            foreach (debtStats element in studentDebts)
            {
                Console.WriteLine();
                studentDebts[studentCount] = new debtStats();

                Console.Write("Enter the student ID for student ");
                Console.Write(studentCount + COUNT_OFFSET);
                Console.Write(": ");
                int tempID = functions.generateID();
                studentDebts[studentCount].StudentID = tempID;
                Console.Write(tempID);
                Console.WriteLine();
                testStuIDs[studentCount] = tempID;

                Console.Write("Enter the matriculation date for student ");
                Console.Write(studentCount + COUNT_OFFSET);
                Console.Write(" (YYYYMMDD): ");
                int tempMatr = randomMatr();
                studentDebts[studentCount].Matriculation = tempMatr;
                Console.Write(tempMatr);
                Console.WriteLine();

                Console.Write("Enter the anticipated graduation date for student ");
                Console.Write(studentCount + COUNT_OFFSET);
                Console.Write(" (YYYYMMDD): ");
                int tempGrad = randomGrad();
                studentDebts[studentCount].OrigGrad = tempGrad;
                Console.Write(tempGrad);
                Console.WriteLine();

                Console.Write("Enter the loan amount for student ");
                Console.Write(studentCount + COUNT_OFFSET);
                Console.Write(": $");
                int tempLoan = randomMoney();
                studentDebts[studentCount].OrigLoan = tempLoan;
                Console.Write(tempLoan);
                Console.WriteLine();

                Console.Write("Enter the grant amount for student ");
                Console.Write(studentCount + COUNT_OFFSET);
                Console.Write(": $");
                int tempGrant = randomMoney();
                studentDebts[studentCount].OrigGrant = tempGrant;
                Console.Write(tempGrant);
                Console.WriteLine();

               ++studentCount;

            }

            Console.WriteLine();
            Console.WriteLine("Please enter the ID of the student whose loan amount you with to update: ");
            //int tempID = Convert.ToInt32(Console.ReadLine());
            studentCount = COUNT_START;

            //if (studentDebts[studentCount].idMatch(tempID))

            Console.ReadKey();

        }