The program will consist of one file - the main application class • Name the class appropriately and name the file Program.cs (the default when you create the application) • Include documentation at the top of the file that includes ▪ Your name ▪ Date of development ▪ Assignment (e.g., CIS214 Performance Assessment - User Entry of Age) • Description of the class • The main application class must meet the following requirements O Print a line that states "Your Name - Week 4 PA User Entry of Age" • Ask the user to enter their age • If the age is between 1 and 100 (inclusive) ▪ print a message stating the age the user entered • exit the program • If the age is less than 1 or greater than 100 ▪ generate an ArgumentOutOfRange Exception ▪ print the exception information ▪ print an error message • If the value is not an integer ▪ handle the FormatException ▪ print the exception information ▪ print an error message • Continue asking the user to enter their age until a valid age is entered

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%
.
The program will consist of one file - the main application class
• Name the class appropriately and name the file Program.cs (the
default when you create the application)
Include documentation at the top of the file that includes
▪ Your name
▪ Date of development
▪ Assignment (e.g., CIS214 Performance Assessment - User Entry
of Age)
▪ Description of the class
The main application class must meet the following requirements
O
• Print a line that states "Your Name - Week 4 PA User Entry of Age"
• Ask the user to enter their age
• If the age is between 1 and 100 (inclusive)
▪ print a message stating the age the user entered
▪ exit the program
• If the age is less than 1 or greater than 100
generate an ArgumentOutOfRange Exception
▪ print the exception information
▪ print an error message
• If the value is not an integer
▪ handle the FormatException
▪ print the exception information
▪ print an error message
• Continue asking the user to enter their age until a valid age is
entered
Sample Output:
Your Name - Week 4 PA User Entry of Age
Please enter your age: twenty
System. FormatException: Input string was not in a correct format.
at System.Number. ThrowOverflowOrFormat Exception (ParsingStatus status, TypeCode type)
at System.Convert.ToInt32(String value)
at UserAgeEntry.Main(String[] args) in C:\source\CIS214 Week 4\pa_user_age_solution\Program.cs:line 26
Please enter an integer in range 1 - 100.
Please enter your age: 0
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
at UserAgeEntry.Main(String[] args) in C:\source\CIS214 Week 4\pa_user_age_solution\Program.cs:line 30
Please enter an integer in range 1 - 100.
Please enter your age: -5
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Transcribed Image Text:. The program will consist of one file - the main application class • Name the class appropriately and name the file Program.cs (the default when you create the application) Include documentation at the top of the file that includes ▪ Your name ▪ Date of development ▪ Assignment (e.g., CIS214 Performance Assessment - User Entry of Age) ▪ Description of the class The main application class must meet the following requirements O • Print a line that states "Your Name - Week 4 PA User Entry of Age" • Ask the user to enter their age • If the age is between 1 and 100 (inclusive) ▪ print a message stating the age the user entered ▪ exit the program • If the age is less than 1 or greater than 100 generate an ArgumentOutOfRange Exception ▪ print the exception information ▪ print an error message • If the value is not an integer ▪ handle the FormatException ▪ print the exception information ▪ print an error message • Continue asking the user to enter their age until a valid age is entered Sample Output: Your Name - Week 4 PA User Entry of Age Please enter your age: twenty System. FormatException: Input string was not in a correct format. at System.Number. ThrowOverflowOrFormat Exception (ParsingStatus status, TypeCode type) at System.Convert.ToInt32(String value) at UserAgeEntry.Main(String[] args) in C:\source\CIS214 Week 4\pa_user_age_solution\Program.cs:line 26 Please enter an integer in range 1 - 100. Please enter your age: 0 System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. at UserAgeEntry.Main(String[] args) in C:\source\CIS214 Week 4\pa_user_age_solution\Program.cs:line 30 Please enter an integer in range 1 - 100. Please enter your age: -5 System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Sample Output:
Your Name Week 4 PA User Entry of Age
Please enter your age: twenty
System. FormatException: Input string was not in a correct format.
at System.Number.ThrowOverflowOrFormat Exception (ParsingStatus status, TypeCode type)
at System.Convert.ToInt32(String
at User AgeEntry.Main(String[] args) in C:\source\CIS214 Week 4\pa_user_age_solution\Program.cs:line 26
Please enter an integer in range 1 - 100.
value)
Please enter your age: 0
System.Argument OutOf RangeException: Specified argument was out of the range of valid values.
at UserAgeEntry.Main(String[] args) in C:\source\CIS214 Week
Please enter an integer in range 1 - 100.
4\pa_user_age_solution\Program.cs:line 30
Please enter your age: -5
System.ArgumentOutOf RangeException: Specified argument was out of the range of valid values.
at UserAgeEntry.Main(String[] args) in C:\source\CIS214 Week 4\pa_user_age_solution\Program.cs:line 30
Please enter an integer in range 1 - 100.
Please enter your age: 101
System.ArgumentoutofRangeException:
Specified argument was out of the range of valid values.
at UserAgeEntry.Main(String[] args) in C:\source\CIS214 Week 4\pa_user_age_solution\Program.cs:line 30
Please enter an integer in range 1 - 100.
Please enter your age: 25
The age entered is: 25
Transcribed Image Text:Sample Output: Your Name Week 4 PA User Entry of Age Please enter your age: twenty System. FormatException: Input string was not in a correct format. at System.Number.ThrowOverflowOrFormat Exception (ParsingStatus status, TypeCode type) at System.Convert.ToInt32(String at User AgeEntry.Main(String[] args) in C:\source\CIS214 Week 4\pa_user_age_solution\Program.cs:line 26 Please enter an integer in range 1 - 100. value) Please enter your age: 0 System.Argument OutOf RangeException: Specified argument was out of the range of valid values. at UserAgeEntry.Main(String[] args) in C:\source\CIS214 Week Please enter an integer in range 1 - 100. 4\pa_user_age_solution\Program.cs:line 30 Please enter your age: -5 System.ArgumentOutOf RangeException: Specified argument was out of the range of valid values. at UserAgeEntry.Main(String[] args) in C:\source\CIS214 Week 4\pa_user_age_solution\Program.cs:line 30 Please enter an integer in range 1 - 100. Please enter your age: 101 System.ArgumentoutofRangeException: Specified argument was out of the range of valid values. at UserAgeEntry.Main(String[] args) in C:\source\CIS214 Week 4\pa_user_age_solution\Program.cs:line 30 Please enter an integer in range 1 - 100. Please enter your age: 25 The age entered is: 25
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY