1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
enot [183]
2 years ago
15

The third assignment involves writing a Python program to compute the cost of carpeting a room. Your program should prompt the u

ser for the width and length in feet of the room and the quality of carpet to be used. A choice between three grades of carpeting should be given. You should decide on the price per square foot of the three grades on carpet. Your program must include a function that accepts the length, width, and carpet quality as parameters and returns the cost of carpeting that room. After calling that function, your program should then output the carpeting cost.
Your program should include the pseudocode used for your design in the comments. Document the values you chose for the prices per square foot of the three grades of carpet in your comments as well.
You are to submit your Python program as a text file (.txt) file. In addition, you are also to submit a test plan in a Word document or a .pdf file. 15% of your grade will be based on whether the comments in your program include the pseudocode and define the values of your constants, 70% on whether your program executes correctly on all test cases and 15% on the completeness of your test report.
Computers and Technology
1 answer:
mojhsa [17]2 years ago
3 0

Answer:

# price of the carpet per square foot for each quality.

carpet_prices=[1,2,4]

def cal_cost(width,height,choice):

 return width*height*carpet_prices[choice-1]  

width=int(input("Enter Width : "))

height=int(input("Enter Height : "))

print("---Select Carpet Quality---")

print("1. Standard Quality")

print("2. Primium Quality")

print("3. Premium Plus Quality")

choice=int(input("Enter your choice : "))

print(f"Carpeting cost = {cal_cost(width,height,choice)}")

Explanation:

The cal_cost function is used to return the cost of carpeting. The function accepts three arguments, width, height, and the choice of carpet quality.

The program gets the values of the width, height and choice, calls the cal_cost function, and prints out the string format of the total carpeting cost.

You might be interested in
The use of computers to combine data from multiple sources and create electronic dossiers of detailed information on individuals
valkas [14]
Data compilation I believe
4 0
3 years ago
If Number = 7, what will be displayed after code corresponding to the following pseudocode is run? (In the answer options, new l
kherson [118]

Answer:

5,10; 6,12; 7,14

Explanation:

We will demonstrate the iteration of the loop:

First iteration: Number = 7, Count = 5 at the beginning. We will check if Count <= Number? Since it is correct, prints 5,10. Increment the Count by 1.

Second iteration: Number = 7, Count = 6. We will check if Count <= Number? Since it is correct, prints 6,12. Increment the Count by 1.

Third iteration: Number = 7, Count = 7. We will check if Count <= Number? Since it is correct, prints 7,14. Increment the Count by 1.

Forth iteration: Number = 7, Count = 8. We will check if Count <= Number? Since it is not correct, the loop stops.

8 0
3 years ago
What function(s) does an interpreter perform with the instructions in a high-level programming language?
allochka39001 [22]

Answer:

Translates and Executes.

Explanation:

5 0
3 years ago
What makes for a good algorithm compatibility complexity humor correctness efficiency?
Svetlanka [38]
Correctness is key. The other ones are optimizations at most. Although I would always include humor... ;-)
5 0
3 years ago
Why is it worth remembering “All people seem to need data processing”?
Rzqust [24]
The answer is .........C
3 0
3 years ago
Read 2 more answers
Other questions:
  • ___ is the branch of computer science that explores techniques for incorporating aspects of intelligence into computer systems.
    5·1 answer
  • In your own words, describe the structure and function of both the stack and queue data structure and discuss how they are diffe
    6·1 answer
  • James has been asked to build a low-profile computer for his friend to use as a home theater system. James needs to choose parts
    15·1 answer
  • If you think a query is misspelled, which of the following should you do?
    15·1 answer
  • We want to transmit 40 packets and the following packets are getting lost, 3,9, 25,28, 35. How many rounds are needed if
    5·1 answer
  • What is an example of CT SO?
    9·1 answer
  • A tornado destroyed many
    6·2 answers
  • Type the correct answer in the box. Spell all words correctly.
    11·2 answers
  • Use the drop-down menus to complete the statements about changing mail options in Outlook.
    10·1 answer
  • Add my sna-p dkarpik58?...
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!