Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Enhance the pseudocode in the attachment by using arrays and loops. Also, instead of hardcoding the product names within the program, ask the user to enter the product names in addition to the prices.
You can use char array products[5][40] and float array prices[5] to store the names and prices respectively (use "char products[6][40]" and "float prices[6]" if you want to simplify the code at the expense of a few more bytes of memory). Feel free to define additional arrays if needed.
main(): prompt the user to enter the price for appleread apple_price prompt the user to enter the price for bananaread banana_price prompt the user to enter the price for grapesread grapes_price prompt the user to enter the price for pearsread pears_price prompt the user to enter the price for tomatoread tomato_price do prompt whether the user wants to do checkout read response if response is yes then invoke checkout() endifwhile response is yes; print "Thanks for using checkout program". checkout(): initialize total to 0 do list the products print 1. apples print 2. banana print 3. grapes print 4. pears print 5. tomatos prompt the user to select a product or enter 0 for complete checkout read selection if selection > 0 then prompt the user to enter weight read weight // you can alternatively use select ... case ... end structure when coding. if selection is 1 then add (weight * apple_price) to total endif if selection is 2 then add (weight * banana_price) to total endif if selection is 3 then add (weight * grapes_price) to total endif if selection is 4 then add (weight * pears_price) to total endif if selection is 5 then add (weight * tomato_price) to total endif endifwhile selection is not 0; if total > 50 apply 5% discount output the discount and the new totalelse output totalendif
q.1. determine the minimum weighted path length p for six weights 4 15 25 5 8 16. draw the huffman tree also for the
What does a computer know about a declared array?
if you can monitor when sql injections are performed on an sql database what would you recommend as a security
For instance, the constraints x1 = x2, x2 = x3, x3 = x4, and x1 6= x4 cannot be satis fied. Give an efficient algorithm that takes as input m constraints over n variables and decides whether the constraints can be satis fied.
Write a C++ program that inputs 10 integers into an array and displays the inputs, the smallest element and its index
Construct a specific error in more than this number of bits and explicitly show that the Hamming algorithm fails to detect the error. How space (number of bits required) efficient is your Hamming code?
Probabilistic Analysis of Hash Functions - In this assignment, you will write and evaluate 5 different hash functions with whose input keys are names. Your evaluation should be based on popular American first names
data array a has data series from 1000000 to 1 with step size 1 which is in perfect decreasing order.data array b has
Display the book title and the number of books sold where the profit from the book is more the 70%. The resulting list should display highest quantity of books title sold first in the list. Profit for a book is calculated as (retail - cost) / c..
q1 compare the average behavior of insertion sort for n elements with that of the n insertions into an initially-empty
Perform a radix sort, using a decimal basis (that is sorting into 10 buckets, ordered 0 to 9) on the given list:
Compute the entropy of the plaintext message?
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd