---
title: CSCI 1301 -- Lab 20
author: Clément Aubert
lang: en
fontsize: 10pt
documentclass: scrartcl
numbersections: true
links-as-notes: true
papersize: letter
geometry: margin=1in
keywords:
- Computer Science
- Problem solving methods
- Syllabus
- Augusta University
- Bachelor of Science
---

# Checkpoint

The code we just studied in class, slightly expanded and with an application program, is [available to download](LoanCalculator.zip).

# Validating Inputs (Optional)

Edit the `Program.cs` file of the project you previously download so that:

- User entering a value different from `A`, `a`, `H`, `h`, `O` and `o` would be asked again, and asked as long as they do not give a valid answer,
- User entering a credit score not between 300 and 850, or that is not an integer, would be asked again, and asked as long as they do not give a valid answer,
- User entering an amount needed or a downpaiment that is not a decimal, or is a negative decimal, would be asked again,  and asked as long as they do not give a valid answer.
- (Optional) Use the [ToLower()](https://docs.microsoft.com/en-us/dotnet/api/system.char.tolower?view=netframework-4.7.2) or [ToUpper()](https://docs.microsoft.com/en-us/dotnet/api/system.char.toupper?view=netframework-4.7.2) methods of the `char` class to make the program more readable (you will be able to greatly simplify the `if` statement).
- (Optional, hard) Write a method that takes a character as an argument, and return the string returning the type of loan designed by that character. Then, use this method in the `ToString` and in the application program instead of doing it "by hand". 

# Solution

A (partial) solution that implements (partially) the first, next to last and last item of the previous list is [available to download](LoanCalculator_sol.zip).
