Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Adam is a student at the School of Fine Art. To help pay his tuition, he took a job in the school's student records
Adam is a student at the School of Fine Art. To help pay his tuition, he took a job in the school's student records department. The work is to develop program that calculates each student's grade point average (GPA). He thought it would be simple, because he knows that the formula is: total grade points divided by total credit hours attempted. The formula to calculate GPA is as follows: GPA = totalGP / creditHours Attempted The GPA means the grades are converting on a numerical scale and the traditional range of GPA is '0.0' to '4.0'. You may assume the program would be provided with the total grades and the attempted credit hours. The final output needs to display the Grade from the calculated GPA as shown in the figure. n Grade GPA A 4 B 3 D 1 F 0 2 But due to the study load, he could not accomplish the task. Now, you are appointed in the program development process to help Adam in the process. You are asked to write snippets (small pieces of reusable code) based on the questions that Adam might consolidate and use in the final program. There are 9 questions based on the case study. Answer all the given questions based on the given case study. Make necessary assumptions if required. Question 1 5 marks Adam's meeting with the school's administrators is part of which stage of the application development life cycle? Also, mention and briefly describe other stages of application development life cycle. Question 2 Write the code to define the following variables with appropriate datatypes Student name, Student id, GPA, Total GPA Attempted Credit Hours 5 marks Question 3 5 marks Write the code to take input from the user and store it in the assigned variables as in question 2. Also write the code to calculate GPA based on the input variables. Question 4 5 marks Write the appropriate snippet to calculate the grade (A, B, C, D and F) based on the calculated GPA. You may use appropriate block statement to write the logic. Question 5 5 marks Rewrite a parameterized method CalculateGrade(....) that returns GPA for each student when provided with totalGP and credithours Attempted. Discuss pass by value and reference in context to the method CalculateGrade(....) that you have written. Question 6 5 marks Adam's program crashes with new students who have not attempted any credit hours, instead of just giving them a GPA of 0.0. Write the corrected code that takes care of student with no credit hours. Define exception handling in C# in context to the given scenario. Question 7 5 marks Rewrite the code to get input from the user for each student's name, totalGP and credit Hours Attempted as arrays with 10 elements. Also write code to print the array elements on the screen. Question 8 5 marks Adam has developed other methods in the class, but he does not want those methods to be called by any derived classes. What access modifier should he use for those methods? Define other access modifiers that he can use in different scenarios with respect to the given program. Question 9 10 marks The school expects to implement concept of Object-oriented programming concepts (OOPs) a. Write the snippet to define a class 'Student' with required attributes/states and methods/behavior to calculate the grade. b. Write the constructor to initialize the attributes student name, GPA and credithoursAttempted. c. Create an instance/object of class 'Student' passed with student name, GPA and credit hours. d. Show how one can implement polymorphism and encapsulation in the given program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Question 1 Meeting with schools administration is part of Requirement gathering and analysisor Planning and analysis stage In this stage all the information that is relevant to application to be devel...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started