Skip to main content

Assignment 2 Frans Virtual Fruit Stand Part 2due Week 9 And

Page 1


Assignment 2 Frans Virtual Fruit Stand Part 2due Week 9 And Worth 1

Assignment 2: Fran’s Virtual Fruit Stand, Part 2 Due Week 9 and worth 160 points Use the concepts and scenario from Assignment 1 to help Fran’s Virtual Fruit Stand increase the functionality of its online shopping cart. When a customer checks out, the shopping cart must store the required data pertaining to each item the customer is buying. Your job is to design a program that will prompt the user for the required data and then store it. The required data includes the item name, the price per pound, and the number of pounds of that item being purchased. When complete, your program should include three (3) arrays, two (2) loops, one (1) and / or conditional statement , and one (1) variable.

Using Visual Logic, design a flowchart that is also a fully functional program to add functionality to the online shopping cart. According to your design, the program must: 1. Continually accept data regarding the purchase of fruit as specified below until the user enters a sentinel value, or until five (5) items are entered, whichever comes first. 2. Prompt the user for each item and accept the name of the fruit (e.g., “dried applesâ€), the price per pound, and the number of pounds sold in a month. 3. Store the required data in three (3) arrays (e.g., one (1) for the item name, one (1) for the price per pound, and one (1) for the number of pounds being purchased) with corresponding index values. Note: For example, index value 3, when applied to the “itemName†array, would give us the name of the third item that the customer is buying. That same index value of 3, when applied to the “pricePerPound†array, would give us the price per pound of that same third item that the customer is buying. 4. Store up to five (5) values in each of the three (3) arrays. 5. Provide functionality in which the user ends the program by typing a sentinel value, and the program tells the user what the sentinel value is. Note: An acceptable message may read “Type n to end the program.â€, where “ n †is the sentinel value. If the user does not end the program in this way, then the program ends when it has collected the data for five (5) items. 6. Print an itemized receipt with the following data after the last item in the purchase has been saved to the array. Item name Price per pound of each item ·Number of pounds purchased of each item ·Subtotal price for each item, calculated as price per pound multiplied by the number of pounds Total weight of the entire order (in pounds) The cost of shipping which is based on the total weight of the entire order, calculated as 50 cents per pound. Note: For example, if the entire order weighs seven (7) pounds, the cost of shipping would be $3.50. · Grand total price of all items and shipping. Note: Use the “console†option in the output command to accomplish this task. An example of an acceptable output has been provided below: Item name Price per pound Number of pounds Subtotal Yellow Raisins $12 Dried Apples $15 Total Shipping 8 $27 $4 Grand Total $31 LING

210: Assignment #2 Name: Due in class on Thursday, June 2 Your answers must be typed and double spaced (Font: Times New Roman, 12 point). You must answer them in your own words. Proofread and edit your answers before you hand them in. (33 points) 1) Define and/or answer the following terms completely and clearly. a. Proto-Indo-European language b. Cognates c. The comparative reconstruction d. Germanic Family of Languages e. Dialects f. Social networks g. Isoglosses h. William Labov i. Hans Kurath j. Samuel Johnson a. Give approximate dates of the beginning and end of Old English Period, Middle English Period and early Modern English Period 2) Do ONE of the following: (6 points) a. Discuss the major events (events that had significant effects on English language) that took place in the history of English language during Early Modern English Period. b. Discuss the major events (events that had significant effects on English language) that took place in the history of English language during Middle English Period. c. Discuss the major events (events that had significant effects on English language) that took place in the history of English language during Old English Period. 3) Do ONE of the following: (6 points) a. Why do language varieties become different or similar? Explain the various factors clearly. b. Discuss the phonological, grammatical features of African-American English. c. Discuss language stereotypes and language discrimination in a paragraph.

-->

Assignment 2 Frans Virtual Fruit Stand Part 2due Week 9 And Worth 1

Assignment 2 Frans Virtual Fruit Stand Part 2due Week 9 And Worth 1

Assignment 2: Fran’s Virtual Fruit Stand, Part 2 Due Week 9 and worth 160 points Use the concepts and scenario from Assignment 1 to help Fran’s Virtual Fruit Stand increase the functionality of its online shopping cart. When a customer checks out, the shopping cart must store the required data pertaining to each item the customer is buying. Your job is to design a program that will prompt the user for the required data and then store it. The required data includes the item name, the price per pound, and the number of pounds of that item being purchased. When complete, your program should include three (3) arrays, two (2) loops, one (1) and / or conditional statement , and one (1) variable.

