Shopping Cart System
Create an application that works like a shopping cart system for an online book store. In the book’s source code (available at www.pearsonhighered.com/gaddis) you will find a file named BookPrices.txt. This file contains the names and prices of various books, formatted in the following fashion:
I Did It Your Way, 11.95
The History of Scotland, 14.50
Learn Calculus in One Day, 29.95
Feel the Stress, 18.50
Each line in the file contains the name of a book, followed by a comma, followed by the book’s retail price. When your application begins execution, it should read the contents of the file and store the book titles in a ListView. The user should be able to select a title from the list and add it to a “shopping cart,” which is simply another ListView control. The application should have buttons or menu items that allow the user to remove items from the shopping cart, clear the shopping cart of all selections, and check out. When the user checks out, the application should calculate and display the subtotal of all the books in the shopping cart, the sales tax (which is 7 percent of the subtotal), and the total.
Want to see the full answer?
Check out a sample textbook solutionChapter 13 Solutions
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Additional Engineering Textbook Solutions
Starting Out With Visual Basic (7th Edition)
Starting Out with Python (4th Edition)
Modern Database Management
Computer Systems: A Programmer's Perspective (3rd Edition)
- Each of the following files in the Chapter.08 folder of your downloadable student files has syntax and/or logical errors. In each case, determine the problem, and fix the program. After you correct the errors, save each file using the same filename preceded with Fixed. For example, DebugEight1.cs will become FixedDebugEight1.cs. a. DebugEight1.cs b. DebugEight2.cs c. DebugEight3.cs d. DebugEight4.csarrow_forwardC++HurdleWords The HurdleWords class is mostly provided to you. HurdleWords is constructed from two files in the data/ folder: ● valid_guesses.txt (all 5 letter guesses considered to be valid words to guess), and ● valid_hurdles.txt (all words that may be selected to be the secret Hurdle.) ● Note: you may edit both text files if you’d like to add custom words to your game. HurdleWords stores all potential valid Hurdles from valid_hurdles.txt into a vector of strings (valid_hurdles_), and all valid guesses from valid_guesses.txt into an unordered set of strings (valid_guesses_). A set is simply a data structure that contains no duplicates and allows for a speedy lookup to check if a given element exists within the set. Because there are over 10,000 valid guesses, we store them in an unordered set to leverage their speediness, as you will need to check if a user-submitted guess is considered valid (i.e. their guess is considered a valid guess in the dictionary). You are responsible for…arrow_forwardCreate an application which is going to find out your maximum grade out of your Midterm grades. Your program should do the following activities: ● Create a list consist of your midterm grades. • Create a variable which keeps your school ID. ● Create a variable which keeps your name. . Create a variable which keeps your date of birth. Create a variable which calculates the average of the list. ● . The maximum grade of the list will be displayed in such a format: . You are going to use max() function in order to find the maximum grade. · You are going to find average of the list. The following output will be on the screen: My name is and my maximum midterm grade is The average of my midterm grades are_________. Do not forget to use comment tag in order to explain each line.arrow_forward
- You are working for a company that developed a new drug which increases HDL cholesterol (the good cholesterol). A variety of dosages were given to participants during a trial, and the increases of HDL cholesterol were measured. This information is summarized in the following plot: Dosage vs Increase 80 70 60 50 40 30 20 10 15 x - dosage in mg 10 20 25 30 Each point (x, y) in the above plot represents a participant who was given a dosage of æ mg and had an HDL increase of y mg/dL. This information is stored in the 2d numpy array trial_data. The r-values are stored in the first row of trial_data (i.e. trial_data[@]) and the y-values are stored in the second row of trial_data (i.e. trial_data[1]). You are now working with a physician to determine the right dosage for one of her patients. 1) In order to help your client, first find a vector B = [B1] such that y(x) = B1 + Bza is the least squares line [B2] for the above data. Store the vector B as a 1D-numpy array in beta. 2) The physician…arrow_forwardCreate a simple program for a quiz Software Requirements: Latest version of NetBeans IDE Java Development Kit (JDK) 8 Procedure: Create a folder named LastName_FirstName (ex. Dahan yoon) in your local Create a new project named LabExer5B. Set the project location to your own The program shall: contain an array of 10 multiple choice questions with three (3) choices each and require the user to choose among A, B, or C; Note: Cases are ignored. Lowercase letters are acceptable (a, b, c). Create a try-catch structure to handle three (3) exceptions. These are when the user inputs the following: an invalid letter (not A, B, or C) a number or any special character blank (no answer) Prompt the user that he can answer again if any of the three (3) exceptions is Display the score.arrow_forwardLatest version of NetBeans IDE Java Development Kit (JDK) 8 Create a folder named Dahan_yoon in your local Create a new project named LabExer5A. Set the project location to your own The program shall: generate a random number from 1 to 50 for a player to guess; display a message that indicates whether the player’s guess is correct, too low, or too high; and prompt the user to keep on guessing until the correct value is entered Create a try-catch structure that will handle two (2) exceptions. These are when the user inputs the following: a number that is out of range (1 – 50) a letter or any non-numeric character Prompt the user so that he can guess again if an exception is Display the number of total Note: An invalid input (when an exception is thrown) is not considered a valid guess or attempt.arrow_forward
- switch_player(): we will allow the players to choose their own names, but for our purposes, it is easier to think of them as number (0 and 1, for indexing purposes). We will display their names to them on the screen, but in the background, we will keep track of them based on their number. This function should take 1 argument, an integer (either 0 or 1) representing the player and should return the opposite integer (1 if 0 is entered and 0 if 1 is entered). This is a simple function, but it will make our code cleaner later. Use your constants! Using Thonnyarrow_forwardPlease provide answer in C#: Slot Machine Simulation A slot machine is a gambling device into which the user inserts money and then pulls a lever (or presses a button). The slot machine then displays a set of random images. If two or more of the images match, the user wins an amount of money that the slot machine dispenses back to the user. Create an application that simulates a slot machine. Figure 8-23 (on page 539 of your book) shows an example of how the form should look. The application should let the user enter into a TextBox the amount of money he or she is inserting into the machine. When the user clicks the Spin button, the application should display three randomly selected symbols. (Slot machines traditionally display fruit symbols. You will find a set of fruit symbols attached to this dropbox for your use - from the Student Sample Programs provided by the book author.) If none of the randomly displayed images match, the program should inform the user that he or she has won…arrow_forwardSolve it as soon as possiblearrow_forward
- Write a Java GUI application that will keep track of student results at a local college and save the process result into a database. The application must contain the result that a student has obtain for a test, assignment and exam. Question 1 On the form create a list box that will allow the user to select the student ID populate populate from the text file. Also create a search button when clicked will display the average , highest and lowest result according to the student number and a Save button to save the result to an online data base. Student number should be used as a primary key for your database. Question 2 Create a sequential file (student.txt) that contains data for the following fields The student ID number The student test result The student assignment result The student exam result Question 3 Load the data from the student.txt file and populate the list box with the student numbers Question 4 Calculate the average result obtained by the student. Question 5…arrow_forwardWrite a Java GUI application that will keep track of student results at a local college and save the process result into a database. The application must contain the result that a student has obtain for a test, assignment and exam. Question 1 On the form create a list box that will allow the user to select the student ID populate populate from the text file. Also create a search button when clicked will display the average , highest and lowest result according to the student number and a Save button to save the result to an online data base. Student number should be used as a primary key for your database. Question 2 Create a sequential file (student.txt) that contains data for the following fields The student ID number The student test result The student assignment result The student exam result Question 3 Load the data from the student.txt file and populate the list box with the student numbers Question 4 Calculate the average result obtained by the student. Question 5…arrow_forwardAverage Steps TakenA Personal Fitness Tracker is a wearable device that tracks your physical activity, caloriesburned, heart rate, sleeping patterns, and so on. One common physical activity that mostof these devices track is the number of steps you take each day.If you have downloaded this book’s source code from the Premium Companion Website,you will find a file named steps.txt in the Chapter 06 folder. (The Premium CompanionWebsite can be found at www.pearsonglobaleditions.com/gaddis.) The steps.txt filecontains the number of steps a person has taken each day for a year. There are 365 linesin the file, and each line contains the number of steps taken during a day. (The first line isthe number of steps taken on January 1st, the second line is the number of steps taken onJanuary 2nd, and so forth.) Write a program that reads the file, then displays the averagenumber of steps taken for each month. (The data is from a year that was not a leap year,so February has 28 day (in Phyton)arrow_forward
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,