Question

For this problem, you should: describe the algorithm using a flowchart and then use Python to...

For this problem, you should: describe the algorithm using a flowchart and then use Python to implement the algorithm. You must include a.) a picture of your flowchart, b.) a screen shot of your program, and c.) a screen shot of your output. Programming Task: An Arctic helicopter service cannot carry more than 2 passengers and more than 300 pounds in extra weight. Define variables to hold the weight of each of the two passengers. If the combined weight exceeds 300 pounds output a message that says, “I can only take one of you on this trip.” Finally, output a message that states what the total weight was. Test your program by showing the output when the weight exceeds 300 pounds and the output when it does not.

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

Following is the code:

*weight. ру-С:/Users/heman/Desktop/Weight.py (3.6.0)* File Edit Format Run Qptions Window Help def main): weightl - int(input

Output1:

В Python 3.6.0 Shell File Edit Shel Debug Options Window Help Python 3.6.0 (v3.6.0:41df79263all, Dec 23 2016, 07:18:10) [MSC

Output2:

Python 3.6.0 Shell File Edit Sh Debug Options Window Help Python 3.6.0 (v3.6.0:41df79263all, Dec 23 2016, 07:18:10) [MSC v.19

Flow Chart:

BEGIN input weight1 weight1+ weight2) > 300? print: can only take one of you on this trip. print (weight. weight2) END

Hope this helps...

BEST WISHES!

Add a comment
Know the answer?
Add Answer to:
For this problem, you should: describe the algorithm using a flowchart and then use Python to...
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
  • 4. For the following problem submit a photo of the flowchart and shots of your Python...

    4. For the following problem submit a photo of the flowchart and shots of your Python screens showing the program code and the output. Your task is to input from the teacher the test score of each student and to output the highest score. You need to check each score to make sure it is valid (at least 0 and at most 100). If it is not valid, keep prompting for a valid score until you get one. After a...

  • Create an algorithm design (you may use a flowchart and/or pseudocode) AND the Python program to...

    Create an algorithm design (you may use a flowchart and/or pseudocode) AND the Python program to determine the winning team for Virginia Tech's Bowling League. There are 8 members per team and 12 teams in the league. Each bowler needs their score (between 0 and 300) to be entered. The winning team is found by determining the highest average score. Output the team’s name and average that wins the competition.

  • a) Implement the bottom-up dynamic programming algorithm for the knapsack problem in python. The program should...

    a) Implement the bottom-up dynamic programming algorithm for the knapsack problem in python. The program should read inputs from a file called “data.txt”, and the output will be written to screen, indicating the optimal subset(s). b) For the bottom-up dynamic programming algorithm, prove that its time efficiency is in Θ(nW), its space efficiency is in Θ(nW) and the time needed to find the composition of an optimal subset from a filled dynamic programming table is in O(n). Consider the following...

  • You will create flowchart using Flowgorithm and Pseudocode for the following program example:&nbs...

    you will create flowchart using Flowgorithm and Pseudocode for the following program example:   Pet Care is a doggy day care that would like you to create a program that accepts the dog owner's name pet's name, breed, age and weight of the dog. The program should allow the user to enter this data until a sentinel value is reached. Then it will display the dog's name if the dog weighs less than 20 pounds or more than 100 pounds (be...

  • Practice Problem [no points]: You should read and understand Fibonacci algorithm, write a code in a...

    Practice Problem [no points]: You should read and understand Fibonacci algorithm, write a code in a high level language of your choice and in Assembly to find a Fibonacci number and check your result. At the end of this assignment a possible solution to this problem is given both in Python and MIPS assembler. Note that it would have been possible to write the Python differently to achieve the same function. . [20 points] Write and debug a MIPS program...

  • In this assignment, you will develop a C++ program which calculates a shipping charge and determines...

    In this assignment, you will develop a C++ program which calculates a shipping charge and determines the “type of trip” for a freight shipping company. Ask the user to enter the distance a package is to be shipped, and use a menu and a switch statement to determine the rate based on the package’s weight. Then display the shipping charge and using the table in #7 below, display the type of trip. Below is the chart to use to calculate...

  • python language Problem Description: In this program we are going to explore a list or an...

    python language Problem Description: In this program we are going to explore a list or an array of integers using Python. Your program should read a set of integers from the user and store them in a list. Read numbers from the user until the user enters 0 to quit. Then store them in a list. Your program should them compute the sum of all the numbers in the list and output to the user. You will use lists and...

  • 1. Create an algorithm for a program that simulates a police radar gun. The algorithm should...

    1. Create an algorithm for a program that simulates a police radar gun. The algorithm should read an automobile speed (in km/h) and print the message “Speeding” if the speed exceeds 60kmh. The algorithm should then also calculate the appropriate fine. If the speed is 5 km/hr or less over this limit, only issue a warning. $80 for more than 5 and no more than 10 kmh above the limit, $150 for more than 10 but no more than 20kmh...

  • Use Microsoft Word to create a flowchart for the following instructions Note: Within your flowchart you...

    Use Microsoft Word to create a flowchart for the following instructions Note: Within your flowchart you will need to use terminators, process boxes, input/outputs and a decision diamond 1. Asks the employee to input the number of hours worked that week. 2. If the employee inputs a decimal number output "Sorry, must be a whole number and return to the original input asking for number of hours to be input 3. If they worked more than 8 hours - multiply...

  • PLEASE HELP ME WITH THIS TASK 3.1 (FLOWCHART) AND TASK 3.2 (SOURCE PROGRAM). THANK YOU! Given...

    PLEASE HELP ME WITH THIS TASK 3.1 (FLOWCHART) AND TASK 3.2 (SOURCE PROGRAM). THANK YOU! Given below is a partially completed C program, which you will use as a start to complete the given tasks. #define SIZE 9 #include <stdio.h> int compareAndCount (int[], int[]); double averageDifference (int[], int[]); void main() { } int compareAndCount(int arr1[SIZE], int arr2[SIZE]) { int count = 0; for (int i = 0; i < SIZE; i++) { if (arri[i] > arr2[i]) count++; } return count;...

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