Write a program that assists the user to determine a simple budget based on the income entered. Using the system, the income would be divided into four different categories; Necessity: Typical expenses such as rent, transport, utilities, insurance, etc. Invest: Investment opportunity in real estate, stock market, etc. Play: Amount that can be spent on small luxury such as fine dining, gadget, etc. Charity: Contribution to help other less fortunate person or charitable organization. a) Create a structure called Budget. The attributes in the structure are: o name (string) o age (int) о i псome (float) o necessity (float) o play (float) o invest (float) o charity (float) Declare a structure variable array called info with size 3. b) In main() function: Create a FILE pointer called fp. Use this pointer to open the file Report.txt for updating. The file contains the name, age, income, necessity, play, invest, charity. • If the file cannot be opened, display error message "File cannot be opened. Terminating..." and quit the program. Call function get_details(...), passing info as argument. Using a for.loop (repeat for 3 times): • Write the name, age, income, necessity, invest, play and charity into file report.txt. Call function display(...), passing info as argument. Close file Report.txt. c) In the get_details(...) function: Using a while.loop (repeat for 3 times): Request from the user to enter data for name, age and income for each individual. • Calculate the allocation amount according to the following table. Category necessity 65% of income invest Allocation 20% of income play charity 10% of income 5% of income
Write a program that assists the user to determine a simple budget based on the income entered. Using the system, the income would be divided into four different categories; Necessity: Typical expenses such as rent, transport, utilities, insurance, etc. Invest: Investment opportunity in real estate, stock market, etc. Play: Amount that can be spent on small luxury such as fine dining, gadget, etc. Charity: Contribution to help other less fortunate person or charitable organization. a) Create a structure called Budget. The attributes in the structure are: o name (string) o age (int) о i псome (float) o necessity (float) o play (float) o invest (float) o charity (float) Declare a structure variable array called info with size 3. b) In main() function: Create a FILE pointer called fp. Use this pointer to open the file Report.txt for updating. The file contains the name, age, income, necessity, play, invest, charity. • If the file cannot be opened, display error message "File cannot be opened. Terminating..." and quit the program. Call function get_details(...), passing info as argument. Using a for.loop (repeat for 3 times): • Write the name, age, income, necessity, invest, play and charity into file report.txt. Call function display(...), passing info as argument. Close file Report.txt. c) In the get_details(...) function: Using a while.loop (repeat for 3 times): Request from the user to enter data for name, age and income for each individual. • Calculate the allocation amount according to the following table. Category necessity 65% of income invest Allocation 20% of income play charity 10% of income 5% of income
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
i would like to get the same output as the question, can help me using c prog
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY