Home / Expert Answers / Computer Science / draw-a-uml-diagram-to-represent-the-data-entities-model-of-all-custom-data-types-in-the-given-progra-pa501

(Solved): draw a UML diagram to represent the data entities model of all custom data types in the given progra ...



draw a UML diagram to represent the data entities model of all custom data types in the given program 

This question 8 requires you to (i) draw a UML diagram and (ii) address \( 8(a) \) to \( 8(e) \) questions - by fill in the b
Figure 1: The programs sample output
Figure 2 shows read_familys (functions read_string(...), read_integer(...), and read_double(...) declarations.
Eigure 2: rea
Figure 3 shows parts of the program source code with comments, which includes:
- a struct identified as customer_data
- a str
vector<customer_data> shoppers;
3
If function to gather information for customer_data
II You are asked to complete the implem
\( 53 \quad \) (c) \( = \) gather_information();
54 Iladd customer_data to the vector using push_back()
\( 58.11 \) procedure
This question 8 requires you to (i) draw a UML diagram and (ii) address \( 8(a) \) to \( 8(e) \) questions - by fill in the blanks with C++ codes. - Draw a UML diagram (in the style covered in week 7) to represent the data entities model of all custom data types in the given program. You are required to paste your UML diagram to OnTrack 9.1P answer sheet. Your OnTrack tutor will evaluate your work via your \( 9.1 \mathrm{P} \) submission. - Analyse the information of a C++ program in Figure 1. Figure 2, and Figure 3. Indicate your syntax for parts (a) to (e) respectively to complete the program (read Figure 3 for the given code). Syntax for parts (a) to (e) will be auto-marked by the system, remember to input accurate identifiers and code. Figure 1 shows the sample output of the program. The program aims to read in and store data, then display the full list of customer names in the database to the Terminal. Figure 1: The program's sample output Figure 2 shows read_family's (functions read_string(...), read_integer(...), and read_double(...) declarations. Eigure 2: read family's declarations Figure 3 shows parts of the program source code with comments, which includes: - a struct identified as customer_data - a struct identified as store_data - a struct identified as brand_kingdom - a function gather_information() - a procedure add_information(...) - a procedure write_information(...) - a function main() vector shoppers; 3 If function to gather information for customer_data II You are asked to complete the implementation of gather_information() customer_data gather_information() \{ customer_data new_shopper, II Declare a variable to store the read-in data write_line("*** Collecting information **** "); new_shopper.name = read_string("Enter customer's name: "); new_shopperid = read integer('Enter customer's id: "): new_shopper.age a read integer("Enter customer's age: "); new_shopper.spent_amount = read_double("Enter the purchase amount:"): return :ll return the collected data If procedure to add information into the brand kingdom II brand_kingdom member is passed by reference with both read and write privileges If You are asked to complete the implementation of add_information( \( \ldots \).\( ) . \) void add, information(brand_kingdom 8 base) f Write_line("maxr= Collecting information =r:=s"); Iiget the store's name and save in brand_kingdom (b) = read_string("Enter store name: "); II Declare a variable to store the read-in data for customer_data customer_data shopper. II To collect two customers" data int num \( =2 \); for \( ( \) int \( i=0 ; i< \) num; \( i++) \) (/call gather_information() and store the returned oulput \( 53 \quad \) (c) \( = \) gather_information(); 54 Iladd customer_data to the vector using push_back() \( 58.11 \) procedure to print out all collected customer names to terminal 60 II brand kingdom member is passed by reference with only read privilege 61 II You are asked to complete the implementation of write_information(...) 62 void write_information(const brand_kingdom \&base) 63 \& 64 write_line("==== Full list of all customers in the database: \( =====") \); 65 for (int \( i=0 ; i< \) base shoppers.size ()\( ; i++) \) 66 - \( \quad \) \( 67 \quad \) write(i+1); 68 Ilprint out the customer name in the database \( \begin{array}{ll}69 & \text { write_line(": " }+\square \text { (e) } \\ 70 & \text { ) }\end{array} \) 72 73 int main() \( 74 \quad \) - 75 brand_kingdom base; 76 add_information(base); 77 write_information(base); 78 return 0; \( 80 \quad 3 \) //code extract ends


We have an Answer from Expert

View Expert Answer

Expert Answer


9a) new_shopper Inside the function gather_information(), a variable named new_shopper of

We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe