230_Exam3_Sp_2023

pdf

School

Texas A&M University *

*We aren’t endorsed by this school

Course

230

Subject

Computer Science

Date

Dec 6, 2023

Type

pdf

Pages

4

Uploaded by KidBat3849

Report
EVEN Full Name: __________________________ Third Test Computer ID:___________________ ISEN 230 Fall 2022 Closed Book, Closed Notes except for a printed copy of the Summary sheet Academic Integrity (from the syllabus): You may not discuss exams with anyone else until after the exam is over and you know that every student you are discussing the exam with has already taken it. Instructions : 1. Log in with your netID and password 2. Open VMWare Horizon Client on your desktop 3. Double- Click on icon “coe - connectexam.engr.tamu.edu” 4. Click “Connect” and then “Accept” the disclaimer 5. Log in into the Exam Environment with your netID and password 6. Double Click “ISEN Exam Desktop” & select Excel from the available applications 7. Click on “Test Materials” and drag Excel workbook from “S: \ISEN\VirtualExam\ TestMaterials \ISEN230\ Valdez” to the Exam Environment Desktop 8. Rename file to LastNameFNI##; e.g., John Smith in computer 45 = SmithJ45 9. Open the file LastNameFNI##. Work on this file to solve your exam. If your computer freezes, you get no extra time for redoing your program so save often! 10. When finished, drag the file LastName## from the desktop to “S: \ISEN\VirtualExam\ TestSubmission \ISEN230\ Valdez” by clicking on the “Test Submission ” icon . If needed, you can copy the file to this folder multiple times by adding a letter to the end of the file; e.g., LastNameFNI##b 11. Make sure your submitted file has a size > 0 bytes. 12. Log off the Exam Environment and then log off the Computer It is extremely important that you save the file as an Excel Macro-Enabled Workbook; otherwise, you will receive no credit for any of your VBA. Please note that such actions as attempting to change your code after turning in your test, opening any other Excel file that might be stored in your computer, or attempting to view another person’s code or computer screen will be considered academic disho nesty. Note that your test grade depends on the program that you save, so, if you do not know some steps, write code for the steps you do know. Your VBA code should be written by you do not use the “Record Macro” feature to create your VBA code although you may use “Record Macro” to figure out syntax. If you think there is a typo or hardware problem, please ask about it. To most other questions, I will respond “do what you think best”. If you need to make an assumption, state your assumption and then your grade will be based on your work given that your assumption is correct as well as the appropriateness of your assumption. There will be absolutely no help in handling errors. Grading: Points will be taken off for not following instructions or for not handing in the test when the time limit has been called. (Common mistakes in not following instructions: naming convention for saved file 3 pts; saving more than one file 10 points; missing name or computer ID 3 pts.; no Option Explicit or not having your name in code after that 5 pts; more than one Module for your Subs 5pts; continuing after time has been called for the test 3 points per minute.) On my honor, I have neither given nor received unauthorized aid on this exam . I promise not to discuss this test with members of the other class until we have both finished the test. Signature:
Make sure there are three worksheets labeled “Problem1” and “Problem2” . 1. ( 25 Points 20 Minutes) The airline company Flying-High is considering the purchase of new large-, medium-, and small-size airplane passengers and the possibility of outsourcing some capacity. It is estimated that the annual profit would be $3, $2, and $1.5 million for the large-, medium- and small-size airplanes, respectively. The constraints are as follows: I. Costs: The purchase unit price is $35, $25 and $15 million for the large-, medium- and small- size airplanes, respectively. The total budget to purchase airplanes is $775 million. II. Pilots: It is predicted that the company has 35 pilots to man the new airplanes in total and each plane need two, one, and one pilot, respectively for large, medium and small planes. III. Maintenance: The maintenance facilities of the company can handle up to 41 new small-size planes. However, each medium-size plane is equivalent to 1.5 small-size planes, and each large-size plane is equivalent to 2 small-size planes in terms of their use of the maintenance facilities. IV. Min # of Planes: In order to keep its competitiveness, the company has decided that a minimum of 3 of each airplane size needs to be purchased. V. Plane Mix: The market strategy of the company is such that the number of small-size planes has to be greater than or equal to number of large-size planes. The airline company wishes to know how many planes of each size should be purchased to maximize the annual profit. The Excel setup for this problem (except for constraint V) is given in the excel worksheet “Problem1.” a). Add constraint V anywhere in the worksheet “Problem1” ; e.g., you could place it on the cells next to A13 b). Type in cell “A1” your name and place a command button on the worksheet. When this command button is clicked the Solver should be called and the optimal number of planes determined. c). Use the UserFinish parameter to ensure that the Solver dialog box does not appear. (Notice that you do not create a form for this problem; the button on the “Problem2” worksheet will execute a macro that calls the Solver.) Write your own sub in VBA (not a recorded macro) to set up and solve the linear programming problem whose objective is to find the number ( integer ) of planes of each size to purchase in cells B9 to D9 that result in the maximum annual profit in cell E4 and that satisfies some requirements as outlined in cells G5 to G7 and in B11 to D11 in worksheet “Problem1” and constraint V .
2. (75 Points 45 minutes ) When the worksheet labeled “Problem2” is activated a user form with the following controls (see pictures below) is to appear. (If you do not remember how to call a sub/form when the sheet is activated, then place a button in worksheet “Problem2” and call the sub/form when the button is clicked to get partial credit) a. the form will use an input box to ask the title (caption) of the user form ; e.g., “My Shopping List” b. a list box under the label “Grocery List” and populated with the list in the range from A2 and the last consecutive cell with data in column A in the “Problem2” worksheet with the last item in the list selected as a default assume that only one item can be selected from the list box. Your code should work with more or less data c. a list box under the label “Shopping Cart” with no elements on it – that is the list will be empty d. a CommandButton labeled “Add to Shopping Cart” , e. a CommandButton labeled “ Exit ”, f. a label with the caption “Running Total” g. a label with the total amount with currency format indicating the total amount of the items added to the shopping cart initially the total amount refers to prices from HEB. h. a CommandButton labeled “Add Grocery List Item” i. when the user clicks the “Add Grocery List Item” button, an input box will ask the user to enter the name of the new grocery item followed by an input box asking for the cost of the item (see below). j. the new grocery item will be added to the end of the “Grocery List” but not to the “Shopping Cart” list. k. the new grocery item and the corresponding cost (the cost for the new item will be the same for the three grocery stores) will also be added to the end of the list in the Problem2 worksheet so that the next time the problem is run, the added item will be part of the list of items (note: the code does not have to check whether the user enters valid data in the input boxes) l. when the user selects one item from the “Grocery List” and clicks the “Add to Shopping Cart” button, then the list of the “Shopping Cart” will be updated by adding the selected item from the “Grocery List” and the total amount will be updated (hint: use module-level array to keep totals for 3 stores) m. the user can add as many items as he/she desires and items can be in the “Shopping Cart” list more than once n. a CommandButton labeled “HEB - > Change” o. when the user clicks the “HEB - > Change” button, the label with the total amount will change to show the total amount for the next store (e.g., Kroger) and the caption on the command button will change to “Kroger - > Change” and so on. That is, from “Kro ger- >Change” will change to “WalMart - >Change” and from “WalMart - >Change” to “HEB - >Change” p. When the user clicks the “Exit” button, the form will disappear and a message box will be shown with the message “Thank you for buying these # items.” (where # will be the actual number of items in the Shopping Cart list number of items include repeats) Sample input box asking User form before adding to the shopping cart for the title of the user form
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Sample form after adding three items to the “Shopping Cart” list Sample form after clicking the “HEB - > Change” command button Sample input boxes after clicking the “Add Grocery List Item” button. Sample message box after clicking the “Exit” button.