Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ When writing functions, you can assume that these lines have been processed earlier: #include #include using namespace std; Q1 24 Q2 16 Q3 24

C++

image text in transcribed

image text in transcribed

When writing functions, you can assume that these lines have been processed earlier: #include #include using namespace std; Q1 24 Q2 16 Q3 24 Q4 15 Q5 16 Q6 5 Total 100 1. Write a class called Budget with the data members accountNo (int), name (string) and months (a static float array of size 6). Provide the following functions. [4 points for the class structure, and 5 points per function] a) default constructor. Use an initialization list. You can set the default values as you'd like but leave the parameter empty for months (This will set all elements to zero). b) getName(). Returns the name. c) change(int index, float val). Sets the element at the index in months to val. d) print(). Prints all the values in months separated by a space. You do NOT have to provide any other function (e.g., copy constructor or copy assignment). It should support calls such as: Budget b; cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Development For Dummies

Authors: Allen G. Taylor

1st Edition

978-0764507526

More Books

Students also viewed these Databases questions