Question
***Debug in c#**** // Program demonstrates method that can be called // with one, two, or three arguments // Tuition is $80 per credit //
***Debug in c#****
// Program demonstrates method that can be called
// with one, two, or three arguments // Tuition is $80 per credit // Default district code is I. // If student is in-district (code I), then there is no // out-of-disctrict fee, which is $300 // Default scholarhip status is false. // If student is on scholarship, tuition is free using System; public class DebugEight3 { public static void Main() { Console.WriteLine("Tuition is {0}", Calculatetuition(15)); Console.WriteLine("Tuition is {0}", CalculateTuition(15, 'O')); Console.WriteLine("Tuition is {0}", CalculateTuition(15, 'O', true)); } public static CalculateTuition(char code = "I", double credits, bool scholarship = false) { double tuition; const double RATE = 80.00; const double OUT_DISTRICT_FEE = 300.00; tuition = credits * RATE; if(code == 'I') tuition += OUT_DISTRICT_FEE; if(scholarship) tuition = 0; return tuition; } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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