Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a function named print _ menu ( ) print _ menu ( ) that takes no arguments and returns nothing, don't forgat to add
Write a function named printmenu
printmenu that takes no arguments and returns nothing, don't forgat to add the docstring for the new function. Its whole job is to print this menu:
Main Menu
Process a new data file
Choose units
Edit room filter
Show summary statistics
Show temperature by date and time
Show histogram of temperatures
Quit
Incidentally, during the rest of the course, we will work on implementing all of the items referenced by the menu.
We are first going to write stub functions which will later be completed. A stub is a function that has the expected signature ie name of the function and parameters but an incomplete implementation. A stub function is used as a placeholder and so that the code that calls the function can be tested before the called function is fully written.
Next, we need stub functions for the following
Each line below gives you the function signature name of the function and it's parameters of each function that you will create in the assignment
newfiledataset will be called when the user chooses item one.
chooseunits will be called when the user chooses item two.
changefiltersensorlist, activesensors will be called when the user chooses item three.
printsummarystatisticsdataset activesensors will be called when the user chooses item four.
printtempbydaytimedataset activesensors will be called when the user chooses item five.
printhistogramdataset activesensors will be called when the user chooses item six. This is an optional nocredit project.
And what about item seven? The program should exit gracefully.
These functions do not have any functionality yet. They will initially be stub functions, later you will add the code required for the application. Instead of using the pass statement, we will use a print statement for each function so we know that it has been called. Our newfile function, for example, will look like this: main
In addition, to implementing these new functions, you need to create logic in the main to print the menu, ask for the user's input, and process the response. Your code should call the appropriate function and then print the menu again. This is the Unit Test for this Lab Assignment.
Some of these functions require parameters, but we haven't defined the variables arguments that we need to pass to the functions. The interpreter will complain if you call the functions without any arguments. For now, you can just call the functions that require an argument with None, eg newfileNone The None object is used to define a null value no value at all None is not the same as False, or an empty string. None is an object type NoneType and only None can be None.
How will you call a function that takes two arguments?
Whenever you prompt for input be sure to allow the response to the prompt to be on the same line and to put a space after the prompt to increase readability.
Be sure to skip a line between each prompt. Rstudio
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