The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 409 Weeks Ago, 1 Day Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Examine the pseudocode sample provided, and explain what it does line by line.
Â
Unit 5 Pseudocode Sample
Description: This function applies discount percentage on an item price unless the item price is less than the whole sale price. For example, a product at $10 with a wholesale price of $5 and a discount of 10% returns $9.
function applyDiscount(productPrice : Double,
wholesalePrice : Double,
discount : Double)
Return Double
Create variable discountedPrice as double
discountedPrice = productPrice * (1 – discount)
if (discountedPrice
discountedPrice = wholesalePrice
end if
return discountedPrice
End function
Â
Present a solution using pseudocode similar to what you saw above.
Identify the logic needed to create a Boolean function to determine if free shipping will be applied based on the total order amount (e.g., free shipping for orders over $75). The function is expected to return TRUE or FALSE depending on the free shipping criteria.
Present a second pseudocode solution that will call the function and print whether the user will get free shipping.Examine the pseudocode sample provided, and explain what it does line by line.Â
Â
 Unit 5 Pseudocode SampleÂ
Description: This function applies discount percentage on an item price unless the item price is less than the whole sale price. For example, a product at $10 with a wholesale price of $5 and a discount of 10% returns $9.Â
function applyDiscount(productPrice : Double,Â
wholesalePrice : Double,Â
discount : Double)Â
Return DoubleÂ
Create variable discountedPrice as doubleÂ
discountedPrice = productPrice * (1 – discount)Â
if (discountedPrice < wholesalePrice)Â
discountedPrice = wholesalePriceÂ
end ifÂ
return discountedPriceÂ
End function
Â
Present a solution using pseudocode similar to what you saw above.
Identify the logic needed to create a Boolean function to determine if free shipping will be applied based on the total order amount (e.g., free shipping for orders over $75). The function is expected to return TRUE or FALSE depending on the free shipping criteria.Â
Present a second pseudocode solution that will call the function and print whether the user will get free shipping.
Â
Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â----------- -----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------. P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll