Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 1 : This lab will have you create and call on functions. Functions are statements that perform a task. They are only executed when

Part 1:
This lab will have you create and call on functions. Functions are statements that perform a task. They are only executed when they are called upon in the Python program. They can be called once or many times depending what the program needs to do.
This program needs to collect 4 pieces of data. What is collected is completely up to you. It just needs to make sense. An example could be collecting name, phone number, email, and address. Each of the 4 items needs to be its own function. You must then call the functions and have the user enter the data. For added complexity, the code needs to ask the user if they are willing to share each item. The user should be able to give just a name, email, phone number, or submit all the data (hint: you can use If Statements or any other means). Lastly, the data needs to be displayed to the user as a professional readable format. None of the items can show up as undefined or similar, so find a creative way to show no information was entered for that item.
You can save your code as lab4.py and run it through the python3 command.
Materials:
Research resources (google, databases, Lynda.com)
Python Editor (Notepad, Notepad++, Visual Studio Code)
Procedure:
/40 marks
Create code that creates the appropriate variables required define the data you are collecting. Create the 4(or more if needed) functions so they can be called upon by your code. Create some additional code to ask the user if they want to enter each piece of information. If they agree, store their information to be recalled at the end of the code. Run that process for all 4(or more) functions you created and finally display the inputted data back to the user in a professional and readable format. Remember, you must create a placeholder for data not collected. Undefined or simular is considered unacceptable. For this lab we are focused on functions and data collection. We will not worry about data validation at this point (to prevent GIGO).
Your Code:
Copy and paste your code here.
Questions:
1. Why would functions be a benefit to a software writer? Provide an example of some code that would be best used as a function. (Dont write the code, just describe it.)/5 marks

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

Managing Your Information How To Design And Create A Textual Database On Your Microcomputer

Authors: Tenopir, Carol, Lundeen, Gerald

1st Edition

1555700233, 9781555700232

More Books

Students also viewed these Databases questions

Question

Explain how principles from the Rhetoric relate to job interviews.

Answered: 1 week ago