Question

1) Create a PYHW2 document that will contain your algorithms in flowchart and pseudocode form along with your screen shots of

Can you send the code and the screenshot of it running?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

*** Here is the code and flowchart of the required function ***

Screenshots of code

-------------------------

def video_rent (curr_rent): rent price = 4.25 n = int(input(Enter the number of videos rented today: ) total rent = curr re

Code

---------------------------

def video_rent(curr_rent):
rent_price = 4.25
n = int(input("Enter the number of videos rented today: "))
total_rent = curr_rent + (n * rent_price)
return total_rent
  

def max_num(n1, n2, n3):
if n1 > n2:
if n3 > n1:
return n3
else:
return n1
else:
if n3 > n2:
return n3
else:
return n2


def main():
curr_rent = 0
new_rent = video_rent(curr_rent)
print("new total rent is ", new_rent)
print("maximum value in (3,4,1) is ", max_num(3, 4, 1))
  
  
main()

Output

-----------------------

Enter the number of videos rented today: 4 new total rent is 17.0 maximum value in (3,4,1) is 4 >>>|

Flowcharts

----------------------------

def video_rent(curr_rent) rent_price = 4.25 n = int(input(Enter the number of videos rented today: )) total_rent = curr_ren

def max_num(n1, n2, n3) < n>n2? Yes No n3 > n1 ?><n3 > n2? Yes No Yes No return na ratum nil return na reun na Engla

def maino curr_rent = 0 new_rent = video_rent(curr_rent) print(new total rent is, new_rent) print(maximum value in (3,4,1)

*** If you have any doubt regarding the solution please do ask in the comments, else do an upvote. ***

Add a comment
Know the answer?
Add Answer to:
Can you send the code and the screenshot of it running? 1) Create a PYHW2 document...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1 Normal 1 No Spac... Heading 1 Heading 2 Title Subtitle Subtle Em...Emphasis Int Styles 1)...

    1 Normal 1 No Spac... Heading 1 Heading 2 Title Subtitle Subtle Em...Emphasis Int Styles 1) Create a PYHW3 document that will contain your algorithms in flowchart and pseudocode form along with your screen shots of the running program 2) Create the algorithms in both flowchart and pseudocode forms for the following: A. Write a Python function that receives miles driven and gallons of gas used and returns miles per gallon. B. Write a Python program where the main function...

  • For C++ Write a main program that inputs a list of 20 numbers from a text file and then calls 4 ...

    For C++ Write a main program that inputs a list of 20 numbers from a text file and then calls 4 sort functions. Create a Sort Lab design document that include flowcharts of the main program and four sort functions Sort Functions:   Insertion, Selection, Bubble and Merge In each Sort function: count the number of compares and swaps needed to sort the numbers and display that information in the sort function. Run the program for four sets of data --...

  • c++ language Consider the series of numbers beginning at user-specified start and running up to but...

    c++ language Consider the series of numbers beginning at user-specified start and running up to but not including user-specified end, so for example start=1 and end=5 gives the series 1, 2, 3, 4. Return a new string[] array containing the string form of these numbers (e.g. "one", "two", "fifty-three" etc., except for multiples of 3, use "Fizz" instead of the number, for multiples of 5 use "Buzz", and for multiples of both 3 and 5 use "FizzBuzz". Test with numbers...

  • PYTHON 1- Write a function that receives a string value as a parameter, converts its first...

    PYTHON 1- Write a function that receives a string value as a parameter, converts its first character to uppercase and returns the first character. 2- Test your function by writing a main, which calls your function and prints its return value. 3- Save your program in a file called firstChar.py and use the following link to submit your file.  

  • Problem: Design and write a C language program that can be used to calculate Voltage, Current...

    Problem: Design and write a C language program that can be used to calculate Voltage, Current and Total Resistance for a Series or Parallel or a Series Parallel circuit. The program should display the main menu that contains the three types of circuit calculations that are available and then the user will be prompted to select a circuit first. After the circuit has been selected the program should then display another menu (i.e., a submenu) requesting the necessary data for...

  • Visual C# Homework 2 You are to write a program which will create a class called...

    Visual C# Homework 2 You are to write a program which will create a class called Student Each student has a name age height and weight. These variables should be declared as private. Create the correct constructors and functions. In the main, you will create 5 students. Input the data for the 5 students from a file which already has information in it. Name the file “Information.txt”. After setting up all the data, it is time to sort based on...

  • Write a Python program which simulates how a bank account works. (1) create a global constant...

    Write a Python program which simulates how a bank account works. (1) create a global constant INTEREST_RATE as the interest rate, which is assigned value 0.01. (2) create a global variable balance, which is initialized to 1000. (3) define a function named deposit which takes no parameter, it asks user to enter the amount of money that will be deposited into this account, then updates the global variable balance (which should increase by the amount of the deposit) and prints...

  • Programming Assignment 6: A Python Class, Attributes, Methods, and Objects Obiectives .Be able to...

    I need some help with programming this assignment. Programming Assignment 6: A Python Class, Attributes, Methods, and Objects Obiectives .Be able to write a Python class Be able to define class attributes Be able to define class methods .Be able to process input from a text file .Be able to write an application using objects The goal of this programming assignment is to develop a simple image processing application. The application will import a class that creates image objects with...

  • Need some help with this C++ code. Please screenshot the code if possible. Purpose: Demonstrate the...

    Need some help with this C++ code. Please screenshot the code if possible. Purpose: Demonstrate the ability to create and manipulate classes, data members, and member functions. This assignment also aims at creating a C++ project to handle multiple files (one header file and two .cpp files) at the same time. Remember to follow documentation and variable name guidelines. Create a C++ project to implement a simplified banking system. Your bank is small, so it can have a maximum of...

  • FUNCTIONS In this assignment, you will revisit reading data from a file, and use that data...

    FUNCTIONS In this assignment, you will revisit reading data from a file, and use that data as arguments (parameters) for a number of functions you will write. You will need to: Write and test a function square_each(nums) Where nums is a (Python) list of numbers. It modifies the list nums by squaring each entry and replacing its original value. You must modify the parameter, a return will not be allowed! Write and test a function sum_list(nums) Where nums is a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT