7. In Chapter 4, you wrote a program named Admission for a college admissions office in which the user enters a numeric high school grade point average and an admission test score. The program displays Accept or Reject based on those values. Now, create a modified program named AdmissionModularized in which the grade point average and test score are passed to a method that returns a string containing Accept or Reject.
This problem refers to this textbook question from chapter 4
https://www.bartleby.com/solution-answer/chapter-4-problem-3e-microsoft-visual-c-7th-edition/9781337102100/aaddcfdf-e049-11e9-8385-02ee952b546e
I need help with the following question, its from Chapter 7, Exercise 7 for the following book
Farrell, Joyce. Microsoft Visual C#: An Introduction to Object-Oriented
7. In Chapter 4, you wrote a program named Admission for a college admissions office in which the user enters a numeric high school grade point average and an admission test score. The program displays Accept or Reject based on those values. Now, create a modified program named AdmissionModularized in which the grade point average and test score are passed to a method that returns a string containing Accept or Reject.
using System;
namespace AdmissionModularized
{
class Program
{
public static string result
(double gpAvg, int testScore)
{
if (gpAvg < 3.0 && testScore > 80)
{
return "Accept";
}
else if (gpAvg > 3.0 && testScore > 60)
{
return "Accept";
}
else
return "Reject";
}
static void Main(string[] args)
{
double GP;
int score;
Console.WriteLine
("Enter Grade Point Average: ");
GP = Double.Parse(Console.ReadLine());
Console.WriteLine
("Enter Addmission Test Score: ");
score = Int32.Parse(Console.ReadLine());
Console.WriteLine(result(GP,score));
}
}
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps