Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write code for the below algorithm (10 marks) Read the following algorithm to determine the level of discount a buyer receives based on the

Write code for the below algorithm (10 marks) Read the following algorithm to determine the level of discount a buyer receives based on the number of products being purchased, and to output the discounted price. Prompt the user for the total regular price of the purchase . Read in the total regular price of the purchase If the total regular price is greater than $100, then discount = 0.2 (i.e. 20%), otherwise, discount = 0.1 (i.e. 10 %) Compute: discounted price = (1 - discount) x total regular price . Output the discounted price

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

Research Methods Statistics and Applications

Authors: Kathrynn A. Adams, Eva Marie K. Lawrence

1st edition

1452220182, 978-1452220185

More Books

Students also viewed these Programming questions

Question

Why do you think strategic plans should be greater than one year?

Answered: 1 week ago