Create a function named "area" that allows the user to calculate the area of a Rectangle, a Disk or a Triangle, as shown in the following Python Shell screenshot. Write a main code that keeps calling the function upon user's approval. You need to upload your Python file. Write your own code, cheating will result in a zero grade. Choose 1: Rectangle, 2: Disk, 3: Triangle: 1 enter height: 4 enter width: 3 Area = 12 do you want to try again? (y/n): y Choose 1: Rectangle, 2: Disk, 3: Triangle: 2 enter radius: 4 Area = 50.26548245743669 do you want to try again? (y/n): y Choose 1: Rectangle, 2: Disk, 3: Triangle: 3 enter base: 5 enter perpendicular height: 4 10.0 Area = do you want to try again? (y/n): n
Q: ase provide line by line explaination for the code below. And I don't understand line 16, so detail…
A: Description: 1- For line number - 16, Date is a class provided by the java util package. Please…
Q: [Python (py3)] Please modify my code below such that Matrix A and Matrix B can be added if the…
A: Step 1: Import numpy and sys packages. Step 2: Open the input file and read its contents. Store it…
Q: Write a program to modify a PPM image in the following ways: 1. Negate the colors in the image 2.…
A: Create a new project named PPMModify in the CSCI051p-Workspace you created on your Desktop. Double…
Q: ● Create a Python file called my_function.py in this folder. ● Create your own function that prints…
A: def my_function1():#to print all days of the week #printing all days of the weak d="day"…
Q: Assume you have a file on your disk named floatnumbers.txt containing float numbers. Write a Python…
A: Here we can write the Python code that reads all the number in the file and display their average ,…
Q: I need help Note: it`s Python Implement the following: 1) Request an integer user input, password,…
A: algorithm:- read a number if number==400 display password correct else display password…
Q: Which header file has the functions scanf()? a. stdlib.h b. stdio.h c. string.h d. math.h
A: The scanf() function is used to read or take the input from the user. Just like scanf() function,…
Q: Which of the following is not a file-reading method in Python?a) read b) readline c) readall d)…
A: Lets see the solution.
Q: Which of the following is correct about the first parameter of the "main()" function? a) The first…
A: Given: Which of the following is correct about the first parameter of the "main()" function? a) The…
Q: Python program in a .py file that includes the following: Define and test a function…
A: Write a Python program in a .py file that includes the following: Define and test a function…
Q: In Python, I want to create a program that calculates the amount of time and fuel for a Cessna to…
A: Program approach: import math to use ceil function. Define roudup function to always round up the…
Q: Which form of documentation is most appropriate for explaining the purpose of a particular statement…
A: Please find the answer below :
Q: Which of the following is false about Python? O Python is designed to be highly readable O Python…
A: In the first question, Python is a low-level language is the false option.
Q: You work for the county and need a program to calculate a traffic citation report based on the type…
A: FOLDER NAME: If Program 02 FILE NAME: Traffic.java import java.util.Scanner; public class Traffic{…
Q: Write a program that determines whether the user entered an item number in the required format:…
A: Find the code below.
Q: Create a Python program that allows user enter class name, faculty name, name of each student, and…
A: Here is the solution which is mentioned below:
Q: QUESTION 1 Write a program that can request the size of pizza, quantity from the user and calculate…
A: In C, the if-else statement is used to carry out operations based on a set of conditions. If and…
Q: In this assignment, you are going to write a shell script that implements a simple calculator that…
A: here in the question ask for a calculator in shell script.
Q: 1. Write a program that utilizes user input. 2. Write a program that calculates the area of a…
A: Code take user input and print the value in python Code to find area of the circle using python
Q: Create a function named "area" that allows the user to calculate the area of a Rectangle, a Disk or…
A: Given: To write a Python program to find areas of given figures.
Q: Use the Bash shell for the completion of this project. Develop a shell scripting application that…
A: Actually, program is an executable software that runs on a computer.
Q: What is the output of the following code fragments if user clicks inside text name b: var a =…
A: required: to provide the output of the following code:
Q: Problem: Convert the oxo‐logic.py module to reflect OOP design by creating a Game class. NOTE!!:…
A: To clarify each of the defining functions in this python code. Explanation This is a game of tic tac…
Q: Please use Python for this problem. Make sure code is in correct format so it can run in Python…
A: Solution: Defining the constructor which takes two volumes if value is not given then set one of…
Q: 1. Create a python file with a name: A3.1_yourFamilyname,Firstnamelnitial 2. Write a program of the…
A: Python provides an inbuilt function round() which rounds off to the given number of digits and…
Q: Write Python code that will open a file named aboutme.txt and write your name to the first line in…
A: To open a file named aboutme.txt and write your name to the first line in the file and your age (as…
Q: Inside this module, import random and blackout_utils, and define the following global variable,…
A: You can use a global variable within other functions by declaring it as global within each…
Q: I am having trouble running this code properly, I believe it has something to do with the location…
A: Explanation: You are program works correctly. The issue may due to the program cannot find the…
Q: Write a Python program named retailprice.py that asks the user to enter an item's wholesale cost and…
A: retailprice.py:- items={ 'Grocery':5, 'Fresh-Food':8, 'Electronics':10, 'Lifestyle':20,…
Q: Write a Python function that creates a csv file that includes a price list of user-entered items.…
A: In this programming question we have to execute a program in python This program we have to write to…
Q: Write a program to create an invoice for the De Anza College Computer Lab when replacing…
A: A required program is as follows, #include <iostream>#include <iomanip>//Define constant…
Q: The following needs to be in python For this application, you will need to create a Python…
A: Code: #!/usr/local/bin/python3 def main(): # initalizing filename and valid months filename =…
Q: Write a small program that reads from the standard input one line at a time until the end of file.…
A: Write a small program that reads from the standard input one line at a time until the end of file.…
Q: What type of error exists in the NATLAB code snippet below? function avg = findAverage(x, y, z) %…
A: Syntax errors are the rules and prototypes that are to be followed for sake of smooth compilation of…
Q: Which header file has the functions scanf()? a. stdio.h b. stdlib.h c. string.h d. math.h
A: stdio.h generally contains many macros & functions for input and output. these includes scanf()…
Q: In Python. Ask user to enter two float numbers. Using an infinite loop, ask the user whether they…
A:
Q: Your program should follow the steps below: 1. Prompt the user to enter the input PPM file name,…
A: Coded using Python 3.
Q: Assignment #4 – Einstein's mass to energy conversion Due • Please submit it by March 2nd, 5:30 PM. •…
A: Note: - As the programming language is not mentioned. I am writing this code in Python. The python…
Q: I need help in creating a function based on the program below. The program below prints out the…
A: Answer: C Source Code: #include <stdio.h>#include <stdbool.h>#include…
Q: ob in your MnnJOBQ1, these jobs will not run, since they are not attached to any sub-system. Check…
A: use ibm is400 series to answer the following question (the output should shown in screenshot) 1 -…
Q: For this project you will use the file included in the attached zip file. It is a series of…
A: sample output
Q: Which of the following statement(s) is/are TRUE ? A function's workspace shares the same workspace…
A: I.A function's workspace shares tha same workspace as the command window. II.it is possible to…
Q: Insert a Custom Footer with the File name in the left section and then save your workbook. On the…
A: 9] first, we have to Click the worksheet where you want to add or change headers or footers in it.…
Q: Create a program to calculate grades as well as descriptive statistics for a set of test scor test…
A: the code, Code screenshot, and output is below:
Q: ate the average, display the result on the screen and check the user enter a valid test grade. •…
A: Q
Q: 3. Create an application for generating lottery tickets of random numbers. Each lottery ticket has a…
A: The program defines a function display() to print the vector. The function uses a for each loop to…
Q: Implement function duplicate() that takes as input the name (a string) of a file in the current…
A: The answer is below:
Q: Create a Python file named employee_program.py, open it in your Python editor, and copy your Python…
A: CONSOLE_WIDTH = 80 def main(): program_title = "*** Employee Program ***"…
Step by step
Solved in 3 steps with 1 images
- Please use Python Programming. Write the code for an application to convert and display a (decimal) number in binary and hexadecimal notation: (see image resource 1) Note that the binary and hexadecimal equivalents should be displayed as LCD numbers. Hint: Use the QLCDNumber class. If the user enters an invalid integer, an error message like the following should be displayed: (see image resource 2) Similarly, if there is an overflow in the number of digits displayed for the binary representation, an appropriate error message should be displayed. Use signals and slots to connect the various buttons to the appropriate functions. Submit the code of all classes that you write, as well as the main program that creates and shows the GUI window. Submit images of the application while it is running to show that it works as required.Python Your first assignment is to help test the “red mushroom” power-up. This power-up provides a speed boost to the player for a limited time. The team wants to be able to easily test different speed values to find the one that is the most fun. Your task is to write the function calculate_boost_distance(speed, time). This function takes an integer value for speed representing the miles per hour of the kart and a floating point value time that represents the number of seconds the boost will last. It returns a floating point number representing the speed multiplied by the time. Sample usage of the completed function: Full explain this question and text typing work onlyCreate a program named yourID_random.py student ID). Add the following functionality to your program. ● ● ● (replace your/D with your Carleton Use python's random module to pick two random integers between the range [10,100] (inclusive). Suppose, the minimum and the maximum of these two integers are start and stop, respectively. Print the values of start and stop, in this order, to the screen. Hint: use built-in functions max() and min(). Write a precondition, event-controlled loop (i.e., a while loop), that prints all numbers returned by range(start, stop, 3) to the terminal. Ask the user repeatedly for a positive integer x, (input validation is not necessary), until the user enters "quit". If x falls outside this range [start, stop] (inclusive), print all those numbers that are in [start, stop], and that divide x. That is, if x gets divided by those numbers, there will be no remainder. Upload yourID_random.py file using the option available at the end of this question. You do not…
- PYTHON: In this assignment, you will use all of the graphics commands you have learned to create an animated scene. Your program should have a clear theme and tell a story. You may pick any school-appropriate theme that you like. The program must include a minimum of: 5 circles 5 polygons 5 line commands 2 for loops 1 global variable You may wish to use the standard code for simplegui graphics below: import simplegui def draw_handler(canvas): frame = simplegui.create_frame('Testing', 600, 600) frame.set_canvas_background("Black") frame.set_draw_handler(draw_handler) frame.start()python:def ohno_twozero(placeholder, statement): """ Question 1 - Regex You are typing a personal statement but accidentally used the number 0 instead of the letter o (the two are very close on the keyboard). After realizing this, seeing the mistake once does not bother you, but you absolutely cannot tolerate seeing it twice in a row. Therefore, you will need to replace any WORD where '00' shows up at any point with the given placeholder. Do not replace any NUMBER where 00 shows up. (e.g. '100' should stay as '100' and not be replaced with the placeholder). You may assume that when '00' shows up in a word, there will be at least one letter preceding it. Return the output string after making these changes. THIS MUST BE DONE IN ONE LINE. Args: placeholder (str) statement (str) Returns: str >>> ohno_twozero('epic', "I am n0w l00king at 500 t0tal h0urs 0n Super Smash Br0s.") "I am n0w epic at 500 t0tal h0urs 0n Super Smash…JAVA CODE PLEASE Functions With No Parameters but With Return Values Practice II by CodeChum Admin Create a function named askInput that asks the user an integer input if called. The function will return the string “Even” if the integer is even, and “Odd” if otherwise. In the main function, call the askInput function and store the returned value in a variable then print it in a newline. Input 1. One line containing an integer Output Enter·a·number:·10 Even
- Python Project: Problem #1: How much should I study outside of class?Issue:Your fellow students liked the previous version of study hour’s application andwant to expand it again by adding the features listed below.Minimum Study Hours per Week per Class Grade15 A12 B9 C6 D0 FProject Specifications:1. The program asks the user their name, employee id, and department.2. The program also asks the user who they are creating the report for, their employeeid, and the department they work in. (hint #1 & 2 are instances of a class – A classmust be created and used within the program)3. The menu driven program has the following options:A. Determine Hours to StudyB. Determine GradeC. Display Averages and TotalsD. QuitThe user can select any menu option in any order they want.For example:o The user can start the program run option A, then option C, then option B,then option D.o They restart the program, run option C, then D.o They restart the program, run option A, then D.o They restart the…Create a program that will do the following. You may add other features to make your program better.(Accepts 1- 5 -10 peso coins only) Sample 1 Coke - Php 34 Iced Tea - Php 27 Coffee - Php 45 Water - Php 13 Enter Choice Here: a Balance: 0 Insert Money Here: 10 Balance: 10 Insert Money Here: 10 Balance: 20 Insert Money Here: 10 Balance: 30 Insert Money Here: 1 Balance: 31 Insert Money Here: 1 Balance: 32 Insert Money Here: 1 Balance: 33 Insert Money Here: 1 Balance: 34 Please wait….. Dispensing your drink… Please get your drink. Sample 2 Coke - Php 34 Iced Tea - Php 27 Coffee - Php 45 Water - Php 13 Enter Choice Here: b Balance: 0 Insert Money Here: 5 Balance: 5 Insert Money Here: 10 Balance: 15 Insert Money Here: 10 Balance: 25 Insert Money Here: 5 Balance: 30 Please wait….. Dispensing your drink… Please get your drink and change. Your change is 3 pesosfirst image shows the output needed, second image tells about how to solve the question. some functions are provided below. please add the code in functions below and create more functions according to question. solve in python3 version. # Hangman Game # -----------------------------------# Helper code# You don't need to understand this helper code,# but you will have to know how to use the functions# (so be sure to read the docstrings!)import randomimport string WORDLIST_FILENAME = "words.txt" # Responses to in-game events# Use the format function to fill in the spacesresponses = [ "I am thinking of a word that is {0} letters long", "Congratulations, you won!", "Your total score for this game is: {0}", "Sorry, you ran out of guesses. The word was: {0}", "You have {0} guesses left.", "Available letters: {0}", "Good guess: {0}", "Oops! That letter is not in my word: {0}", "Oops! You've already guessed that letter: {0}",] def choose_random_word(all_words):…
- Exercise 7: In Physics, the position of an object with respect to time is given by the following mathematical expression: 1 x = vịt + Where x is the position in meters t is the time in seconds, vị is the initial velocity in m/s and, 2. g is the acceleration 9.80 m/s Develop a Python script (i.e. program) that calculates and prints the position of the object 6. at a given timet=2, and initial velocity v: = 200 m/s.Intro to Python Programming: Paycheck ApplicationCreate the Paycheck Application. The application should read in the name andsalary of an employee. Here the salary will denote an hourly wage, such as$13.25. Then ask how many hours the employee worked in the past week. Be sureto accept fractional hours. Compute the pay. Any overtime work (over 40 hoursper week) is paid at 150 percent of the regular wage. Print a paycheck for theemployee. SAMPLE RUNEnter employee name: MaryEnter the hourly rate: 14.25Enter the number of hours worked: 35Employee: MaryThe pay will be $498.75 for 35.0 hours of work. Enter employee name: JohnEnter the hourly rate: 13Enter the number of hours worked: 51.5Employee: JohnThe pay will be $744.25 for 51.5 hours of work. Enter employee name: NicoleEnter the hourly rate: 12.25Enter the number of hours worked: 40Employee: NicoleThe pay will be $490.00 for 40.0 hours of work.PHP ATM machines allow 4 or 6 digit PIN codes and PIN codes cannot contain anything but exactly 4 digits or exactly 6 digits. *With user input ($pinNumbers), create a function that takes a string and returns true if the PIN is valid and false if it's not. Examples validatePIN("$1234") ➞ true validatePIN("12345") ➞ false validatePIN("a234") ➞ false validatePIN("") ➞ false Notes ● Some test cases contain special characters. ● Empty strings must return false.