Question: header.h / * - - - - - - - - - - - - - - - - - - - - - -
header.h
header.h
Version a Joseph Phillips
#include
#include
#include
#define MAXLINE
#define RANGELOWEST
#define RANGEHIGHEST
#define MINNUMNUMBERS
#define MAXNUMNUMBERS x
main.c
main.c
This file defines the functions getNextNumber
obtainNumberBetween and main needed for the program of
assignment
Version a Joseph Phillips
#include "header.h
PURPOSE: To hold the lowest allowed random number.
int low;
PURPOSE: To hold the highest allowed random number.
int high;
PURPOSE: To return another randomlygenerated number.
int getNextNumber
returnrandhigh low low ;
PURPOSE: To repeatedly ask the user the text "Please enter followed
by the text in 'descriptionCPtr', followed by the numbers 'low' and
'high', and to get an entered integer from the user. If this entered
integer is either less than 'low', or is greater than 'high', then
the user is asked for another number. After the user finally enters
a legal number, this function returns that number.
int obtainNumberBetween
const char descriptionCPtr,
int low,
int high
char lineMAXLINE;
int entry;
YOUR CODE HERE
PURPOSE: To use the function obtainNumberBetween to obtain the values
for global variable 'low' which must be between RANGELOWEST and
RANGEHIGHEST global variable 'high' which must be between 'low'
and RANGEHIGHEST and local variable 'numNum' which must be between
MINNUMNUMBERS and MAXNUMNUMBERS
Then it enters a loop asking the user what they want to do If the
user chooses integer then the program runs countWithListnumNums
If the user chooses integer then the program runs
countWithTreenumNums If the user chooses then the program quits.
Returns 'EXITSUCCESS' to OS
int main
int numNums;
int choice;
low obtainNumberBetween
the lowest number in the range",
RANGELOWEST,
RANGEHIGHEST
;
high obtainNumberBetween
the highest number in the range",
low,
RANGEHIGHEST
;
numNums obtainNumberBetween
the number of numbers to consider",
MINNUMNUMBERS,
MAXNUMNUMBERS
;
do
const char msgCPtr "What would you like to do
Count with a list
Count with a tree
Quit
"Your choice ;
choice obtainNumberBetweenmsgCPtr;
switch choice
case :
break;
case :
countWithListnumNums;
break;
case :
countWithTreenumNums;
break;
while choice ;
returnEXITSUCCESS;
Sample Initial Output:
$ assign
Please enter the lowest number in the range :
Please enter the lowest number in the range :
Please enter the lowest number in the range :
Please enter the highest number in the range :
Please enter the highest number in the range :
Please enter the highest number in the range :
Please enter the number of numbers to consider :
Please enter What would you like to do
Count with a list
Count with a tree
Quit
Your choice :
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