Using Visual Logic, design a flowchart that is also a fully functional program to add functionality to the online shopping cart. According to your design, the program must: 1. Continually accept data regarding the purchase of fruit as specified below until the user enters a sentinel value, or until five (5) items are entered, whichever comes first. 2. Prompt the user for each item and accept the name of the fruit (e.g., “dried

apples”), the price per pound, and the number of pounds sold in a month. 3. Store the required data in three (3) arrays (e.g., one (1) for the item name, one (1) for the price per pound, and one (1) for the number of pounds being purchased) with corresponding index values. Note: For example, index value 3, when applied to the “itemName” array, would give us the name of the third item that the customer is buying. That same index value of 3, when applied to the “pricePerPound” array, would give us the price per pound of that same third item that the customer is buying. 4. Store up to five (5) values in each of the three (3) arrays. 5. Provide functionality in which the user ends the program by typing a sentinel value, and the program tells the user what the sentinel value is. Note: An acceptable message may read “Type n to end the program,” where “n” is the sentinel value. If the user does not end the program in this way, then the program ends when it has collected the data for five (5) items. 6. Print an itemized receipt with the following data after the last item in the purchase has been saved to the array: Item name Price per pound of each item ·Number of pounds purchased of each item ·Subtotal price for each item, calculated as price per pound multiplied by the number of pounds Total weight of the entire order (in pounds) The cost of shipping which is based on the total weight of the entire order, calculated as 50 cents per pound. Note: For example, if the entire order weighs seven (7) pounds, the cost of shipping would be $3.50. Grand total price of all items and shipping. Note: Use the “console” option in the output command to accomplish this task. An example of an acceptable output has been provided below: Item name Price per pound Number of pounds Subtotal Yellow Raisins $12 Dried Apples $15 Total Shipping 8 $27 $4 Grand Total $31

Paper For Above instruction

In this paper, I will develop a comprehensive program design that enhances the checkout process of Fran’s Virtual Fruit Stand. The goal is to implement a logical flow that can be translated into a flowchart and a functioning program, effectively capturing customer purchase data and producing an itemized receipt with all necessary calculations.

To begin with, the program must allow users to enter data repeatedly until a specified stopping condition is met. This could be either the user entering a sentinel value or reaching a maximum of five items. The core mechanism involves a loop structure that prompts for and stores data such as fruit name, price per pound, and quantity in pounds, which is stored in corresponding arrays. The use of three separate arrays—one for item names, one for prices, and one for quantities—allows for organized data management and easy retrieval for calculations and display.

Implementing the input collection phase involves a loop, which iterates up to five times or until the sentinel value is entered. During each iteration, the program prompts the customer for the item name; if the sentinel value (say, "n") is entered, the program terminates data collection and proceeds to receipt generation. Otherwise, the program asks for the price per pound and the number of pounds purchased, and each set of data is stored at the current index in the respective arrays.

Once data collection concludes, the program calculates the subtotal for each item as the product of price per pound and number of pounds. The total weight of the order is accumulated by summing the individual weights. The shipping cost is then computed at a rate of 50 cents per pound, based on the total weight. The grand total includes all item subtotals plus the shipping cost.

The program then outputs an itemized receipt, with each line showing the item name, price per pound, number of pounds, and subtotal. Following this, the total weight, shipping cost, and final grand total are displayed in a clear, organized format. The output is delivered via the console, ensuring the customer can easily review their purchase before finalizing it.

References

Gaddis, T. (2018). Starting Out with Programming Logic & Design (4th ed.). Pearson.

Deitel, P., & Deitel, H. (2017). How to Think Like a Computer Scientist: Learning with Python (2nd Ed.). Pearson.

Knuth, D. E. (1998). The Art of Computer Programming. Addison-Wesley.

Reenskaug, T. (1978). Models of the Application Layer. Datalogi, 135-154.

Ritchie, D. (1974). The Development of the C Language. Communications of the ACM, 17(3), 147-154.

Labov, W. (1966). The Social Stratification of English in New York City. In The Social Stratification of English in the United States (pp. 289-322). CUP.

Kurath, H. (1962). The Language of East Anglia. University of Michigan Press.

Johnson, S. (1755). A Dictionary of the English Language. W. Strahan and J. Richardson.

Online resources on flowchart design and programming logic. (2020). Retrieved from https://www.example.com

McConnell, S. (2004). Code Complete (2nd ed.). Microsoft Press.

Turn static files into dynamic content formats.

Create a flipbook