Related questions
Create and run the following python scripts
Script 1: User Info
Write a
that describes himself or herself. Here is an example of the program’s screen:
Your program should meet the following requirements:
Be a function named "main"
The program should ask for the age of the user. If user is less than 18 years old, program
should terminate and write a message to "error.txt" file. But if user is 18 years and
above, program should prompts user to enter full names and give a description. These
details should then be written to a file – "userinfo.txt".
**You must use input and function to complete this task
**An ELSE block must be included in the code
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 5 images
- H1. A value returning function executes its statements and then returns a value. true or false Explain with details also explain wrong optionarrow_forward1. Retail Price CalculatorWrite an application that accepts from the user the wholesale cost of an item and its markup percentage. (For example, if an item’s wholesale cost is 5ドル and its retail price is 10,ドル then the markup is 100%.)The program should contain a function named CalculateRetail that receives the wholesale cost and markup percentage as arguments, and returns the retail price of the item. The application’s form should look something like the one shown in Figure 6-22.arrow_forwardPython Programming Only (PLEASE INCLUDE INPUT VALIDATION IF NEEDED) Write a function named maximum that accepts two integer values as arguments and returns the value that is the greater of the two. For example, if two numbers are one big and one small the function should return the bigger number. Use the function in a program that prompts the user to enter two integer values. The program should display the value that is the greater of the two.arrow_forward
- Create the following program that prompts a user to enter 10 integers. Create a user-defined function to print the 10 integers the user enters. C programming languagearrow_forwardPART I: Functions – Math Test Write the Flowchart and Python code for the following programming problem based on the pseudocode below. Write a program that will allow a student to enter their name and then ask them to solve 10 mathematical equations. The program should display two random numbers that are to be added, such as: 247 + 129 The program should allow the student to enter the answer. The program should then display whether the answer was right or wrong, and accumulate the correct values. After the 10 questions are asked, calculate the average correct. Then display the student name, the number correct, and the average correct in both decimal and percentage format. In addition to any system functions you may use, you might consider the following functions: A function that allows the student to enter their name. A function that gets two random numbers, anywhere from 1 to 500. A function that displays the equation and asks the user to enter their answer. A function that...arrow_forward
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education