This program will display a title and prompt the user for th

This program will display a title and prompt the user for their club membership status
and then store the result in a variable. Next the program will use the membership status
and age to determine whether a discount applies and how much the discount will be. It
displays the result on the console and prompts the user to exit the application. Code
static void methods in the DiscountApp class to display a title and terminate the
program. Code a static method that will collect and return the user’s membership status
from the console. If the customer is a club member, then the amount of the discount
depends on the customer’s age. A static method is called to determine and return the
member’s age. Finally age is passed to a static method that determines the discount
rate, based on the member’s age. If the member is 12 or younger or 62 or older, an 18%
discount applies, otherwise the discount is 10%. The rate is then displayed on the
console. If the customer is not a club member, then the program displays a message on
the console indicating that discounts are for club members only and terminates.
OBJECTIVE
Programming Assignment 5 is designed to introduce the use of conditional logic
(decisions) using if statements in the Visual C# console environment. Specific objectives
are to develop and reinforce skills with respect to: Using if statements Coding complex conditions Use of static methods Code readability (proper indentation/use of white space) Using correct naming conventions Proper internal documentation
DIRECTIONS
1. Create a new project
2. Project Type (Visual C#)
3. Template (Console Application)
4. Name (PA05LastNameFirstInitial)
5. Rename the Program.cs file to DiscountApp.cs
6. Include the your name, course and section, the class file name, and a brief
description of each class (in that order) in a multi-line comment at the top of the
class
7. Include internal documentation using inline comments as appropriate
8. When completely finished and ready for grading, add your full solution folder to
the J: drive, attach your class file and then click the Submit button in BB Learn
prior to the deadline CIS 220 - Programming Principles
Dr. Weber Pseudocode Main( ) Method
Declare a Boolean variable for membershipStatus
Declare an integer variable for age
Declare a double variable for discountRate
Call the DisplayTitle() method
Call the DetermineMember() method and save the result in the membershipStatus
variable
If a club member
Call the InputAge() method and save the result in the age variable
Call the DetermineDiscount() method and save the result in the discountRate
variable
Display the discount rate formatted as a percentage with two decimal places
Else
Display a message that discounts are for members only
Call the TerminateProgram() method
DetermineMember() Method (no parameters, return a boolean)
Ask the user if they are a member
If they respond with “Y”
Return true
If they respond with anything else
Return false
Return their membership status as a boolean
InputAge() Method (no parameters, return an integer)
Prompt the user for their age.
Return their age.
DetermineDiscount() Method (integer parameter, return a double)
(Use the correct C# syntax here. The code below will not work if you copy and paste)
if age <= 12 or age >= 62
Do not type: if age <= 12 or >= 62 since that is not syntactically correct Return the correct discount rate DisplayTitle() Method (no parameters, no return)
Change the console colors and clear the console
Display a title like in the screenshot
TerminateProgram() Method (no parameters, no return)
Prompt the user to press any key to terminate
Wait for a key press CIS 220 - Programming Principles

Solution

Main( ) Method

Declare a Boolean variable for membershipStatus

Declare an integer variable for age

Declare a double variable for discountRate

Call the DisplayTitle() method

Call the DetermineMember() method and save the result in the membershipStatus

variable

If a club member

Call the InputAge() method and save the result in the age variable

Call the DetermineDiscount() method and save the result in the discountRate

variable

Display the discount rate formatted as a percentage with two decimal places

Else

Display a message that discounts are for members only

Call the TerminateProgram() method

DetermineMember() Method (no parameters, return a boolean)

Ask the user if they are a member

If they respond with ?Y?

Return true

If they respond with anything else

Return false

Return their membership status as a boolean

InputAge() Method (no parameters, return an integer)

Prompt the user for their age.

Return their age.

DetermineDiscount() Method (integer parameter, return a double)

(Use the correct C# syntax here. The code below will not work if you copy and paste)

if age <= 12 or age >= 62

Do not type: if age <= 12 or >= 62 since that is not syntactically correct

Return the correct discount rate

DisplayTitle() Method (no parameters, no return)

Change the console colors and clear the console

Display a title like in the screenshot

TerminateProgram() Method (no parameters, no return)

Prompt the user to press any key to terminate

Wait for a key press

This program will display a title and prompt the user for their club membership status and then store the result in a variable. Next the program will use the me
This program will display a title and prompt the user for their club membership status and then store the result in a variable. Next the program will use the me
This program will display a title and prompt the user for their club membership status and then store the result in a variable. Next the program will use the me

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site