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. 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 when there are no more records. 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 $ xxxxxx.xx saved in nnn days."     where x and n are numbers calculated by the program for average, total and count of records. 2.9 Lastly, call the myname() function (of Part 1) passing a reference to the name variable in the main.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

1.  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. 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 when there are no more records.
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 $ xxxxxx.xx saved in nnn days."
    where x and n are numbers calculated by the program for average, total and count of records.
2.9 Lastly, call the myname() function (of Part 1) passing a reference to the name variable in the main.

Hint: In this file processing, you can use cin as the file reader because the file contains only one column of numeric data with decimal positions.

savings.txt

35.00 63.15 12.5 10.00 8.25 7.50 8.00 100.25 25.00 25.15 280.50 244.10 120.00 100.00 78.50 55.00 55.20 13.55 12.00 18.95 12.15 10.00 58.55 25.60 8.50 10.00 12.00 50.50 19.25 45.60

(please do on code::Blocks)

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education