Computes the value of acceleration of object

Assignment Help Python Programming
Reference no: EM133122702

CSE4IP Introduction to Programming - La Trobe University

Programming Assignment

Programming Tasks

Take your time to read and re-read the instructions before attempting to write your solution---you can save a lot of trouble by simply having a clear understanding of the problem before touching any code.

Task 1
For this task, you are to write code for the following numerical expression.

Instructions
Write a simple Python program which asks the user to input a value for x and z , and then prints the result of the following mathematical expression:

Requirements
You must keep the calculation as a single expression on a single line in your final solution.
You must not rearrange or simplify the expression in any way.
You should parentheses in code so that it is evaluated in the same way as the mathematical expression described above.
You must not use any conpcets not covred yet

Task 2
For this task, you are to write code that computes the value of acceleration of object, given the values of displacement, time, and initial velocity.

Instructions
Your program should ask for user inputs to get the values of displacement (how much distance the object has travelled), time, and the initial velocity of the object. It should then calculate the acceleration of the object and print this value out.

Requirements
To achieve full marks for this task, you must follow the instructions above when writing your solution. Additionally, your solution must adhere to the following requirements:

Appropriate data types must be used for all user inputs.
The output must be printed with the value between the description and the unit of measurement, as shown in the example runs.

Task 3
For this task, you are to write code that determines whether a person is eligible to participate in a clinical trial.

Instructions
Your program should ask the user for a few details:

The weight of the person (in kilograms)
The height of the person (in meters)
Whether the person is over 18 years of age.
Your program should then calculate the body mass index (BMI) of the person. Finally, your program should output whether the person is eligible to participate in the clinical trial. A flowchart has been provided which outlines the program flow. Use this in conjuction with the text description to code the solution.

Notice that the flowchart contains a decision element which checks whether the person is eligible. We will consider a person to be eligible for the trial if both of the following two conditions are met:

The person has a BMI value greater than or equal to 20.
The person is older than 18 years.
Your solution should make appropriate use of a single complex boolean expression encompassing both the above conditions. If done correctly you will only need one if/else structure in your solution (corresponding to the one decision element in the flowchart).

Hint: Think about how to combine multiple conditions using a logical operator.

Requirements
To achieve full marks for this task, you must follow the instructions above when writing your solution. Additionally, your solution must adhere to the following requirements:

Appropriate data types must be used for all user inputs.
The calculate_body_mass_index function must be used exactly once in your solution.
The MIN_BMI constant must be used in your solution.
The decision element in the flowchart must be implemented in a single complex boolean expression encompassing both eligibility conditions.

Task 4
For this task, you are to write a function and for-loops that outputs the shape like the one below. Allow the user to specify how high the shape should be.

Instructions
Your function should take one argument: the height of the shape and then print the shape based on the value of the height

Requirements
To achieve full marks for this task, you must follow the instructions above when writing your solution. Additionally, your solution must adhere to the following requirements:

You must implement the for-loops and print inside the function.
Appropriate data types must be used for all user inputs.
Your solution must not add any more lines of code outside the function implementation.

Task 5
For this task, you are to write code that calculates the maximum yearly income tax given by an individual within a period of multiple years.

Instructions
Your program should first ask the user to input a number of years. The program should then repeatedly ask the user to input a yearly tax amount until the specified number of years is reached. Finally, the program should output the maximum yearly income tax of the user based on the input values.

Hint: consider which form of aggregation might be appropriate for solving this problem.

If the user inputs zero for the number of years, the program should output a friendly message informing the user that maximum tax could not be calculated.

Requirements
To achieve full marks for this task, you must follow the instructions above when writing your solution. Additionally, your solution must adhere to the following requirements:

You must choose appropriate data types for user input.
Your solution must not crash if the user inputs zero for the number of years.
Your solution must be implemented using a for loop on a range.
You must indicate which year the input is for as part of your income tax prompt (see example runs).

Task 6
For this task, you are to write a function that takes two strings as inputs and then print how many matches there are between them. A match is where the two strings have the same character at the same index. For example, ‘Melbourne' and ‘Mildura' match in the first and third characters so the function should print 2. 'Python' and 'Path', match in the first, third, and fourth characters, the function should print 3.

Instructions
You program should first ask the user to input two different strings. If you entered the same strings, the program should ask the user to re-enter two different strings.

Requirements
To achieve full marks for this task, you must follow the instructions above when writing your solution.

Attachment:- Programming Assignment.rar

Reference no: EM133122702

Questions Cloud

Determine the scope of work : In the eight steps in the appraisal process, the second step is to determine the scope of work.
What does right really mean : What does "right" really mean? How do you know when something is truly right or wrong?
About memorable experience working with team : Write a description about a memorable experience working with a team.
What is the expected increase : Gertrude had total revenue of $4,000mm in Year 0, and revenue is expected to increase by $480mm in Year 1, to $4,480mm. What is the expected increase
Computes the value of acceleration of object : Computes the value of acceleration of object, given the values of displacement, time, and initial velocity - determines whether a person is eligible
Human services job : If you were applying for a human services job and were asked, "What are the most important goals you have for your clients?" how would you respond?
List down the three types of investment you chose : Assume you have P900,000.00 and you want to invest your money into three types of investment. List down the three types of investment you chose
How much is the commission expense recognized : As of December 31, 2020, the company paid a total of P1,800,000 and the total expense is P2300000. How much is the commission expense recognized
What are the potential tax implications : What are the potential tax Implications when an Investor decides to automatically reinvest fund distributions Into additional non-registered fund units?

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd