Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question Completion Status: QUESTION 1 30 points In this part ll of the exam, please create a C++ program named savings.cpp that fulfills the following
Question Completion Status: QUESTION 1 30 points In this part ll of the exam, please create a C++ program named savings.cpp that fulfills the following requirements 1. (10 points) It should contain a function prototype for function myname. The function receives a reference variable in the parameter list and returns void. The function myname will do the following: 1.1 Create a name string variable in the main function and initialize it with your full name as a string literal. Create a prototype indicating void return from the function and using pass by reference. Pass a reference to the name variable when calling the function in the main function. 1.2 The myname function use the reference variable in cout to print: Student Name: "full name that references the name string variable in the main function." 1.3 Advance to next line at the end of cout in the function. 2. (20 points) in the main function of the C++ program, code program statements to do 2.3-2.9: 2.1 Download the attached savings.txt file. 2.2 Save the savings.txt file to a location on your computer where the program can read it. 2.3 The program should prompt to enter the filename. Save the filename to a variable and open the file for input. 2.4 in a loop, read the amounts including cents from the savings.txt file. The loop should end 2.5 Accumulate the total and count the number of records read. Each record read is 1 day of savings 2.6 When the total passes 500.00, send an output: "Your savings has reached $500.00 after x days." 2.7 Continue reading and accumulating the daily savings without output of 2.6. When the program finished reading all the records. calculate the average savings per day, and the total savings amount. 2.8 Send an output "You averaged $ xxx.xx savings per day and reached a total of S xxxXxx.xx saved innnn days. where x and nare numbers calculated by the program for average total and count of records 2.9 Lastly call the mynamed function of Part 1) passing a reference to the name variable in the main. Hint in this file processing you can use in as the file reader because the file contains only one column of numeric data with decimal positions To submit 1. Upload the mysavings.cpp program 2. A second question in Exam 1 Part 2 is for uploading the image of your run and output Click Save and submit to save and submit Chek Satie Al Answers to see all answers Save and
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started