Question

Develop an algorithm in PYTHON which incorporates decision making and Boolean logic, create a flowchart, and...

Develop an algorithm in PYTHON which incorporates decision making and Boolean logic, create a flowchart, and then develop the code. The algorithm could be a classification algorithm, a process for solving a problem, or a few questions which help a user buy a car,

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

consider a very simple program in which a user buys a used car based on the following conditions:

1) if the age of the car is less than 1 year, the number of miles traveled is less than 10000, and price is less than $3000 buy car

2) if the age of the car is more than 1 year and the number of miles traveled are less than 20000, price is less than $2000, buy car

3)else don't buy

Here is the flow diagram for the problem

Here is the python code for the same:

Here is the output :

Here is text code:

============================================================================

#ask for age, drive and price of car
age = float(input("Enter the age of car in years : "))

drive = float(input("Enter the number of kilometers car has been driven :"))

price = float(input("Enter price of car :"))

#first diamond in flowchart
if(age<1 and drive<10000 and price<3000):
   print("Buy Car")
#second diamond in flowchart
elif(age<2 and drive<20000 and price<2000):
   print("Buy Car")
else:
   print("Don't Buy Car")
============================================================================

Add a comment
Know the answer?
Add Answer to:
Develop an algorithm in PYTHON which incorporates decision making and Boolean logic, create a flowchart, and...
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
  • Python Activity 05 Boolean Expressions - POGIL (5) - Word Search m Layout References Mailings Review...

    Python Activity 05 Boolean Expressions - POGIL (5) - Word Search m Layout References Mailings Review View Help Critical Thinking Questions Programming Structures Sequence Structure Decision or Branching Structure Looping Structure FALSE Which structure best describes the types of Python programs you have written so far? _sequence structure Which structure allows the programmer to create code that decides what code is executed? FYI: Conditional operators, also known as relational operators, are used to compare the relationship between two operands. Expressions...

  • 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...

  • Decision Making Technology at UPS Regardless of the specific decisions a manager makes, the decision-making process...

    Decision Making Technology at UPS Regardless of the specific decisions a manager makes, the decision-making process is either programmed or nonprogrammed. Programmed decision making is a routine, virtually automatic process. Programmed decisions are ones that have been made so many times in the past that managers have developed rules or guidelines to be applied when certain situations inevitably occur. In programmed decision making, managers do not need to repeatedly make new judgments about what should be done. They can rely...

  • Using the above described algorithm, create a program that: (IN PYTHON) 1.Asks the user which type...

    Using the above described algorithm, create a program that: (IN PYTHON) 1.Asks the user which type of credit card he/she would like to find the checksum for. 2. Based on the user's choice of credit card, asks the user for the n digits of the credit card. [Get the input as a string; it's easier to work with the string, so don't convert to an integer.] 3. Using the user's input of the n digits, finds the last digit of...

  • We want to create a program which prints off what letter grade an individual receives based...

    We want to create a program which prints off what letter grade an individual receives based upon whether or not their grade obeys the following condition: grade>= 90 and grade = 80 and grade<89, we will print off “You made a B”, so on and so forth. In this program, we can assume that we are asking the user to enter whatever grade they recieved as a numeric input. NEED HELP WITH ALL PARTS! 4.) Consider the example of grades...

  • Your mission in this programming assignment is to create a Python program that will take an...

    Your mission in this programming assignment is to create a Python program that will take an input file, determine if the contents of the file contain email addresses and/or phone numbers, create an output file with any found email addresses and phone numbers, and then create an archive with the output file as its contents.   Tasks Your program is to accomplish the following: ‐ Welcome the user to the program ‐ Prompt for and get an input filename, a .txt...

  • In this assessment, you are required to program an Algorithm-based agent to solve a real-world, which is a challenging case study. This assessment is done individually, and you are required to submit programs and supporting documents in report format. Ple

    You are required to create a robot path planner that is able to find an optimal path to navigate an environment and reach a target. By completing this assessment, you will show your skills on leveraging the best algorithm to solve a simplified real-world problem.The maze can be seen in the image below. It can be seen that there are 12 rows and 24 columns, meaning there is a total of 288 blocks on the map. There are four different...

  • Help needed with Python 3: Dictionaries and Sets. The problem is one that asks the user to create...

    Help needed with Python 3: Dictionaries and Sets. The problem is one that asks the user to create a completed program that prompts the user for the name of a data file, and reads the contents of that data file, then creates variables in a form suitable for computing the answer to some questions. The format should be in the same manner as the attached .py file. All subsequent assignment details (.py and .csv files) can be found at this...

  • I. Read the following case: “Alex Smith is preparing a sales presentation for his company, Phones4Kids,...

    I. Read the following case: “Alex Smith is preparing a sales presentation for his company, Phones4Kids, which manufactures and sells cell phones that are specifically designed for children. Phones4Kids employs several hundred workers in Mooray, Missouri, a small town with only two other large employers in addition to Phones4Kids. Alex hopes to sell specialty phones for boys and girls aged 6-10 to a retailer in Hooptown, Missouri. This sale would represent approximately 25% of the projected revenue for the current...

  • JAVA Primitive Editor (Please help, I am stuck on this assignment which is worth a lot...

    JAVA Primitive Editor (Please help, I am stuck on this assignment which is worth a lot of points. Make sure that the program works because I had someone answer this incorrectly!) The primary goal of the assignment is to develop a Java based primitive editor. We all know what an editor of a text file is. Notepad, Wordpad, TextWrangler, Pages, and Word are all text editors, where you can type text, correct the text in various places by moving the...

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