Question
Solution Template Fill in the information for each test that you develop for the 4 tables below. Add more rows as required to list all
Solution Template
Fill in the information for each test that you develop for the 4 tables below. Add more rows as required to list all possible tests for each type. Do not repeat tests which have already been used to test a particular description. Use as many rows as needed to capture all of your tests. Each of the four tables may span more than one page if necessary.
Representative Input Tests | |||||
Test # | Test Description | Test Data | Expected Result | Actual Result | Pass/Fail |
1 | Add a party | pizza Party Saturday 12 pm 10 adults 10 teens 10 children | Cheese: 12 * 1, 14 * 2 Pepp: 12 * 1, 14 * 2 Saus: 12 * 1 Veggie: 14 * 2 | Cheese: 12 * 1, 14 * 2 Pepp: 12 * 1, 14 * 2 Saus: 12 * 1 Veggie: 14 * 2 | pass |
Party.cpp
#include "party.h" #include #include #include int calcSlices(party& Party); ///prints party info void party::print(std::ostream& out){ std::string titles[10]={"Cheese","Pepperoni","Sausage","Veggie","Mushroom","10\"","12\"","14\"","16\"","18\""}; std::string days[7]={"Sun","Mon","Tues","Wed","Thur","Fri","Sat"}; out |
Party.h
#ifndef __PARTY_H_INCLUDED__ #define __PARTY_H_INCLUDED__ #include /// 3 slices per adult/ if its sunday thru thursday and 5pm or later, then adults probably won't stay long, so you only need enough for 2/3 the adults /// 4 slices per teen /// 2 slices per child /// 10" pizzas have 6 slices /// 12" pizzas have 8 slices /// 14" pizzas have 10 slices (most popular) /// 16" pizzas have 12 slices /// 18" pizzas have 14 slices /// 1/3 cheese /// 62% 0f 2/3 remaining slices are meat (75% of which is pepperoni, 25% sausage) /// 48% Of 2/3 reamining are veggie (11% of which is mushroom) /// if percentage values of number of slices are less than 1 large pizza, split into smaller pizzas /// once percentages are calculated, if the percentage is less than a slice, No pizzas of that type need to be ordered. /// if remaining slices are less than 5, no more pizzas need to be ordered of that type. /// 16" and 18" are reserved for parties over 50 class party{ std::string name; int adults; int teens; int children; int dayoftheWeek; int timeOfDay; int** deets; public: party(){ name = ""; adults=0; teens=0; children=0; dayoftheWeek=0; timeOfDay=0; deets = new int*[5]; for(int i=0; iname = Name; } std::string getName(){ return name; } void setAdults(int adults){ this->adults=adults; } int getAdults(){ return adults; } void setTeens(int teens){ this->teens=teens; } int getTeens(){ return teens; } void setChildren(int children){ this->children=children; } int getChildren(){ return children; } void setCheese(int num, int pieIndex){ deets[0][pieIndex]+=num; } int getCheese(int pieIndex){ return deets[0][pieIndex]; } void setPepperoni(int num, int pieIndex){ deets[1][pieIndex]+=num; } int getPepperoni(int pieIndex){ return deets[1][pieIndex]; } void setSausage(int num, int pieIndex){ deets[2][pieIndex]+=num; } int getSausage(int pieIndex){ return deets[2][pieIndex]; } void setVeggie(int num, int pieIndex){ deets[3][pieIndex]+=num; } int getVeggie(int pieIndex){ return deets[3][pieIndex]; } void setMushroom(int num, int pieIndex){ deets[4][pieIndex]+=num; } int getMushroom(int pieIndex){ return deets[4][pieIndex]; } void setDayOftheWeek(int day){ dayoftheWeek=day; } int getDayOftheWeek(){ return dayoftheWeek; } void setTimeOfDay(int time){ timeOfDay=time; } int getTimeOfDay(){ return timeOfDay; } int getTotalAttend(){ return adults+teens+children; } }; ///does all of the calculations and function calls to accomplish it void calcPizzas(party& Party); #endif // __PARTY_H_INCLUDED__ |
pizzaParty.cpp
#include #include #include "party.h" using namespace std; bool menu(); void newParty(); void oldParty(); void addPartyToFile(party& Party); void printOldParties(party Party[], int numParty); int selectOldParty(party Party[], int numParty); inline bool fileExists (const string& name); int convert24(int hour, string period); int main() { bool flag=true; ///calls the menu in a loop until it returns false while(flag) { flag = menu(); if(flag){ coutnumParties; File.ignore(); party Parties[numParties]; for(int i=0; i>selection; if(!cin || !(selection>0 && selectionnumParties; inFile.ignore(); party Parties[numParties]; for(int i=0; i>con; cin.ignore(256,' '); cin.clear(); if(con == 'y' || con == 'Y'){ continue; } break; } } ///create a new party plan void newParty(){ party Party; int temp=0; string tamp=""; while(true){ cout>temp; if(!cin || temp = 0 ::: "; continue; } Party.setAdults(temp); cin.clear(); cin.ignore(256, ' '); break; } while(true){ cout>temp; if(!cin || temp = 0 ::: "; continue; } Party.setTeens(temp); cin.clear(); cin.ignore(256, ' '); break; } while(true){ cout>temp; if(!cin || temp = 0 ::: "; continue; } Party.setChildren(temp); cin.clear(); cin.ignore(256, ' '); break; } while(true){ cout>temp; if(!cin || !(temp 0)){ cin.clear(); cin.ignore(256, ' '); cout>temp; cin>>tamp; if(!cin || !(tamp=="pm" || tamp=="am") || !(temp0)){ cin.clear(); cin.ignore(256, ' '); coutselect; if(!cin || select > 3 || select |
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