Question: The problem I'm facing with this code is it isn't printing force The output should match this exactly I beleive it has something to do

 

The problem I'm facing with this code is it isn't printing force The output should match this exactly I beleive it has something to do with the display function but I might be wrong. The main.cpp file is not allowed to be changed. Could you please provide help on how to fix this?

Script started on Fri 27 Jan 2023 02:16:02 PM EST ==137025== Memcheck,
  Department.cpp =        #define _CRT_SECURE_NO_WARNINGS    #include     #include     #include "Department.h"        using namespace std;        namespace sdds {            void Department::updateName(const char* newname) {            if (newname[0] != '0' && newname != nullptr) {                if (departmentName != nullptr) {                    delete[] departmentName;                }                departmentName = new char[strlen(newname) + 1];                strcpy(departmentName, newname);            }            else {                cout  0) {                budget += change;            }            else {                cout  0) {                if (noOfProject == 0) {                    ptr_project = new Project[1];                    ptr_project[0] = newproject;                    noOfProject = 1;                    check = true;                }                else {                    Project* temp_ptr_department = new Project[noOfProject + 1];                    for (int i = 0; i     #include "Department.h"    using namespace std;    using namespace sdds;        int main() {        Project testProject = { "Base",551.55 };        Project myprojects[5] = { {"Synergy", 5041.55},      {"Mecha", 2925.99},      {"Chroma", 3995.45},      {"Force", 6988.45},      {"Oculus", 7441.22}    };        Department SDDS{};        //Test1    cout 

Script started on Fri 27 Jan 2023 02:16:02 PM EST ==137025== Memcheck, a memory error detector ==137025== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==137025== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info ==137025== Command: ws ==137025== ******Create Department TEST START********** Department School of Software development details: Budget: 15347 and the number of projects in progress is: 1 Below are the details of the projects we are currently working on: Project Base will cost a total of 551.55 C$. *******Create Department TEST END********** ******Update Name TEST Start********** Department School of Software development and design details: Budget: 15347 and the number of projects in progress is: 1 Below are the details of the projects we are currently working on: Project Base will cost a total of 551.55 C$. ******Update Name TEST END********** **********Update Budget TEST Start********** Department School of Software development and design details: Budget: 20903 and the number of projects in progress is: 1 Below are the details of the projects we are currently working on: Project Base will cost a total of 551.55 C$. ******Update Budget TEST END********** *****Expenses and Remaining Budget TEST Start********** Our current total Expenses are: 551.55 Our remaining budget is: 20351.4 *******Expenses and Remaining Budget TEST END********** *******Add Project TEST START********** Department School of Software development and design details: Budget: 20903 and the number of projects in progress is: 5 Below are the details of the projects we are currently working on: Project Base will cost a total of 551.55 C$. Project Synergy will cost a total of 5041.55 C$. Project Mecha will cost a total of 2925.99 C$. Project Chroma will cost a total of 3995.45 C$. Project Force will cost a total of 6988.45 C$. *****Add Project TEST END****** W

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

It seems the issue lies in the totalexpenses and remainingBudget functions in your Departmentcpp ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!