1 You will create JavaScript code - embedded on an HTML file - according to the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1 You will create JavaScript code - embedded on an HTML file - according to the requirements listed on the next pages. 2 Upload and submit a single html file (.html extension) containing the code required. PROBLEM DESCRIPTION An Investment Club needs a program to generate a summary report of the investment made by its members. You are required to implement the interface required using the JavaScript programming language. A GUI screen is not required. A video of a sample run of this completed assignment is available on the assignment's webpage on Canvas. Inputs needed: ⚫ Number of Members: a numeric value (not greater than 10). The program should produce an error message and terminate if a number greater than 10 is entered. • Per member in the club: ■ Name: a string ■ Investment Amount: a numeric value Output required: A Summary Report with the following: Smallest Investment: Name and amount of the smallest investment. • Largest Investment: Name and amount of the largest investment. • Total Investment: Total Amount invested by the club as a group. • Average Investment: Average Investment per member. • Projected Growth: In % terms (a number between 0% and 100%.), generated by a random number. • Projected Earnings per Member: In $ amounts, based on the projected growth (projected growth % multiplied by investment). It should list the name and projected earnings for each member. Additional Notes: Use the prompt function to gather the inputs. The document.write function should be used heavily to generate the Summary Report. NOTE: The projected growth and earnings part of the Summary Report will produce different results each time the program runs due to the use of a random number. Requirements: Arrays: • Use two parallel arrays to hold the information related to the names and investments per member. Functions ⚫ Functions are required to: Calculate the Smallest Investment Calculate the Largest Investment Calculate the Total Investment A function is also required to generate the projected earnings per member. Tip: Use a loop to process the elements of the arrays. Page 2 of 4 SAMPLE TEST DATA and RESULTS Sample Data Inputs: Number of Members 3 Name Investment (numbers in thousands) John 20 Mary Paul 10 30 Outputs: Smallest Mary, $10 Investment: Largest Paul, $30 Investment: Total $60 Investment: Average $20 Investment: Projected 47% Growth: Projected John: $9.40 Earnings per Mary: $4.70 Member: Paul: $14.10 Sample Summary Report (the projected growth and earnings part of the report will produce different results each time the program runs): Investment Club Summary Report Report Date: Sun Oct 23 2022 18:54:45 GMT-0400 (Eastern Daylight Time) (All S numbers in thousands) Smallest Investment: Mary, $10 Largest Investment: Paul, $30 Total Investment: $60 Average Investment: $20 Projected growth: 47% Projected Earnings for John: $9.40 Projected Earnings for Mary: $4.70 Projected Earnings for Paul: $14.10 Additional Information: . Be sure to include a comment with your name and section in the <head> part of your HTML code program. • Since the content of a text box which requires a number may be used in mathematical operations, use the function Number() to ensure that the numeric input is treated as numeric data. Syntax example: x = prompt("Enter some number"); • x = Number(x); Syntax example to round up a number to 2 decimals. Just add.toFixed(2) to the variable name containing the number. Syntax example: someNumber.toFixed(2) • To simplify the comparison of text data entered by the user, it is often easier to convert this text to upper case using the notation below. Syntax example: textVariable = textVariable.toUpperCase(); To enter the date on the report use the syntax: var d= new Date(); which captures current Date/Time on the d variable. Point Values Student name inserted as comment in the head section Variable declarations and initializations Screen Flow Inputs Outputs Arrays Loops Functions IF statements Program execution References: • Recitation sessions • Lectures ⚫ Fluency textbook Chapters 17 to 20 ⚫ JavaScript Reference Guide Page 4 of 4 1 1 2 2 2 3 3 3 3 5 This page says Enter number of members 3 Cancel OK SO This page says Enter name of member John I Cancel OK This page says Enter John's investment amount 20 I Cancel OK This page says Enter name of member Mary I Cancel OK Enter Mary's investment amount 10 I Cancel OK This page says Enter name of member Paul I Cancel OK This page says Enter Paul's investment amount 30 I Cancel OK Investment Club Summary Report Report Date: Sat Oct 22 2022 17:24:11 GMT-0400 (Eastern Daylight Time) Smallest Investment: Mary, $10 Largest Investment: Paul, $30 Total Investment: $60 Average Investment: $20 Projected growth: 19% Projected Earnings for John: $3.80 Projected Earnings for Mary: $1.90 Projected Earnings for Paul: $5.70 1 You will create JavaScript code - embedded on an HTML file - according to the requirements listed on the next pages. 2 Upload and submit a single html file (.html extension) containing the code required. PROBLEM DESCRIPTION An Investment Club needs a program to generate a summary report of the investment made by its members. You are required to implement the interface required using the JavaScript programming language. A GUI screen is not required. A video of a sample run of this completed assignment is available on the assignment's webpage on Canvas. Inputs needed: ⚫ Number of Members: a numeric value (not greater than 10). The program should produce an error message and terminate if a number greater than 10 is entered. • Per member in the club: ■ Name: a string ■ Investment Amount: a numeric value Output required: A Summary Report with the following: Smallest Investment: Name and amount of the smallest investment. • Largest Investment: Name and amount of the largest investment. • Total Investment: Total Amount invested by the club as a group. • Average Investment: Average Investment per member. • Projected Growth: In % terms (a number between 0% and 100%.), generated by a random number. • Projected Earnings per Member: In $ amounts, based on the projected growth (projected growth % multiplied by investment). It should list the name and projected earnings for each member. Additional Notes: Use the prompt function to gather the inputs. The document.write function should be used heavily to generate the Summary Report. NOTE: The projected growth and earnings part of the Summary Report will produce different results each time the program runs due to the use of a random number. Requirements: Arrays: • Use two parallel arrays to hold the information related to the names and investments per member. Functions ⚫ Functions are required to: Calculate the Smallest Investment Calculate the Largest Investment Calculate the Total Investment A function is also required to generate the projected earnings per member. Tip: Use a loop to process the elements of the arrays. Page 2 of 4 SAMPLE TEST DATA and RESULTS Sample Data Inputs: Number of Members 3 Name Investment (numbers in thousands) John 20 Mary Paul 10 30 Outputs: Smallest Mary, $10 Investment: Largest Paul, $30 Investment: Total $60 Investment: Average $20 Investment: Projected 47% Growth: Projected John: $9.40 Earnings per Mary: $4.70 Member: Paul: $14.10 Sample Summary Report (the projected growth and earnings part of the report will produce different results each time the program runs): Investment Club Summary Report Report Date: Sun Oct 23 2022 18:54:45 GMT-0400 (Eastern Daylight Time) (All S numbers in thousands) Smallest Investment: Mary, $10 Largest Investment: Paul, $30 Total Investment: $60 Average Investment: $20 Projected growth: 47% Projected Earnings for John: $9.40 Projected Earnings for Mary: $4.70 Projected Earnings for Paul: $14.10 Additional Information: . Be sure to include a comment with your name and section in the <head> part of your HTML code program. • Since the content of a text box which requires a number may be used in mathematical operations, use the function Number() to ensure that the numeric input is treated as numeric data. Syntax example: x = prompt("Enter some number"); • x = Number(x); Syntax example to round up a number to 2 decimals. Just add.toFixed(2) to the variable name containing the number. Syntax example: someNumber.toFixed(2) • To simplify the comparison of text data entered by the user, it is often easier to convert this text to upper case using the notation below. Syntax example: textVariable = textVariable.toUpperCase(); To enter the date on the report use the syntax: var d= new Date(); which captures current Date/Time on the d variable. Point Values Student name inserted as comment in the head section Variable declarations and initializations Screen Flow Inputs Outputs Arrays Loops Functions IF statements Program execution References: • Recitation sessions • Lectures ⚫ Fluency textbook Chapters 17 to 20 ⚫ JavaScript Reference Guide Page 4 of 4 1 1 2 2 2 3 3 3 3 5 This page says Enter number of members 3 Cancel OK SO This page says Enter name of member John I Cancel OK This page says Enter John's investment amount 20 I Cancel OK This page says Enter name of member Mary I Cancel OK Enter Mary's investment amount 10 I Cancel OK This page says Enter name of member Paul I Cancel OK This page says Enter Paul's investment amount 30 I Cancel OK Investment Club Summary Report Report Date: Sat Oct 22 2022 17:24:11 GMT-0400 (Eastern Daylight Time) Smallest Investment: Mary, $10 Largest Investment: Paul, $30 Total Investment: $60 Average Investment: $20 Projected growth: 19% Projected Earnings for John: $3.80 Projected Earnings for Mary: $1.90 Projected Earnings for Paul: $5.70
Expert Answer:
Answer rating: 100% (QA)
Heres a basic implementation of the described functionality in JavaScript javascript Function to calculate smallest investment function calculateSmall... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
In the game of roulette, a gambler who wins the bet receives $36 for every dollar she or he bet. A gambler who does not win receives nothing. If the gambler bets $1, what is the expected value of the...
-
State whether each of the following is an example of a between-subjects, mixed, or within-subjects two-way ANOVA design. (a) A psychologist administers a small, medium, or large dose of a drug to a...
-
For each of the following enthymematic arguments: a. Formulate the plausible premise or conclusion, if any, that is missing but understood. b. Write the argument in standard form, including the...
-
Political expectations, inflation, and unemployment Consider a country with two political parties, Democrats and Republicans. Democrats care more about unemployment than Republicans, and Republicans...
-
(Three Differences, Compute Taxable Income, Entry for Taxes) Havaci Company reports pretax financial income of $80,000 for 2010. The following items cause taxable income to be different than pretax...
-
On a private flight with capacity for 150 people, $800,000 per person is charged, plus $25,000 for each unsold seat on the plane. How many people must travel on the plane and what will be the price...
-
What is process in terms of information technology and what is the connection of it to UNIX operating system?
-
Compare and contrast two concepts, theories, and/or models of group dynamics. In your comparison, assess the importance of each for overall team effectiveness. Then explain how you would apply one of...
-
In what ways might culture influence in-group and out-group dynamics in leadership? Explain.
-
Describe the career benefits of studying in a culturally diverse environment. write the paragraph using either common knowledge and / or ideas from your sources.
-
Each difference in treatment means will be compared to LSD =3.23. The sample means for the treatments were given to be x A =30, x B =45, and x C =36. Find the absolute value for each pairwise...
-
Worksheet Monroe's Motivated Sequence Instructions: Make a copy (File - Make a copy) or download (File - Download as) this worksheet Complete all parts of this worksheet (proposition, attention,...
-
In the circuit shown in Figure 1, if the voltage VDS (=VGS) and the current ID are known for two different values of VDD, the parameters Vt and K can be computed from 2 I D = K( V GS - V t ) 2 ....
-
A routine activity such as pumping gasoline can be related to many of the concepts studied in this text. Suppose that premium unleaded costs $3.75 per gal. Work Exercises in order. Use the...
-
Sophie is a single taxpayer. For the first payroll period in October 2012, she is paid wages of $3,250 monthly. Sophie claims three allowances on her Form W-4. a. Use the percentage method to...
-
Charlie's Green Lawn Care is a cash basis taxpayer. Charlie Adame, the sole proprietor, is considering delaying some of his December 2012 customer billings for lawn care into the next year. In...
-
Leslie is a single taxpayer who is under age 65 and in good health. For 2012, she has a salary of $23,000 and itemized deductions of $1,000. Leslie is entitled to one exemption on her tax return. a....
-
Show that the Lorentz group commutation relations (13.20) are satisfied by the choices \(K_{i}= \pm \frac{i}{2} \sigma_{i}\) and \(J_{i}=\frac{1}{2} \sigma_{i}\), where the \(\sigma_{i}\) are Pauli...
-
Find the relationship of the eight SU(3) operators \(T_{ \pm}, V_{ \pm}, U_{ \pm}, T_{3}\), and \(Y\) defined in Eqs. (8.2) and (8.7)-(8.8), and the nine oscillator operators \(\left(A_{i}^{j}...
-
Verify that the set of matrices (5.14) is closed under ordinary matrix multiplication. Data from Eq. 5.14 T(oc)= = 629 > - (+19) TOO) = (721) TO) = ( ). T(oa)= T(b) TO) -(11) T(4-(11) TO=(9) T(C3)= =
Study smarter with the SolutionInn App