Description
please write a c++ program using visual studio. I have attached the homework instructions below with a program that is somewhat similar to the homework we are doing.
Unformatted Attachment Preview
number to its cube.
Final Exam Program:
This program should calculate package shipping costs. The shipping company has the following discount
percentages:
Shipping Costs
Discount %
$300 or less
$300.01 to $600
$600.01 to $1000
$1000.01 or more
1.9%
2.6%
2.9%
3.4%
Package Types Shipping Costs
1. Video Games: Cost is number of video games * $19.99 per video game. For optional overnight delivery,
add $4.99. Optional insurance is 6% of the cost.
2. Genius Phones: Cost is number of genius phones * $799.99 per genius phone. For optional overnight
delivery, add $25.00. If a genius phone case is needed, add $24.99 per genius phone. The number of
genius phones requiring the genius phone case should be passed to the appropriate method. Optional
insurance is 11% of the cost.
3. Hamburgers: Cost is number of hamburgers * $7.99 per hamburger. For optional overnight delivery, add
$9.00. If condiments are needed, add $1.79 per hamburger for the condiments. If hamburger buns are to
be ordered, an additional charge of $1.89 per hamburger is required. Optional insurance is 3% of the cost
.
4. A Package Type of your choice: Please include documentation (comment statements) stating how the
costs should be calculated for your package type
For each package type, print out the name, address, city, state, and zip code for the customer. In addition,
print out the date the package is expected to arrive along with the total cost with how the calculation was done,
the discount percentage, the discount amount, and the total cost after the discount is subtracted off. Please
make sure to include output for each of the four package types.
Your program should use virtual functions including at least one pure virtual function with polymorphism.
Your program should have one class for each package type along with a base-class that contains the
appropriate data members and methods. An
example of sample output for video games could be:
Expected Arrival Date: 8-25-2018
Customer: Joe Blow
1234 Main Street
Irvine, CA 92618
4 video games ordered: shipping cost is $79.96, overnight delivery is $4.99, no insurance specified
Total Cost is $84.95
Discount Percentage is 1.9% for a discount of $1.61
Total Cost after discount is $83.34
Purchase answer to see full attachment
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Explanation & Answer
Review
Review
Anonymous
Great! 10/10 would recommend using Studypool to help you study.
Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Most Popular Content
University of California San Diego Loop Code Block Java Project
Please make sure to submit the assessment with all of your code written below Question #9 in the Final Code Section. The c ...
University of California San Diego Loop Code Block Java Project
Please make sure to submit the assessment with all of your code written below Question #9 in the Final Code Section. The code should be able to be copied and pasted into a program and then run without any changes being made to its format or syntax. //1. Declare a variable named "counter" and assign it an initial value of 10.
//2. Next, declare another new variable named "numbers" and assign it the initial value of an empty array.
//3. Now, declare a for loop and configure it so that it runs a total of ten times. Within the loop's code block, increment the "counter" variable by 73, and push the new value of the "counter" variable into the "numbers" array.
//4. Below the code for your for loop, console log out the "numbers" array to the console.
//5. Next, create a conditional statement which checks if the value of the "counter" variable is greater than 740. If the value is greater than 740, console log the string "Maximum array number exceeded", if the value is not greater than 740, console log the string "Array values within specification".
//6. Now, declare a new variable named "stats". Assign it the value of an empty object literal.
// Now that you have completed creating the arguments which will be passed into the function, it is time to create the function!
//7a. Declare a function named "getStats".
//7b. Declare two parameters for the "getStats" function, "statsObj" (which will receive an object as an argument), and "numbersArr" (which will receive an array as an argument).
// Within the "getStats" function's code block, create the following functionality:
//7c. Use a for loop to find the largest number in the "numberArr" parameter, and then assign that number to a new property on the "statsObj" parameter named "largestNum". Do not use the "Math" object, or any JavaScript function to find the largest number.
//7d. Use a while loop to sum all of the numbers in the "numbersArr" parameter, and store that sum in a variable named "arrTotal". Do not use the "Math" object, or any JavaScript function to sum the numbers in the array.
//7e. Divide the value you stored in "arrTotal" by the total number of elements in "numbersArr" to get the average of all numbers in the "numbersArr" and assign that value into a variable named "arrAverage". Then, assign the value stored in the "arrAverage" variable to a property on the "statsObj" parameter named "averageNum".
//7f. Lastly, return the "statsObj" parameter from the function.
// Outside of the "getStats" function, complete the final steps below:
//8. Call the "getStats" function and pass in the "stats" object and "numbers" array you created in steps 1 - 6 as arguments. Store the object which is returned from the "getStats" function into a variable named "returnedStats".
//9. Finally, concatenate the values stored in the "returnedStats" object into appropriate places the following string "The largest number was ### and the average of all the numbers was ###" and console log the completed string to the console.
Putting It All Together C Program that Reads Assignment Grades Code
Program Assignment
Write a C++ program that reads assignment grades (integer values between 0 and 100) taken over TWO year ...
Putting It All Together C Program that Reads Assignment Grades Code
Program Assignment
Write a C++ program that reads assignment grades (integer values between 0 and 100) taken over TWO years and then displays statistics about this data in a formatted table.
Study the tests below to help you understand program behavior. Use the following tests and your own tests to run against your solution in Develop mode. These are the same tests that your solution will be executed against when you submit your work in Submit mode. User input is in bold:
Sample Runs (Program Behavior)
Assume the user will only enter grades between 0 and 100.
Assume the user will correctly enter the specified number of grades for a year.
User in put is in bold:
Test 1
> run
Enter # of grades during year 1: 0
Enter at least one but no more than 15 grades. Try again.
Enter # of grades during year 1: -5
Enter at least one but no more than 15 grades. Try again.
Enter # of grades during year 1: 1
Enter the 1 grade(s): 85
Enter # of grades during year 2: -5
Enter at least one but no more than 15 grades. Try again.
Enter # of grades during year 2: 0
Enter at least one but no more than 15 grades. Try again.
Enter # of grades during year 2: 1
Enter the 1 grade(s): 75
Year Avg Stddev Grades
----------------------------
1 85.0 0.00 { 85 }
No outliers
2 75.0 0.00 { 75 }
No outliers
The first year had the highest grade of 85.
The first year's lowest grade is 85.
The second year's lowest grade is 75.
Test 2
> run
Enter # of grades during year 1: 1
Enter the 1 grade(s): 62
Enter # of grades during year 2: 1
Enter the 1 grade(s): 100
Year Avg Stddev Grades
----------------------------
1 62.0 0.00 { 62 }
No outliers
2 100.0 0.00 { 100 }
No outliers
The second year had the highest grade of 100.
The first year's lowest grade is 62.
The second year's lowest grade is 100.
Test 3
> run
Enter # of grades during year 1: 1
Enter the 1 grade(s): 88
Enter # of grades during year 2: 1
Enter the 1 grade(s): 88
Year Avg Stddev Grades
----------------------------
1 88.0 0.00 { 88 }
No outliers
2 88.0 0.00 { 88 }
No outliers
Both years had the highest grade of 88.
The first year's lowest grade is 88.
The second year's lowest grade is 88.
Test 4
> run
Enter # of grades during year 1: 2
Enter the 2 grade(s): 0 100
Enter # of grades during year 2: 1
Enter the 1 grade(s): 50
Year Avg Stddev Grades
----------------------------
1 50.0 50.00 { 0, 100 }
No outliers
2 50.0 0.00 { 50 }
No outliers
The first year had the highest grade of 100.
The first year's lowest grade is 0.
The second year's lowest grade is 50.
Test 5
> run
Enter # of grades during year 1: 2
Enter the 2 grade(s): 76 64
Enter # of grades during year 2: 2
Enter the 2 grade(s): 94 83
Year Avg Stddev Grades
----------------------------
1 70.0 6.00 { 76, 64 }
No outliers
2 88.5 5.50 { 94, 83 }
No outliers
The second year had the highest grade of 94.
The first year's lowest grade is 64.
The second year's lowest grade is 83.
Test 6
> run
Enter # of grades during year 1: 2
Enter the 2 grade(s): 90 67
Enter # of grades during year 2: 2
Enter the 2 grade(s): 68 90
Year Avg Stddev Grades
----------------------------
1 78.5 11.50 { 90, 67 }
No outliers
2 79.0 11.00 { 68, 90 }
No outliers
Both years had the highest grade of 90.
The first year's lowest grade is 67.
The second year's lowest grade is 68.
Test 7
> run
Enter # of grades during year 1: 2
Enter the 2 grade(s): 65 65
Enter # of grades during year 2: 1
Enter the 1 grade(s): 75
Year Avg Stddev Grades
----------------------------
1 65.0 0.00 { 65, 65 }
No outliers
2 75.0 0.00 { 75 }
No outliers
The second year had the highest grade of 75.
The first year's lowest grade is 65.
The second year's lowest grade is 75.
Test 8
> run
Enter # of grades during year 1: 2
Enter the 2 grade(s): 45 60
Enter # of grades during year 2: 2
Enter the 2 grade(s): 60 50
Year Avg Stddev Grades
----------------------------
1 52.5 7.50 { 45, 60 }
No outliers
2 55.0 5.00 { 60, 50 }
No outliers
Both years had the highest grade of 60.
The first year's lowest grade is 45.
The second year's lowest grade is 50.
Test 9
> run
Enter # of grades during year 1: 1
Enter the 1 grade(s): 67
Enter # of grades during year 2: 2
Enter the 2 grade(s): 45 70
Year Avg Stddev Grades
----------------------------
1 67.0 0.00 { 67 }
No outliers
2 57.5 12.50 { 45, 70 }
No outliers
The second year had the highest grade of 70.
The first year's lowest grade is 67.
The second year's lowest grade is 45.
Test 10
> run
Enter # of grades during year 1: 4
Enter the 4 grade(s): 45 46 45 55
Enter # of grades during year 2: 3
Enter the 3 grade(s): 60 47 17
Year Avg Stddev Grades
----------------------------
1 47.8 4.21 { 45, 46, 45, 55 }
Outliers: < 55 >
2 41.3 18.01 { 60, 47, 17 }
Outliers: < 60, 17 >
The second year had the highest grade of 60.
The first year's lowest grade is 45.
The second year's lowest grade is 17.
Test 11
> run
Enter # of grades during year 1: 5
Enter the 5 grade(s): 17 43 30 47 60
Enter # of grades during year 2: 7
Enter the 7 grade(s): 56 75 66 65 66 98 45
Year Avg Stddev Grades
----------------------------
1 39.4 14.73 { 17, 43, 30, 47, 60 }
Outliers: < 17, 60 >
2 67.3 15.29 { 56, 75, 66, 65, 66, 98, 45 }
Outliers: < 98, 45 >
The second year had the highest grade of 98.
The first year's lowest grade is 17.
The second year's lowest grade is 45.
Test 12
> run
Enter # of grades during year 1: 9
Enter the 9 grade(s): 45 46 45 43 40 44 42 65 42
Enter # of grades during year 2: 10
Enter the 10 grade(s): 76 75 60 79 75 74 73 80 90 75
Year Avg Stddev Grades
----------------------------
1 45.8 7.02 { 45, 46, 45, 43, 40, 44, 42, 65, 42 }
Outliers: < 65 >
2 75.7 7.01 { 76, 75, 60, 79, 75, 74, 73, 80, 90, 75 }
Outliers: < 60, 90 >
The second year had the highest grade of 90.
The first year's lowest grade is 40.
The second year's lowest grade is 60.
Test 13
> run
Enter # of grades during year 1: 10
Enter the 10 grade(s): 76 75 60 79 75 74 73 80 90 75
Enter # of grades during year 2: 9
Enter the 9 grade(s): 45 46 45 43 40 44 42 65 42
Year Avg Stddev Grades
----------------------------
1 75.7 7.01 { 76, 75, 60, 79, 75, 74, 73, 80, 90, 75 }
Outliers: < 60, 90 >
2 45.8 7.02 { 45, 46, 45, 43, 40, 44, 42, 65, 42 }
Outliers: < 65 >
The first year had the highest grade of 90.
The first year's lowest grade is 60.
The second year's lowest grade is 40.
Test 14
> run
Enter # of grades during year 1: 10
Enter the 10 grade(s): 45 46 45 43 40 44 42 65 42 90
Enter # of grades during year 2: 10
Enter the 10 grade(s): 76 75 40 79 75 74 73 80 90 75
Year Avg Stddev Grades
----------------------------
1 50.2 14.84 { 45, 46, 45, 43, 40, 44, 42, 65, 42, 90 }
Outliers: < 90 >
2 73.7 12.17 { 76, 75, 40, 79, 75, 74, 73, 80, 90, 75 }
Outliers: < 40, 90 >
Both years had the highest grade of 90.
The first year's lowest grade is 40.
The second year's lowest grade is 40.
Write a C++ program that reads assignment grades taken over TWO years and then displays statistics about this data in a formatted table.
Your solution will be graded based upon program behavior (passing tests). Your solution will not receive full credit (or receives no credit) if you fail to follow these restrictions:
Your program must compile and run. Otherwise it will receive a zero.
Add your solution to the provided code template.
Only use C++ statements presented in the lecture notes and assigned readings.
Only use course material up to passing arrays.
Do not use explicitly defined pointer variables, i.e. using the * notation.
Do not use vectors.
Use descriptive variable names. Avoid too short variable names, especially single letter variable names.
DO NOT start a variable name with a capital letter. Use the name convention for constants given in the lecture notes.
If you define your own function name, make sure it is a descriptive name.
Properly use const, pass-by-value, and pass-by-reference when defining function parameters.
Properly choose between using the while vs the for statement.
DO NOT use the do-while loop.
Avoid repetitive code where possible.
DO NOT use explicit type casting. Instead use coercion (see lecture notes).
DO NOT unnecessarily use parenthesis in an expression, e.g. an equation or formula. Parenthesis should only be used for grouping portions of an expression to change operator precedence order. For example, parenthesis are unnecessary in the expression (a + b + c). Instead use a + b + c. Parenthesis are necessary in the expression (a + b + c) / 3.
Do NOT use the break and continue statements.
Your program must be readable including indenting, spaces, and avoid lines that are too long. Use the the sample programs in the lecture notes as a guide.
Comment your program. Read the document at the "Lecture" link on Carmen under Modules->Commenting Your Program-> Commenting your program. DO NOT comment every line.
Only use C++ statements presented in the course. I.e. statements and notation presented in the lecture notes and assigned readings.
You will implement the main function and a collection of functions. DO NOT delete nor change the code already given to you in the code template. You will add your code to this template to formulate your solution.
TASK 1: Replace "??" with your name, creation date, and a description of the program (synopsis).
TASK 2: Declare a GLOBAL constant to hold the integer 15, which will represent the maximum number of grades the user can record for one year.
TASK 3: Implement the following algorithm in the main function:
i. Declare your variables. Use the global constant (see TASK 2 above) to allocate TWO arrays, where each array holds the grades for a single year. Use fixed memory allocation.
ii. Read the grades for each year (there are two years). Call the function described in TASK 4, step 6. You will call this function twice, i.e. once for each day.
iii. Output an empty line.
iv. Display the headings for the formatted table. Call the procedure in TASK 4, step 7.
v. Display the statistics for each of the two years. Call the procedure in TASK 4, step 8. You will call this function twice, i.e. once for each year.
vi. Display the highest and lowest grades from the grade data in both days. Call the procedure in TASK 4, step 9.
TASK 4: Define the following functions and helper functions. Remember, a procedure is a function with no return value. In order to receive full credit, closely follow the provided instructions below. You must determine when to use const and pass by value vs. pass by reference. If you are not sure, then please study the lecture slides and notes.
Important: You will write eight functions as specified below. Choose descriptive function and variable names.
Place function prototypes BEFORE the main procedure.
Place function definitions AFTER the main procedure.
Each function should have a comment (placed above the function definition) that describes the function's task.
Include in this comment a short description of each input parameter.
Write a function to read from the user the grades for one year. Use the global constant (see TASK 2 above) in this function. The function has two input parameters: 1) an array to hold the grades for this year and 2) the year these grades belong to (either 1 or 2 for year 1 or year 2). The function returns the number of grades entered by the user. Prompt the user for the number of grades to read, say n, which must be at least 1 but no more than 15 (The value of the global constant). If invalid input is entered, then display a warning message and repeatedly ask the user again. See the provided test cases for the exact prompt and warning messages to use. Finally, read the n grades from the user.
Assume the user will enter exactly n grades.
Assume the user will only enter integer grades in the range 0 to 100. I.e., you DO NOT have to check for valid input here.
Write a procedure to display the first two lines of the output table containing the column names and dashed line. Use iomanip functions to attain the correct spacing. This procedure has no input parameters. Remember, a procedure is a function that does not return a value.
Write a procedure that computes the statistics (average, min, max, standard deviation) of a list of grades and then prints these statistics in the formatted table. This procedure has five input parameters: 1) which year (year 1 or year 2), 2) an array of grades, 3) the number of grades in the array, 4) the minimum grade found, and 5) the maximum grade found. Here is a link to a Wikipedia page that defines the standard deviation ( https://en.wikipedia.org/wiki/Standard_deviation ). Examples of how to calculate the standard deviation can be found here ( https://www.mathsisfun.com/data/standard-deviation.html ). Use fixed mode to display decimal values. The average is displayed with one digit after the decimal place. The standard deviation is displayed with two digits after the decimal place. Use iomanip functions to achieve proper spacing (see the provided test case output). This procedure MUST call these four "helper" functions whose descriptions are provided below:
(a) Write a procedure to compute the average (i.e., mean), minimum, and maximum grades. This procedure has five input parameters: 1) an array of grades, 2) the number of grades in the array, 3) the average computed by this procedure, 4) the minimum grade computed by this procedure, and 5) the maximum grade computed by this procedure.
(b) Write a function to compute the standard deviation and the number of (how many) "outliers". An "outlier" is a grade that is more than one standard deviation away from the average grade. The function has four input parameter: 1) an array of grades, 2) the number of grades in the array, 3) the average of the grades, and 4) the number of "outliers" computed by this function. The return value is the standard deviation computed by this function.
(c) Write a procedure to output the sampled grades in a comma separated list delimited by curly braces. This procedure has two input parameters: 1) an array of grades and 2) the number of grades in the array. Use an endl after the closing curly braces.
(d) Write a procedure to output the "outliers" as a comma separated list delimited by angle brackets, i.e. "< … >". If there are no "outliers" then output "No outliers". The procedure has five input parameters: 1) an array of grades, 2) the number of grades in the array, 3) the average of the grades, 4) the standard deviation of the grades, and 5) the number of "outliers". Use an endl at the end of the output.
Write a procedure to output the highest grade across the two years and the lowest grades for both years. The procedure has four input parameters: 1) the lowest grade in year 1, 2) the highest grade on year 1, 3) the lowest grade on year 2, and 4) the highest grade on year 2. Use an endl at the end of the output.
Be sure that there is a comment documenting each variable.
Be sure that your if statements, for and while loops and blocks are properly indented.
Test your solution.
write a method call need help!
write a method that called smallestLargest that accepts a Scanner for the console as a parameter and ask the user to ent ...
write a method call need help!
write a method that called smallestLargest that accepts a Scanner for the console as a parameter and ask the user to enter numbers, then prints the smallest and the largest of all the numbers supplied by the user. you may assume that the user enters a valid number greater than 0 for the number of numbers to read please return the answer in a simple introduction level to programming principles need to be basic nothing too complex.
Dashboard Data Visualization
PromptYou have been asked to create a data table on the dashboard which shows an unfiltered view of the Austin Animal Cent ...
Dashboard Data Visualization
PromptYou have been asked to create a data table on the dashboard which shows an unfiltered view of the Austin Animal Center Outcomes data set. You have also been asked to add a geolocation chart to the dashboard, which will help the client visualize the data. For more details about the dash components for data tables and the geolocation chart, refer to the Module Six resources.Open the ModuleSixMilestone.ipynb file, which contains the starter code for the Grazioso Salvare dashboard. Upload this file into Apporto and open it using the Jupyter Notebook application. Be sure to review all of the starter code that you have been given. Pay special attention to the import commands and the comments describing what each section of code does.Update the code to create an interactive data table on the dashboard which shows an unfiltered view of the Austin Animal Center Outcomes data set. To populate the data onto your table, you will utilize your previous CRUD Python module, from Project One, to run a “retrieve all” query and bring in the data from MongoDB. This data retrieval will serve to access the “model” portion of your MVC pattern: the MongoDB database. Be sure to hardcode in the username and password for the “aacuser” account.Note: It may take a few minutes for the data table to fully render and display, depending on the speed of your internet connection.Tip: Be sure to consider your client when creating the interactive data table. Consider optional features that will make the table easier to use, such as limiting the number of rows displayed, enabling pagination (advanced), enabling sorting, and so on. Review the Module Six resources on data tables to help you select and set up these features.Add a geolocation chart that displays data from the interactive data table to your existing dashboard.You are being given the function that sets up accessing the data for the geolocation chart and calls the Leaflet function: update_map:def update_map(viewData):
dff = pd.DataFrame.from_dict(viewData)
# Austin TX is at [30.75,-97.48]
return [
dl.Map(style={'width': '1000px', 'height': '500px'}, center=[30.75,-97.48], zoom=10, children=[
dl.TileLayer(id="base-layer-id"),
# Marker with tool tip and popup
dl.Marker(position=[30.75,-97.48], children=[
dl.Tooltip(dff.iloc[0,4]),
dl.Popup([
html.H1("Animal Name"),
html.P(dff.iloc[1,9])
])
])
])
]
You will need to structure this function into your dashboard code by putting the correct statements in the layout. These statements are important so that your layout has a place for the geolocation chart. Here is an example statement:html.Div(
id='map-id',
className='col s12 m6',
)
You will also need to add in the correct callback routines for the geolocation chart. These will look similar to the callback routines used for user authentication and your data table. Here is an example callback routine:@app.callback(
Output('map-id', "children"),
[Input('datatable-id', "derived_viewport_data")])
Note: The Leaflet geolocation chart will show the first row of the data table by default. As long as your chart shows the location of the dog in the first row, that is sufficient for checking that your geolocation chart is set up correctly.Finally, run the IPYNB file and take a screenshot of your dashboard as proof of this execution. Your screenshot should include 1) the interactive data table populated with the Austin Animal Center Outcomes data from MongoDB and 2) your geolocation chart showing the location of the first dog in the table. Additionally, your unique identifier (created in the Module Five assignment) should also be visible in the screenshot.Requirements: No words limit/ pythonAll tutors provide: high quality help, quick responsive communication, original explanations and answers with any outside resources cited.
Pennsylvania State University Network Diagram for A Small Company Project
Create a Network DiagramYour network diagram needs to include the following elements:An Internet Service Provider Network ...
Pennsylvania State University Network Diagram for A Small Company Project
Create a Network DiagramYour network diagram needs to include the following elements:An Internet Service Provider Network (represented as a cloud)Router with enough ports to meet the needs of the organizationA switch for each floor – you will need to identify how many ports each switch on each floor needs to haveYou DO NOT need to show every single computer on your diagram. However, you need to show groups of computers, plus their use. So, if there are 5 people in the same department, you can show all 5 computers with one icon/glyph and label it appropriately.Each grouping of computers needs to have the IP Address range documented on the diagram. Assign the x.x.x.1 address of each network to the appropriate port on the router.Network DocumentationYour network design document needs to explain each element of the network. Each Layer two (switch) and Layer three (Router) device needs to be described in terms of number of ports. The number of computers for each department and floor also needs to be documented. The IP address ranges need to be explained – including the IP Address range that you assigned, the number of IP Addresses that the subnetwork will use, and the number of IP addresses that remain unused in that subnet.
11 pages
Data Distribution
Identify if the following random variables are discrete or continuous. Height of males (in mm) who attend Grand Canyon Uni ...
Data Distribution
Identify if the following random variables are discrete or continuous. Height of males (in mm) who attend Grand Canyon University-Continuous variable.
Similar Content
EE 420 YU Problems on Linearity & Superposition Electrical Engineering MATLAB
need help in answering questions 1-3. Read each question carefully then send me the answers. question 1 part C requires MA...
San Jose State University CS Data Structures Java Program Project
Make your programs modular. Document your program i.e., include comments in your code. Write a Java program to: Read 50 in...
Temple University Common Lisp Function Code Project
1.Write a Common Lisp function named myList which creates the following list
and returns it
(4 (7 22) "art" ("math" (8) ...
numerical methods , programming homework help
I need question 10.11 to be done ...
DAT 561 Smart Logistic Warehouse System in Walmart Project
DAT561: Midterm Project:
Smart Logistic Warehouse System in Walmart
Walmart Inc. is an American multinational retail corpo...
University of New Haven Python Program Exercise Paper
Background information:The input file for this assignment, weather.csv, is described here.Assignment:Using weather.py (ren...
Related Tags
Book Guides
Get 24/7
Homework help
Our tutors provide high quality explanations & answers.
Post question
Most Popular Content
University of California San Diego Loop Code Block Java Project
Please make sure to submit the assessment with all of your code written below Question #9 in the Final Code Section. The c ...
University of California San Diego Loop Code Block Java Project
Please make sure to submit the assessment with all of your code written below Question #9 in the Final Code Section. The code should be able to be copied and pasted into a program and then run without any changes being made to its format or syntax. //1. Declare a variable named "counter" and assign it an initial value of 10.
//2. Next, declare another new variable named "numbers" and assign it the initial value of an empty array.
//3. Now, declare a for loop and configure it so that it runs a total of ten times. Within the loop's code block, increment the "counter" variable by 73, and push the new value of the "counter" variable into the "numbers" array.
//4. Below the code for your for loop, console log out the "numbers" array to the console.
//5. Next, create a conditional statement which checks if the value of the "counter" variable is greater than 740. If the value is greater than 740, console log the string "Maximum array number exceeded", if the value is not greater than 740, console log the string "Array values within specification".
//6. Now, declare a new variable named "stats". Assign it the value of an empty object literal.
// Now that you have completed creating the arguments which will be passed into the function, it is time to create the function!
//7a. Declare a function named "getStats".
//7b. Declare two parameters for the "getStats" function, "statsObj" (which will receive an object as an argument), and "numbersArr" (which will receive an array as an argument).
// Within the "getStats" function's code block, create the following functionality:
//7c. Use a for loop to find the largest number in the "numberArr" parameter, and then assign that number to a new property on the "statsObj" parameter named "largestNum". Do not use the "Math" object, or any JavaScript function to find the largest number.
//7d. Use a while loop to sum all of the numbers in the "numbersArr" parameter, and store that sum in a variable named "arrTotal". Do not use the "Math" object, or any JavaScript function to sum the numbers in the array.
//7e. Divide the value you stored in "arrTotal" by the total number of elements in "numbersArr" to get the average of all numbers in the "numbersArr" and assign that value into a variable named "arrAverage". Then, assign the value stored in the "arrAverage" variable to a property on the "statsObj" parameter named "averageNum".
//7f. Lastly, return the "statsObj" parameter from the function.
// Outside of the "getStats" function, complete the final steps below:
//8. Call the "getStats" function and pass in the "stats" object and "numbers" array you created in steps 1 - 6 as arguments. Store the object which is returned from the "getStats" function into a variable named "returnedStats".
//9. Finally, concatenate the values stored in the "returnedStats" object into appropriate places the following string "The largest number was ### and the average of all the numbers was ###" and console log the completed string to the console.
Putting It All Together C Program that Reads Assignment Grades Code
Program Assignment
Write a C++ program that reads assignment grades (integer values between 0 and 100) taken over TWO year ...
Putting It All Together C Program that Reads Assignment Grades Code
Program Assignment
Write a C++ program that reads assignment grades (integer values between 0 and 100) taken over TWO years and then displays statistics about this data in a formatted table.
Study the tests below to help you understand program behavior. Use the following tests and your own tests to run against your solution in Develop mode. These are the same tests that your solution will be executed against when you submit your work in Submit mode. User input is in bold:
Sample Runs (Program Behavior)
Assume the user will only enter grades between 0 and 100.
Assume the user will correctly enter the specified number of grades for a year.
User in put is in bold:
Test 1
> run
Enter # of grades during year 1: 0
Enter at least one but no more than 15 grades. Try again.
Enter # of grades during year 1: -5
Enter at least one but no more than 15 grades. Try again.
Enter # of grades during year 1: 1
Enter the 1 grade(s): 85
Enter # of grades during year 2: -5
Enter at least one but no more than 15 grades. Try again.
Enter # of grades during year 2: 0
Enter at least one but no more than 15 grades. Try again.
Enter # of grades during year 2: 1
Enter the 1 grade(s): 75
Year Avg Stddev Grades
----------------------------
1 85.0 0.00 { 85 }
No outliers
2 75.0 0.00 { 75 }
No outliers
The first year had the highest grade of 85.
The first year's lowest grade is 85.
The second year's lowest grade is 75.
Test 2
> run
Enter # of grades during year 1: 1
Enter the 1 grade(s): 62
Enter # of grades during year 2: 1
Enter the 1 grade(s): 100
Year Avg Stddev Grades
----------------------------
1 62.0 0.00 { 62 }
No outliers
2 100.0 0.00 { 100 }
No outliers
The second year had the highest grade of 100.
The first year's lowest grade is 62.
The second year's lowest grade is 100.
Test 3
> run
Enter # of grades during year 1: 1
Enter the 1 grade(s): 88
Enter # of grades during year 2: 1
Enter the 1 grade(s): 88
Year Avg Stddev Grades
----------------------------
1 88.0 0.00 { 88 }
No outliers
2 88.0 0.00 { 88 }
No outliers
Both years had the highest grade of 88.
The first year's lowest grade is 88.
The second year's lowest grade is 88.
Test 4
> run
Enter # of grades during year 1: 2
Enter the 2 grade(s): 0 100
Enter # of grades during year 2: 1
Enter the 1 grade(s): 50
Year Avg Stddev Grades
----------------------------
1 50.0 50.00 { 0, 100 }
No outliers
2 50.0 0.00 { 50 }
No outliers
The first year had the highest grade of 100.
The first year's lowest grade is 0.
The second year's lowest grade is 50.
Test 5
> run
Enter # of grades during year 1: 2
Enter the 2 grade(s): 76 64
Enter # of grades during year 2: 2
Enter the 2 grade(s): 94 83
Year Avg Stddev Grades
----------------------------
1 70.0 6.00 { 76, 64 }
No outliers
2 88.5 5.50 { 94, 83 }
No outliers
The second year had the highest grade of 94.
The first year's lowest grade is 64.
The second year's lowest grade is 83.
Test 6
> run
Enter # of grades during year 1: 2
Enter the 2 grade(s): 90 67
Enter # of grades during year 2: 2
Enter the 2 grade(s): 68 90
Year Avg Stddev Grades
----------------------------
1 78.5 11.50 { 90, 67 }
No outliers
2 79.0 11.00 { 68, 90 }
No outliers
Both years had the highest grade of 90.
The first year's lowest grade is 67.
The second year's lowest grade is 68.
Test 7
> run
Enter # of grades during year 1: 2
Enter the 2 grade(s): 65 65
Enter # of grades during year 2: 1
Enter the 1 grade(s): 75
Year Avg Stddev Grades
----------------------------
1 65.0 0.00 { 65, 65 }
No outliers
2 75.0 0.00 { 75 }
No outliers
The second year had the highest grade of 75.
The first year's lowest grade is 65.
The second year's lowest grade is 75.
Test 8
> run
Enter # of grades during year 1: 2
Enter the 2 grade(s): 45 60
Enter # of grades during year 2: 2
Enter the 2 grade(s): 60 50
Year Avg Stddev Grades
----------------------------
1 52.5 7.50 { 45, 60 }
No outliers
2 55.0 5.00 { 60, 50 }
No outliers
Both years had the highest grade of 60.
The first year's lowest grade is 45.
The second year's lowest grade is 50.
Test 9
> run
Enter # of grades during year 1: 1
Enter the 1 grade(s): 67
Enter # of grades during year 2: 2
Enter the 2 grade(s): 45 70
Year Avg Stddev Grades
----------------------------
1 67.0 0.00 { 67 }
No outliers
2 57.5 12.50 { 45, 70 }
No outliers
The second year had the highest grade of 70.
The first year's lowest grade is 67.
The second year's lowest grade is 45.
Test 10
> run
Enter # of grades during year 1: 4
Enter the 4 grade(s): 45 46 45 55
Enter # of grades during year 2: 3
Enter the 3 grade(s): 60 47 17
Year Avg Stddev Grades
----------------------------
1 47.8 4.21 { 45, 46, 45, 55 }
Outliers: < 55 >
2 41.3 18.01 { 60, 47, 17 }
Outliers: < 60, 17 >
The second year had the highest grade of 60.
The first year's lowest grade is 45.
The second year's lowest grade is 17.
Test 11
> run
Enter # of grades during year 1: 5
Enter the 5 grade(s): 17 43 30 47 60
Enter # of grades during year 2: 7
Enter the 7 grade(s): 56 75 66 65 66 98 45
Year Avg Stddev Grades
----------------------------
1 39.4 14.73 { 17, 43, 30, 47, 60 }
Outliers: < 17, 60 >
2 67.3 15.29 { 56, 75, 66, 65, 66, 98, 45 }
Outliers: < 98, 45 >
The second year had the highest grade of 98.
The first year's lowest grade is 17.
The second year's lowest grade is 45.
Test 12
> run
Enter # of grades during year 1: 9
Enter the 9 grade(s): 45 46 45 43 40 44 42 65 42
Enter # of grades during year 2: 10
Enter the 10 grade(s): 76 75 60 79 75 74 73 80 90 75
Year Avg Stddev Grades
----------------------------
1 45.8 7.02 { 45, 46, 45, 43, 40, 44, 42, 65, 42 }
Outliers: < 65 >
2 75.7 7.01 { 76, 75, 60, 79, 75, 74, 73, 80, 90, 75 }
Outliers: < 60, 90 >
The second year had the highest grade of 90.
The first year's lowest grade is 40.
The second year's lowest grade is 60.
Test 13
> run
Enter # of grades during year 1: 10
Enter the 10 grade(s): 76 75 60 79 75 74 73 80 90 75
Enter # of grades during year 2: 9
Enter the 9 grade(s): 45 46 45 43 40 44 42 65 42
Year Avg Stddev Grades
----------------------------
1 75.7 7.01 { 76, 75, 60, 79, 75, 74, 73, 80, 90, 75 }
Outliers: < 60, 90 >
2 45.8 7.02 { 45, 46, 45, 43, 40, 44, 42, 65, 42 }
Outliers: < 65 >
The first year had the highest grade of 90.
The first year's lowest grade is 60.
The second year's lowest grade is 40.
Test 14
> run
Enter # of grades during year 1: 10
Enter the 10 grade(s): 45 46 45 43 40 44 42 65 42 90
Enter # of grades during year 2: 10
Enter the 10 grade(s): 76 75 40 79 75 74 73 80 90 75
Year Avg Stddev Grades
----------------------------
1 50.2 14.84 { 45, 46, 45, 43, 40, 44, 42, 65, 42, 90 }
Outliers: < 90 >
2 73.7 12.17 { 76, 75, 40, 79, 75, 74, 73, 80, 90, 75 }
Outliers: < 40, 90 >
Both years had the highest grade of 90.
The first year's lowest grade is 40.
The second year's lowest grade is 40.
Write a C++ program that reads assignment grades taken over TWO years and then displays statistics about this data in a formatted table.
Your solution will be graded based upon program behavior (passing tests). Your solution will not receive full credit (or receives no credit) if you fail to follow these restrictions:
Your program must compile and run. Otherwise it will receive a zero.
Add your solution to the provided code template.
Only use C++ statements presented in the lecture notes and assigned readings.
Only use course material up to passing arrays.
Do not use explicitly defined pointer variables, i.e. using the * notation.
Do not use vectors.
Use descriptive variable names. Avoid too short variable names, especially single letter variable names.
DO NOT start a variable name with a capital letter. Use the name convention for constants given in the lecture notes.
If you define your own function name, make sure it is a descriptive name.
Properly use const, pass-by-value, and pass-by-reference when defining function parameters.
Properly choose between using the while vs the for statement.
DO NOT use the do-while loop.
Avoid repetitive code where possible.
DO NOT use explicit type casting. Instead use coercion (see lecture notes).
DO NOT unnecessarily use parenthesis in an expression, e.g. an equation or formula. Parenthesis should only be used for grouping portions of an expression to change operator precedence order. For example, parenthesis are unnecessary in the expression (a + b + c). Instead use a + b + c. Parenthesis are necessary in the expression (a + b + c) / 3.
Do NOT use the break and continue statements.
Your program must be readable including indenting, spaces, and avoid lines that are too long. Use the the sample programs in the lecture notes as a guide.
Comment your program. Read the document at the "Lecture" link on Carmen under Modules->Commenting Your Program-> Commenting your program. DO NOT comment every line.
Only use C++ statements presented in the course. I.e. statements and notation presented in the lecture notes and assigned readings.
You will implement the main function and a collection of functions. DO NOT delete nor change the code already given to you in the code template. You will add your code to this template to formulate your solution.
TASK 1: Replace "??" with your name, creation date, and a description of the program (synopsis).
TASK 2: Declare a GLOBAL constant to hold the integer 15, which will represent the maximum number of grades the user can record for one year.
TASK 3: Implement the following algorithm in the main function:
i. Declare your variables. Use the global constant (see TASK 2 above) to allocate TWO arrays, where each array holds the grades for a single year. Use fixed memory allocation.
ii. Read the grades for each year (there are two years). Call the function described in TASK 4, step 6. You will call this function twice, i.e. once for each day.
iii. Output an empty line.
iv. Display the headings for the formatted table. Call the procedure in TASK 4, step 7.
v. Display the statistics for each of the two years. Call the procedure in TASK 4, step 8. You will call this function twice, i.e. once for each year.
vi. Display the highest and lowest grades from the grade data in both days. Call the procedure in TASK 4, step 9.
TASK 4: Define the following functions and helper functions. Remember, a procedure is a function with no return value. In order to receive full credit, closely follow the provided instructions below. You must determine when to use const and pass by value vs. pass by reference. If you are not sure, then please study the lecture slides and notes.
Important: You will write eight functions as specified below. Choose descriptive function and variable names.
Place function prototypes BEFORE the main procedure.
Place function definitions AFTER the main procedure.
Each function should have a comment (placed above the function definition) that describes the function's task.
Include in this comment a short description of each input parameter.
Write a function to read from the user the grades for one year. Use the global constant (see TASK 2 above) in this function. The function has two input parameters: 1) an array to hold the grades for this year and 2) the year these grades belong to (either 1 or 2 for year 1 or year 2). The function returns the number of grades entered by the user. Prompt the user for the number of grades to read, say n, which must be at least 1 but no more than 15 (The value of the global constant). If invalid input is entered, then display a warning message and repeatedly ask the user again. See the provided test cases for the exact prompt and warning messages to use. Finally, read the n grades from the user.
Assume the user will enter exactly n grades.
Assume the user will only enter integer grades in the range 0 to 100. I.e., you DO NOT have to check for valid input here.
Write a procedure to display the first two lines of the output table containing the column names and dashed line. Use iomanip functions to attain the correct spacing. This procedure has no input parameters. Remember, a procedure is a function that does not return a value.
Write a procedure that computes the statistics (average, min, max, standard deviation) of a list of grades and then prints these statistics in the formatted table. This procedure has five input parameters: 1) which year (year 1 or year 2), 2) an array of grades, 3) the number of grades in the array, 4) the minimum grade found, and 5) the maximum grade found. Here is a link to a Wikipedia page that defines the standard deviation ( https://en.wikipedia.org/wiki/Standard_deviation ). Examples of how to calculate the standard deviation can be found here ( https://www.mathsisfun.com/data/standard-deviation.html ). Use fixed mode to display decimal values. The average is displayed with one digit after the decimal place. The standard deviation is displayed with two digits after the decimal place. Use iomanip functions to achieve proper spacing (see the provided test case output). This procedure MUST call these four "helper" functions whose descriptions are provided below:
(a) Write a procedure to compute the average (i.e., mean), minimum, and maximum grades. This procedure has five input parameters: 1) an array of grades, 2) the number of grades in the array, 3) the average computed by this procedure, 4) the minimum grade computed by this procedure, and 5) the maximum grade computed by this procedure.
(b) Write a function to compute the standard deviation and the number of (how many) "outliers". An "outlier" is a grade that is more than one standard deviation away from the average grade. The function has four input parameter: 1) an array of grades, 2) the number of grades in the array, 3) the average of the grades, and 4) the number of "outliers" computed by this function. The return value is the standard deviation computed by this function.
(c) Write a procedure to output the sampled grades in a comma separated list delimited by curly braces. This procedure has two input parameters: 1) an array of grades and 2) the number of grades in the array. Use an endl after the closing curly braces.
(d) Write a procedure to output the "outliers" as a comma separated list delimited by angle brackets, i.e. "< … >". If there are no "outliers" then output "No outliers". The procedure has five input parameters: 1) an array of grades, 2) the number of grades in the array, 3) the average of the grades, 4) the standard deviation of the grades, and 5) the number of "outliers". Use an endl at the end of the output.
Write a procedure to output the highest grade across the two years and the lowest grades for both years. The procedure has four input parameters: 1) the lowest grade in year 1, 2) the highest grade on year 1, 3) the lowest grade on year 2, and 4) the highest grade on year 2. Use an endl at the end of the output.
Be sure that there is a comment documenting each variable.
Be sure that your if statements, for and while loops and blocks are properly indented.
Test your solution.
write a method call need help!
write a method that called smallestLargest that accepts a Scanner for the console as a parameter and ask the user to ent ...
write a method call need help!
write a method that called smallestLargest that accepts a Scanner for the console as a parameter and ask the user to enter numbers, then prints the smallest and the largest of all the numbers supplied by the user. you may assume that the user enters a valid number greater than 0 for the number of numbers to read please return the answer in a simple introduction level to programming principles need to be basic nothing too complex.
Dashboard Data Visualization
PromptYou have been asked to create a data table on the dashboard which shows an unfiltered view of the Austin Animal Cent ...
Dashboard Data Visualization
PromptYou have been asked to create a data table on the dashboard which shows an unfiltered view of the Austin Animal Center Outcomes data set. You have also been asked to add a geolocation chart to the dashboard, which will help the client visualize the data. For more details about the dash components for data tables and the geolocation chart, refer to the Module Six resources.Open the ModuleSixMilestone.ipynb file, which contains the starter code for the Grazioso Salvare dashboard. Upload this file into Apporto and open it using the Jupyter Notebook application. Be sure to review all of the starter code that you have been given. Pay special attention to the import commands and the comments describing what each section of code does.Update the code to create an interactive data table on the dashboard which shows an unfiltered view of the Austin Animal Center Outcomes data set. To populate the data onto your table, you will utilize your previous CRUD Python module, from Project One, to run a “retrieve all” query and bring in the data from MongoDB. This data retrieval will serve to access the “model” portion of your MVC pattern: the MongoDB database. Be sure to hardcode in the username and password for the “aacuser” account.Note: It may take a few minutes for the data table to fully render and display, depending on the speed of your internet connection.Tip: Be sure to consider your client when creating the interactive data table. Consider optional features that will make the table easier to use, such as limiting the number of rows displayed, enabling pagination (advanced), enabling sorting, and so on. Review the Module Six resources on data tables to help you select and set up these features.Add a geolocation chart that displays data from the interactive data table to your existing dashboard.You are being given the function that sets up accessing the data for the geolocation chart and calls the Leaflet function: update_map:def update_map(viewData):
dff = pd.DataFrame.from_dict(viewData)
# Austin TX is at [30.75,-97.48]
return [
dl.Map(style={'width': '1000px', 'height': '500px'}, center=[30.75,-97.48], zoom=10, children=[
dl.TileLayer(id="base-layer-id"),
# Marker with tool tip and popup
dl.Marker(position=[30.75,-97.48], children=[
dl.Tooltip(dff.iloc[0,4]),
dl.Popup([
html.H1("Animal Name"),
html.P(dff.iloc[1,9])
])
])
])
]
You will need to structure this function into your dashboard code by putting the correct statements in the layout. These statements are important so that your layout has a place for the geolocation chart. Here is an example statement:html.Div(
id='map-id',
className='col s12 m6',
)
You will also need to add in the correct callback routines for the geolocation chart. These will look similar to the callback routines used for user authentication and your data table. Here is an example callback routine:@app.callback(
Output('map-id', "children"),
[Input('datatable-id', "derived_viewport_data")])
Note: The Leaflet geolocation chart will show the first row of the data table by default. As long as your chart shows the location of the dog in the first row, that is sufficient for checking that your geolocation chart is set up correctly.Finally, run the IPYNB file and take a screenshot of your dashboard as proof of this execution. Your screenshot should include 1) the interactive data table populated with the Austin Animal Center Outcomes data from MongoDB and 2) your geolocation chart showing the location of the first dog in the table. Additionally, your unique identifier (created in the Module Five assignment) should also be visible in the screenshot.Requirements: No words limit/ pythonAll tutors provide: high quality help, quick responsive communication, original explanations and answers with any outside resources cited.
Pennsylvania State University Network Diagram for A Small Company Project
Create a Network DiagramYour network diagram needs to include the following elements:An Internet Service Provider Network ...
Pennsylvania State University Network Diagram for A Small Company Project
Create a Network DiagramYour network diagram needs to include the following elements:An Internet Service Provider Network (represented as a cloud)Router with enough ports to meet the needs of the organizationA switch for each floor – you will need to identify how many ports each switch on each floor needs to haveYou DO NOT need to show every single computer on your diagram. However, you need to show groups of computers, plus their use. So, if there are 5 people in the same department, you can show all 5 computers with one icon/glyph and label it appropriately.Each grouping of computers needs to have the IP Address range documented on the diagram. Assign the x.x.x.1 address of each network to the appropriate port on the router.Network DocumentationYour network design document needs to explain each element of the network. Each Layer two (switch) and Layer three (Router) device needs to be described in terms of number of ports. The number of computers for each department and floor also needs to be documented. The IP address ranges need to be explained – including the IP Address range that you assigned, the number of IP Addresses that the subnetwork will use, and the number of IP addresses that remain unused in that subnet.
11 pages
Data Distribution
Identify if the following random variables are discrete or continuous. Height of males (in mm) who attend Grand Canyon Uni ...
Data Distribution
Identify if the following random variables are discrete or continuous. Height of males (in mm) who attend Grand Canyon University-Continuous variable.
Earn money selling
your Study Documents