Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The file DebugFour3.cs has syntax and/or logical errors. Determine the problem(s), and fix the program. using System.IO; using System; class Program { static void Main()

The file DebugFour3.cs has syntax and/or logical errors. Determine the problem(s), and fix the program.

using System.IO; using System;

class Program { static void Main() { int credits, year; string inputString; double tuition; const int LOWCREDITS = 12; const int HIGHCREDITS = 18; const double HOURFEE = 15000; const double DISCOUNT = 0.15; const double FLAT = 1900.00; const double RATE = 100.00; const int SENIORYEAR = 4; Console.WriteLine("How many credits? "); inputString = Console.ReadLine(); credits = Convert.ToInt32(inputString); Console.WriteLine("Year in school? "); inputString = Console.ReadLine(); year = Convert.ToInt32(inputString); if(credits > LOWCREDITS) tuition = HOURFEE * credits; else if(credits == HIGHCREDITS) tuition = FLAT; else tuition = FLAT + (credits - HIGHCREDITS) * RATE; if(year < SENIORYEAR) tuition = tuition - (tuition * DISCOUNT); Console.WriteLine("For year {0}, with {1} credits",year, credits); Console.WriteLine("Tuition is {0}", tuition.ToString("C")); } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions

Question

Define procedural justice. How does that relate to unions?

Answered: 1 week ago