Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

The program is in Python

Write a program that has 5 functions. Name your functions based on its functionality. Avoid naming your function, funtion1, fucntion2, etc. For example, a function that converts inches to centimeters may be named inchTocm.

Function 1: This function accepts a string of characters and displays it 5 times on the screen. In your main function, you will show its usage.

Function 2: This function asks for 2 whole numbers such as 10 and 21 and display all of the odd numbers between the 2 parameters. In this case, the function will display 11 13 15 17 19 and 21. Calculate and return the total of the odd numbers. Call this function in the main function to show how it could be used.

Function 3: This function accepts as its parameter any number. The function will display the number followed by *****, followed by the number squared, followed by &&&&&, and followed by the number cubed. For example, if the parameter value is 5, the function will display 5***25&&&125. In your main function, call this function with as many numbers at the user wishes to enter. So, use a sentinel value. Note that the loop as OUTSIDE of the function.

Function 4: This function accepts the number of items to be entered by the user, asks for the indicated number of items and it calculates and returns the total of the numbers. Note that the loop that calculates the total is inside this function. If the value of the total happens to be more than 10 return -1. Otherwise, return the calculated total.

Function 5: (Don't let the MATH bother you! You just have to convert the formula into a program statement. This function calculates and returns the distance an object falls due to gravity in a specific time period. The formula is:

Distance = ½ * gravity * time2

The function accepts as parameters the value for gravity and the value for time the object has been falling. The function returns the value of distance. In your main function, use a loop to ask the user for a set of values for gravity and time and display the value for distance. For example, if the value of gravity is 9.8 and time is 10, distance will be 98.

Make sure to write code to show the usage of all of the functions you have created.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92524998
  • Price:- $25

Priced at Now at $25, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Software engineering software architecture questioncan

(Software engineering (Software Architecture) question) Can someone explain how a system's decomposition into components is driven by the system's features/requirements. Also, how can this decomposition be used to determ ...

Structureswrite the program in c onlytask create a seating

Structures Write the Program in C++ only. Task: Create a seating reservation program for Podunk Airlines. The air fleet consists of a single plane with a seating capacity of 12. The plane makes one flight daily. Your pro ...

Question suppose you want to store the following

Question : Suppose you want to store the following information: Student_id Course Mark 111 Maths 78 111 Physics 90 222 Biology 89 333 Physics 60 333 Chemistry 75 1.a Is this table in first normal form? Why or Why Not? 1. ...

Suppose that an algorithm takes 30 seconds for an input of

Suppose that an algorithm takes 30 seconds for an input of 224 elements (with some particular, but unspecified speed in instructions per second). Estimate how long the same algorithm, running on the same hardware, would ...

Question suppose that we run a greedy search algorithm with

Question : Suppose that we run a greedy search algorithm with h(n) = -g(n). What sort of search will the greedy search emulate? What if h(n) = g(n)? What sort of search does greedy search emulate in this case? Explain yo ...

Consider the labor market of the telecom industry is

Consider the labor market of the telecom industry is originally at an equilibrium level E0 and w0. Assume that now the companies offer each employee an iPhone as employment benefit every year. The firms can get iPhone at ...

Subject digital securityprovide an fidm authentication

subject : Digital Security Provide an FIdM authentication system that you have used (being subjet to). Tell the name of the organizations acted as the IdP (Identity Provider) and SP (Service Provider)?

If you want to answer a research question regarding whether

If you want to answer a research question regarding whether a particular group of subjects experiences any significant changes in behavior as they age but you do not have the time or money for a traditional longitudinal ...

Question summarize the human-computer interface hci of

Question : Summarize the human-computer interface (HCI) of Microsoft Word 2013 and Visio 2013. Explain the importance of HCI and usability of the software. Be sure to note any commonalities between the applications and n ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As