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

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 11:00
What are the possible consequences of computer hacking? what is computer piracy? describe some examples. what are the effects of computer piracy? what are the possible consequences of computer piracy? what is intentional virus setting? describe some examples. what are the effects of intentional virus setting? what are the possible consequences of intentional virus setting? what is invasion of privacy? describe some examples. what are the effects of invasion of privacy? what are the possible consequences of invasion of privacy? what is an acceptable use policy and what is the purpose of the acceptable use policy what is intellectual property and how can you use it?
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
Enzo’s balance sheet for the month of july is shown. enzo’s balance sheet (july 2013) assets liabilities cash $600 credit card $4,000 investments $500 student loan $2,500 house $120,000 mortgage $80,000 car $6,000 car loan $2,000 total $127,100 total $88,500 which expression finds enzo’s net worth?
Answers: 1
question
Computers and Technology, 24.06.2019 02:20
The first time a user launches the powerpoint program, which view is shown allowing the user to access recent presentations or create new presentations based on templates?
Answers: 1
question
Computers and Technology, 24.06.2019 15:00
Universal windows platform is designed for which windows 10 version?
Answers: 1
You know the right answer?
Implement the following logic in C++, Use appropriate data types. Data types are represented as eith...
Questions
question
English, 25.11.2021 19:40
question
Biology, 25.11.2021 19:40
question
Mathematics, 25.11.2021 19:50
question
Mathematics, 25.11.2021 19:50
question
Mathematics, 25.11.2021 19:50
Questions on the website: 13722367