you are to write a function and for-loops that outputs the shape like the one below: Introduction to Programming, OUA, Australia
University | Open Universities Australia (OUA) |
Subject | Introduction to Programming |
Task 1:
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
Example Runs
Run 1
Enter a value for x: 5
Enter a value for y: 3
Enter a value for z: 3
f = -7613.484692283496
Run 2
Enter a value for x: 1
Enter a value for y: 1
Enter a value for z: 1
f = 20.071067811865476
Run 3
Enter a value for x: 100
Enter a value for y: 1
Enter a value for z: 2
f = 47377.17423586197
Program:
x = int(input(“Enter a value for x: “))
y = int(input(“Enter a value for y: “))
z = int(input(“Enter a value for z: “))
f = ((((x – 0.5) * y) ** 0.5 + 1) / 1) + (1 + y * (x ** z)) * ((z+1) ** 0.5 * 4 + 1 – (z ** y) / 1)
print(‘f = ‘ +str(f))
Enter a value for x: 100
Enter a value for y: 1
Enter a value for z: 2
f = 59298.935474656995
Task 4:
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.
Example Runs
Run 1
Enter the height: 3
*
***
*****
*^*
^
Run 2
Enter the height: 5
*
***
* # *
* # *
*********
* ^ *
* ^ *
*^*
^
Run 3
Enter the height: 7
*
***
* # *
* # *
* # *
* # *
*************
* ^ *
* ^ *
* ^ *
* ^ *
*^*
^
Run 4
Enter the height: 10
*
***
* # *
* # *
* # *
* # *
* # *
* # *
* # *
*******************
* ^ *
* ^ *
* ^ *
* ^ *
* ^ *
* ^ *
* ^ *
*^*
^
To check for correctness, ensure that your program gives the same outputs as in the examples, as well as trying it with other inputs.
Get Solution of this Assessment. Hire Experts to solve this assignment for you Before Deadline.
Recent Solved Questions
- List The Main Areas Of Customer Service Delivery That Are Critical To The Success: Cert III Dental Assisting Course Work, RMIT, Australia
- Organize A Group To Cover The 4 Topic Areas: Sustainable Hotel Environment Assignment, VU, Australia
- Demonstrate How You As A Holistic Counselor Would Explain To A Client The Usefulness: Meridian Therapy Coursework, MDU, Australia
- CHCAGE001: Provide three (3) examples of myths/ stereotypes about older people and aging Depression and loneliness are normal in older people: Facilitate the empowerment of older people Assignment, TAFE, Australia
- MBA402: You must Prepare a Sustainability Assessment Report for Tramalway Industries Referring to the Consolidated: Governance, Ethics and Sustainability Assignment, KU, Australia
- BSBXCS303: You are employed by Anytown Marketing as an IT Consultant to assist in implementing their data security and privacy: Securely manage personally identifiable information and workplace information Course Work, AU, Australia
- This is an “open book” assignment – we can hardly prevent you from opening your books, after all – however, note that you will be expected to answer: Linguistics Assignment, UM, Australia
- NRSG635: You are a new graduate nurse working in a surgical ward You have been there for one month and have been administering medications safely:Nursing Essay, ACU, Australia
- Akala Akala is an Aboriginal Australian who suffers from a degenerative respiratory disease: Communication Assignment, UOS, Australia
- The study of visible sound vibration, called cymatics, explores, examines, and explains how sound and matter: Diploma of Holistic Integrated Creative Arts Therapy course work, Australia