Answered step by step
Verified Expert Solution
Link Copied!

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 print_menu()
print_menu() 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
---------
1- Process a new data file
2- Choose units
3- Edit room filter
4- Show summary statistics
5- Show temperature by date and time
6- Show histogram of temperatures
7- 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 (i.e. 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
new_file(dataset) will be called when the user chooses item one.
choose_units() will be called when the user chooses item two.
change_filter(sensor_list, active_sensors) will be called when the user chooses item three.
print_summary_statistics(dataset, active_sensors) will be called when the user chooses item four.
print_temp_by_day_time(dataset, active_sensors) will be called when the user chooses item five.
print_histogram(dataset, active_sensors) will be called when the user chooses item six. This is an optional no-credit 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 new_file() 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, e.g. new_file(None). The None object is used to define a null value (no value at all). None is not the same as 0, 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

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

More Books

Students also viewed these Databases questions

Question

Describe three other types of visual aids.

Answered: 1 week ago