Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Provided the problem statement below, which of the following algorithms will solve the problem? Reginald went to a shop to buy a number of fruit

Provided the problem statement below, which of the following algorithms will solve the problem?
Reginald went to a shop to buy a number of fruit bars. The amount due must be calculated and 14% vat added. The calculated value must be displayed on the screen.
a.
CalcAmntDue (valNum, valPrice)
Return (valNum * valPrice *1.14)
ShoppingProgram
display Enter the number of fruit bars bought
enter numberItems
display Enter the price of a fruit bar
enter price
amtDue = CalcAmntDue (numItems, price)
display The amound due is R, amtDue
end
b.
Function CalcAmntDue (valNum, valPrice)
Return (valNum * valPrice *1.14)
ShoppingProgram
display Enter the number of fruit bars bought
enter numberItems
display Enter the price of a fruit bar
enter price
amtDue = CalcAmntDue (numItems, price)
display The amound due is R, amtDue
end
c.
Function CalcAmntDue ()
Return (valNum * valPrice *1.14)
ShoppingProgram
display Enter the number of fruit bars bought
enter numberItems
display Enter the price of a fruit bar
enter price
amtDue = CalcAmntDue (numItems, price)
display The amound due is R, amtDue
end
d.
Function CalcAmntDue (valNum, valPrice)
Return (valNum * valPrice *1.14)
ShoppingProgram
display Enter the number of fruit bars bought
enter numberItems
display Enter the price of a fruit bar
enter price
amtDue = CalcAmntDue (valNum, valPrice)
display The amound due is R, amtDue
end

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions