Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 2 Error Handling and Helper Function Library Design Due: Sunday, 2/7/2021, 11:59pm on Canvas Code Due: Sunday, 2/14/2021, 11:59pm on TEACH Users are seldom

Assignment 2 Error Handling and Helper Function Library Design Due: Sunday, 2/7/2021, 11:59pm on Canvas Code Due: Sunday, 2/14/2021, 11:59pm on TEACH Users are seldom perfect. It is our job as programmers to catch mistakes and correct them to prevent crashing the program. The table below illustrates common functions you will use for error handling and working with user in the CS 16X series. Function Name Input (Parameters) Output (Return Type) Description/Notes check_range int lower_bound int upper_bound int test_value Boolean Indicates if the provided number is in the specified range is_capital char letter Boolean Indicates if a given character is a capital letter is_even int num Boolean Indicates if a given number is even is_odd int num Boolean Indicates if a given number is odd equality_test int num1 int num2 Int Tests num1 against num2 and returns -1 if num1 < num2, returns 0 if num1 == num2, returns 1 if num1 > num2 float_is_equal float num1 float num2 float precision Boolean Tests if num1 and num2 are equal to each other within a certain precision (hard coded) is_int string num Boolean Indicates if a given string is an integer numbers_present string sentence Boolean Indicates if the provided string contains numbers letters_present string sentence Boolean Indicates if the provided string contains letters contains_sub_string string sentence string sub_string Boolean Indicates if substring exists in sentence word_count string sentence Int Provides the number of words in a given string to_upper string sentence String Capitalizes all letters in a given string and leave all non-letter characters unchanged to_lower string sentence String Makes all letters lowercase in a given string and leave all non letter characters unchanged get_int string prompt Int Takes a prompt from the user as a string literal, checks if input is a valid integer, returns the provided integer

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

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

More Books

Students also viewed these Databases questions

Question

Show the properties and structure of allotropes of carbon.

Answered: 1 week ago