At the top of your javascript file, create two global variables initialized to 0. These will...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
At the top of your javascript file, create two global variables initialized to 0. These will store the monthly expense total and the monthly income total. As a user adds monthly expenses and incomes these variables should be updated. DO NOT create any further global variables. Write a function named addListItem a. Parameters: Two string parameters. The first is the id of an HTML list element and the seco is the text for the new item. b. Operation: Adds the supplied text as a new list item to the list with the given id. To add an item to the list it must be a complete list item element. Add the and tags to the text before adding the item to the list. The text will already be formatted. 1. If the text was "New Item", it would become New Item " before being added to the list's innerHTML. You aren't replacing the innerHTML, you are adding something to what is already there 1. Just like you can use x += 5; you can use document.getElementByld(...).innerHTML += ...; c. Returns: Nothing d. For example, this function might be called with parameters like this addList Item("expenses", "$30 Peanut Butter") e. Use this function when adding items to the expense/income lists in the next step. Write the event handler functions that will be called for clicks of the Add Expense/Income buttons. Add the needed onclick attributes in the HTML file. They will prompt the user for the item and the amount of money. a. Parameters: None. These are event handlers. b. Operation: Use two prompts to ask the user for an item and the amount of money associated with it. Then use the addListItem() function to add the new item to the appropriate list. Adjust either the global variable for expense or income. Call the update Totals() function to display the updated values. Don't round the cost values in any way, just use it as entered 1. So if they enter 1.3333, you'll see 1.3333 on the webpage c. Returns: Nothing Write a function named update Totals a. Parameters: None. The global variables store the information it needs b. Operation: The two global variables store the total monthly income and total monthly expenses Calculate the annual total (12 * (income - expenses)) and display the three values in the three appropriate elements on the webpage. This is the only function that should change the totals displayed on the webpage. Don't round the total values in any way, just use them directly c. Returns: Nothing d. This function will be used after an item has been added to one of the lists in the event handler functions. I Initial Screenshot Assignment 2: Budget Matters file:///D/My Drive SendChrisJunkHere/ 150% Assignment 2: Budget Matters Annual Budget Every month I spend $0 Every month I make $0 Annual Total: $0 Add Expense Item Add Income Item Final Screenshot (Don't worry if you get extra decimal places, but the value is basically correct) Assignment 2: Budget Matters III\ Assignment 2: Budget Matters Annual Budget Every month I spend $27.5 file:///D:/My Drive SendChrisJunkHere/La 120% $10: Peanut Butter $12.5: Strawberry Jam $5: Bread Every month I make $25.42 $25: Allowance $0.42: Change From Couch Annual Total: $-24.95999999999998 Add Expense Item Add Income Item Submission At the top of your javascript file, create two global variables initialized to 0. These will store the monthly expense total and the monthly income total. As a user adds monthly expenses and incomes these variables should be updated. DO NOT create any further global variables. Write a function named addListItem a. Parameters: Two string parameters. The first is the id of an HTML list element and the seco is the text for the new item. b. Operation: Adds the supplied text as a new list item to the list with the given id. To add an item to the list it must be a complete list item element. Add the and tags to the text before adding the item to the list. The text will already be formatted. 1. If the text was "New Item", it would become New Item " before being added to the list's innerHTML. You aren't replacing the innerHTML, you are adding something to what is already there 1. Just like you can use x += 5; you can use document.getElementByld(...).innerHTML += ...; c. Returns: Nothing d. For example, this function might be called with parameters like this addList Item("expenses", "$30 Peanut Butter") e. Use this function when adding items to the expense/income lists in the next step. Write the event handler functions that will be called for clicks of the Add Expense/Income buttons. Add the needed onclick attributes in the HTML file. They will prompt the user for the item and the amount of money. a. Parameters: None. These are event handlers. b. Operation: Use two prompts to ask the user for an item and the amount of money associated with it. Then use the addListItem() function to add the new item to the appropriate list. Adjust either the global variable for expense or income. Call the update Totals() function to display the updated values. Don't round the cost values in any way, just use it as entered 1. So if they enter 1.3333, you'll see 1.3333 on the webpage c. Returns: Nothing Write a function named update Totals a. Parameters: None. The global variables store the information it needs b. Operation: The two global variables store the total monthly income and total monthly expenses Calculate the annual total (12 * (income - expenses)) and display the three values in the three appropriate elements on the webpage. This is the only function that should change the totals displayed on the webpage. Don't round the total values in any way, just use them directly c. Returns: Nothing d. This function will be used after an item has been added to one of the lists in the event handler functions. I Initial Screenshot Assignment 2: Budget Matters file:///D/My Drive SendChrisJunkHere/ 150% Assignment 2: Budget Matters Annual Budget Every month I spend $0 Every month I make $0 Annual Total: $0 Add Expense Item Add Income Item Final Screenshot (Don't worry if you get extra decimal places, but the value is basically correct) Assignment 2: Budget Matters III\ Assignment 2: Budget Matters Annual Budget Every month I spend $27.5 file:///D:/My Drive SendChrisJunkHere/La 120% $10: Peanut Butter $12.5: Strawberry Jam $5: Bread Every month I make $25.42 $25: Allowance $0.42: Change From Couch Annual Total: $-24.95999999999998 Add Expense Item Add Income Item Submission
Expert Answer:
Related Book For
Accounting
ISBN: 978-0324401844
22nd Edition
Authors: Carl S. Warren, James M. Reeve, Jonathan E. Duchac
Posted Date:
Students also viewed these algorithms questions
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Example Problem for Declining Balance Depreciation Methods Historical cost of equipment A: $120,000, purchased on January 1, 2014. Estimated salvage value: $20,000; Estimated useful life: 5 years....
-
Is the buoyant force on a submerged object equal to the weight of the object itself or equal to the weight of the fluid displaced by the object?
-
A true rms voltmeter (assumed noiseless) with an effective noise bandwidth of 30 MHz is used to measure the noise voltage produced by the following devices. Calculate the meter reading in each case....
-
Consider the problem of separation, by ordinary distillation, of propane, A; isobutane, B; \(n\)-butane, \(\mathrm{C}\); isopentane, \(\mathrm{D}\); and \(n\)-pentane, \(\mathrm{E}\). Using the...
-
Sweeten Company had no jobs in progress at the beginning of March and no beginning inventories. The company has two manufacturing departmentsMolding and Fabrication. It started, completed, and sold...
-
Provide evidence that psychobiology has been a persistent theme throughout psychology's history. What is cognitive science? Discuss the steps taken by APA through the years to reduce the tension...
-
The following selected accounts and their current balances appear in the ledger of Druid Hills Co. for the fiscal year ended May 31, 20Y8: Cash .......................................... $ 290,800...
-
Foley Ltd. manufactures and sells snack bars. Sales of its top selling Double Bar have been steadily increasing but the company is not sure that profits have been growing at the same rate. The...
-
Smokey and the Bandit produces outdoor activity clothing. The product line consists of pants, jackets, tops, and accessories. Data has been collected related to direct materials and direct labor for...
-
A 0.600m long pendulum is used to determine the acceleration due to gravity on a distant planet. If 20 complete oscillations are found to require 35.5s, what is the acceleration?
-
Capital, January 1 Additional investment Drawings Net income The Partners' Capital Statement for JSB Company reported the following information in total: $233000 79500 150000 207000 The partners...
-
A 16.0 kg solid bowling ball is started from rest at the top of a 37.3 incline. If the incline is 6.5 m long, how fast will the ball be rolling when it reaches the bottom.
-
2. If the charge-to-mass ratio of a proton is 9.58x10 7 coulomb/kilogram and the charge is 1.60x10 -9 coulomb, what is the mass of the proton.
-
Perform a test to determine if it converge or diverge 2sin-1 dx 1 - x
-
The following selected accounts and normal balances existed at year-end. Notice that expenses exceed revenue in this period. Make the four journal entries required to close the books: Accounts...
-
A company reports the following: Income before income tax . $375,000 Interest expense ....... 120,000 Determine the number of times interest charges are earned.
-
After the amount due on a sale of $18,500, terms 2/10, n/eom, is received from a customer within the discount period, the seller consents to the return of the entire shipment. The cost of the...
-
Taylor Company estimates that total factory overhead costs will be $250,000 for the year. Direct labor hours are estimated to be 50,000. For Taylor Company, (a) Determine the predetermined factory...
-
The length of a straight solenoid is \(50 \mathrm{~cm}\). If a current of 12 A flows through the solenoid produces a magnetic field of magnitude \(0.06 \mathrm{~T}\) inside it, calculate the number...
-
Two parallel rods having length \(12 \mathrm{~cm}\) and a separation of \(50 \mathrm{~cm}\) carry current from left to right. If current through wire 1 is \(10 \mathrm{~A}\) and through wire 2 is...
-
A wire segment of \(1.0 \mathrm{~m}\) and carrying a current of \(5.0 \mathrm{~A}\) is held in a plane in which it can rotate and translate with little friction. A long wire is fixed parallel to this...
Study smarter with the SolutionInn App