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
Write a program to sort the list of numbers 16, 38, 54, 80, 22, 65, 55, 48, 64, 95, 5, 100, 58, 25, 36 using quick-sort algorithm. Explain sorting the list using algorithm steps neatly.
Design a script that will permit the user to enter one of several choices from the command line. The specific requirements are as follows:
Design a Unix shell script that searches for a text document with most occurrences of a given keyword. For instance, if I would like to search for a script with most usages of if statement,
Suppose that the probability than an incoming email is a spam is p(S), that the probability that the word "w" occurs in the subject line of the spam is p(w), and that q(w) is the probability that the word "w" occurs in the subject line of an email th..
Need Algorithim showing a home Maintenance Project. Problem statementHigh-level view of the program solutionFunction and internal structure of each program module
Distributed system algorithms - Leader Election (id), In: Processor's id , Out: LEADER if processor has largest id, NOT_LEADER if otherwise
created a linkedlist class
Show your reference at the end of your posting so that other readers can get more an in-depth knowledge in case they want to explore further. This also applies to other discussion threads.
This lab assignment requires you to compare the performance of two distinct sorting algorithms to obtain some appreciation for the parameters to be considered in selecting an appropriate sort.
1.create a flowchart to show the process that will allow the implementation of stack push and pop operations.2.create a
Consider the obvious algorithm for checking whether a list of integers is sorted: start at the beginning of the list, and scan along until we first find a successive pair of elements that is out of order.
Write a program that will read in a height in feet and inches (feet should be an integer, while inches should be a float) and will output the equivalent height in meters (as a float). Use at least three functions
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