subject

Implement the following logic in C++, Use appropriate data types. Data types are represented as either numeric (num) or string. start
string name
string address
num item //use int
num quantity
num price //use double as data type
num SIZE = 6
num VALID_ITEM [SIZE] = 106, 108, 307, 405, 457, 688 //use int as data type
num VALID_ITEM_PRICE [SIZE] = 0.59, 0.99, 4.50, 15.99, 17.50, 39.00 //use double as data type
num i
bool foundIt = false
string MSG_YES = "Item available"
string MSG_NO = "Item not found" get name, address, item, quantity
i = 0
while i < SIZE
if item == VALID_ITEM [i] then
foundIt = true
price = VALID_ITEM_PRICE [i]
endif
i = i + 1
endwhile
if foundIt == true then
print MSG_YES
print quantity, " at " , price, " each"
print "Total ", quantity * price
else
print MSG_NO
endif
stop

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 03:40, hussain34
Mary's manager told her she should insert a graphic into her documentwrite mary a brief note describing how to insert a graphicin a word processing document.
Answers: 1
image
Computers and Technology, 23.06.2019 15:10, cathyjuan
What role did women fill during world war ii?
Answers: 1
image
Computers and Technology, 23.06.2019 18:20, Blossom824
What is wi-fi infrastructure? a metropolitan area network that uses radio signals to transmit and receive data a communications technology aimed at providing high-speed wireless data over metropolitan area networks a means by which portable devices can connect wirelessly to a local area network, using access points that send and receive data via radio waves includes the inner workings of a wi-fi service or utility, including the signal transmitters, towers, or poles and additional equipment required to send out a wi-fi signal
Answers: 2
image
Computers and Technology, 23.06.2019 22:20, kandi2565
What is a programming method that provides for interactive modules to a website?
Answers: 1
You know the right answer?
Implement the following logic in C++, Use appropriate data types. Data types are represented as eith...

Questions in other subjects: