Question: Part 1: Use functions to write a program that asks the user to enter an items cost and its markup percentage. It should then display

Part 1:

Use functions to write a program that asks the user to enter an items cost and its markup percentage. It should then display the price. The program should have a function that receives cost and markup percentage as arguments and calculates and returns the price of the item. Use a function to calculate the cost.

Part 2:

Continue the above program and add the following: add a function to read file input that will contain a while-loop that reads an unknown number of integers from the file input.txt and assume one integer per line. As you read the file using a while-loop, count the number of integers in the file and return the number to the main function (return count) where you will print the total and average to the screen.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!