Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Must be in python Problem 1 An online retailer sells five products whose retail prices are as follows: Product 1, $2.98 Product 2, $4.50 Product

Must be in python

Problem 1

An online retailer sells five products whose retail prices are as follows:

Product 1, $2.98

Product 2, $4.50

Product 3, $9.98

Product 4, $4.49

Product 5, $6.87

Part A

Write a program that reads the quantity sold of each product and calculates and displays the total retail value of all products sold. Use a for loop to iterate through the products. Sample input/output:

Enter quantity sold of product 1: 2

Enter quantity sold of product 2: 6

Enter quantity sold of product 3: 3

Enter quantity sold of product 4: 7

Enter quantity sold of product 5: 1

Total $101.20

Part B

Rewrite problem 1 using a counter while loop.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

Students also viewed these Databases questions

Question

=+What benefits are there in direct mail?

Answered: 1 week ago

Question

What is dividend payout ratio ?

Answered: 1 week ago

Question

Explain the factors affecting dividend policy in detail.

Answered: 1 week ago