Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In C + + Please Program Objective: You are tasked with creating a test of a dayNumber function. You are not writing the dayNumber function,
In C Please
Program Objective:
You are tasked with creating a test of a dayNumber function.
You are not writing the dayNumber function, only coding the test of this function
Read the pre and post conditions for testDayNumber in functions.h
Implement testDayNumber
You may choose to implement dayNumber, however, please do not submit your version of dayNumber
functions.h listed below:
Precondition: not any
Postcondition: If the input string date is a nonempty string in the format of mdy where m d and y where
nonnegative integers the function returns a number from to ; the number of days from the beginning of the year,
where January st returns and December st returns either or depending on the year.
Returns when the provided input string is not a valid date. By the given format, any year greater than is valid.
unsigned short dayNumberconst char date;
Precondition: not any
Postconditon: Returns if all test cases for dayNumber passes. Otherwise, returns a number greater than where
the number correlates to the first test case that failed. This function is NOT chatty.
unsigned short testDayNumber;
Starter Code listed below:
#include "functions.h
unsigned short testDayNumber
if dayNumberValid date of January st should return no matter what the year is
return ;
TODO: Add more tests
return ; All tests passed
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started