Question: Can you help me with this assignment. I am getting unexpected outputs and I don't understand why ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ HERES MY CODE: The code comes from
Can you help me with this assignment. I am getting unexpected outputs and I don't understand why
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
HERES MY CODE:
The code comes from the expert answer over here: https://www.chegg.com/homework-help/questions-and-answers/please-help-make-c-file-follow-steps-overview-assignment-going-load-series-files-containin-q35091448
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
THE ERRORS:












7:Average part count of all loaded sets A Output differs. See highlights below. \begin{tabular}{r|l} Expectedoutputendswith & Total number of sets: 971 \\ \hline \end{tabular} 8:Price info for loaded sets - average, least/most expensive Output differs. See highlights below. Input 16 Total number of sets: 766 Average price for 766 sets: $33.52 Least expensive set: Name: Fire Attack Number: 4807 Theme: Castle Price: $1.95 Your output ends Minifigures: 1 with Piece count: 24 Most expensive set: Name: Death star Number: 75159 Theme: Star wars Price: $499.99 Minifigures: 27 Piece count: 4016 Total number of sets: 766 Average price for 766 sets: $33.52 Least expensive set: Name: Fire Boat Number: 1248 Theme: Town Price: $1.70 Minifigures: 1 Piece count: 24 Most expensive set: Name: Death Star Number: 75159 Theme: Star wars Price: $499.99 Minifigures: 27 Piece count: 4016 Price info for loaded sets - average, least/most expensive Output differs. See highlights below. Input Total number of sets: 2447 Average price for 2447 sets: $39.31 Least expensive set: Name: Fire Attack Number: 4807 Theme: Castle Price: $1.95 Your output ends Minifigures: 1 with Piece count: 24 Most expensive set: Name: Millennium Falcon Number: 75192 Theme: Star Wars Price: $799.99 Minifigures: 8 Piece count: 7541 Total number of sets: 2447 Average price for 2447 sets: $39.31 Least expensive set: Name: Fire Boat Number: 1248 Theme: Town Price: $1.70 Minifigures: 1 Piece count: 24 Most expensive set: Name: Millennium Falcon Number: 75192 Theme: Star Wars Price: $799.99 Minifigures: 8 Piece count: 7541 10:Loading everything - minifigure info Output differs. See highlights below. Input 2447 Average number of minifigures: 3 Set with the most minifigures: Name: Community Workers Number: 9247 Theme: Education Price: $49.99 Your output ends Minifigures: 31 with Piece count: 202 Set with the Name: Dump Truck Number: 4653 Theme: 4 Juniors Price: $10.00 Minifigures: 1 Piece count: 27 \begin{tabular}{|l|l} & Total number of sets: 2447 \\ Expected output & Setwiththemostminifigures:Name:CommunityWorkers \\ ends with & Number:9247Theme:EducationPrice:$49.99Minifigures:31 \\ Piece count: 202 \end{tabular} 11:Buying 1 of everything from all files! Output differs. See highlights below. Input 48 Total number of sets: 2447 Your output ends If you bought one of everything... with It would cost: $96192.27 You would have 793617 pieces in your collection You would have an army of 7883 minifigures! Total number of sets: 2447 Expected output If you bought one of everything... ends with It would cost: \$96191.62 You would have 793617 pieces in your collection You would have an army of 7883 minifigures! 2:Buying everything from just 1 file Output differs. See highlights below. Input Total number of sets: 766 Your output ends If you bought one of everything... with It would cost: $25677.34 You would have 188980 pieces in your collection You would have an army of 2354 minifigures! Total number of sets: 766 Expectedoutput If you bought one of everything... ends with It would cost: \$25677.24 You would have 188980 pieces in your collection You would have an army of 2354 minifigures! 13:Buying everything from just 1 file A Output differs. See highlights below. Input 28 Total number of sets: 710 \( \begin{array}{l} \begin{array}{r}\text { Your output ends } \\ \text { with }\end{array} \begin{array}{l}\text { If you bought one of everything... } \\ \text { It would cost: } \$ 12807.24 \\ \text { You would have } 70255 \text { pieces in your collection } \\ \text { You would have an army of } 1414 \text { minifigures! }\end{array} \\ \)Totalnumberofsets:710\( \\ \begin{aligned} \text { Expected output } \\ \text { ends with }\end{aligned} \begin{array}{l}\text { If you bought one of everything... } \\ \text { It would cost: } \$ 12807.21 \\ \text { You would have } 70255 \text { pieces in your collection } \\ \text { You would have an army of } 1414 \text { minifigures! }\end{array}\end{array} \) 14:Buying everything from just 1 file N Output differs. See highlights below. 7:Average part count of all loaded sets A Output differs. See highlights below. \begin{tabular}{r|l} Expectedoutputendswith & Total number of sets: 971 \\ \hline \end{tabular} 8:Price info for loaded sets - average, least/most expensive Output differs. See highlights below. Input 16 Total number of sets: 766 Average price for 766 sets: $33.52 Least expensive set: Name: Fire Attack Number: 4807 Theme: Castle Price: $1.95 Your output ends Minifigures: 1 with Piece count: 24 Most expensive set: Name: Death star Number: 75159 Theme: Star wars Price: $499.99 Minifigures: 27 Piece count: 4016 Total number of sets: 766 Average price for 766 sets: $33.52 Least expensive set: Name: Fire Boat Number: 1248 Theme: Town Price: $1.70 Minifigures: 1 Piece count: 24 Most expensive set: Name: Death Star Number: 75159 Theme: Star wars Price: $499.99 Minifigures: 27 Piece count: 4016 Price info for loaded sets - average, least/most expensive Output differs. See highlights below. Input Total number of sets: 2447 Average price for 2447 sets: $39.31 Least expensive set: Name: Fire Attack Number: 4807 Theme: Castle Price: $1.95 Your output ends Minifigures: 1 with Piece count: 24 Most expensive set: Name: Millennium Falcon Number: 75192 Theme: Star Wars Price: $799.99 Minifigures: 8 Piece count: 7541 Total number of sets: 2447 Average price for 2447 sets: $39.31 Least expensive set: Name: Fire Boat Number: 1248 Theme: Town Price: $1.70 Minifigures: 1 Piece count: 24 Most expensive set: Name: Millennium Falcon Number: 75192 Theme: Star Wars Price: $799.99 Minifigures: 8 Piece count: 7541 10:Loading everything - minifigure info Output differs. See highlights below. Input 2447 Average number of minifigures: 3 Set with the most minifigures: Name: Community Workers Number: 9247 Theme: Education Price: $49.99 Your output ends Minifigures: 31 with Piece count: 202 Set with the Name: Dump Truck Number: 4653 Theme: 4 Juniors Price: $10.00 Minifigures: 1 Piece count: 27 \begin{tabular}{|l|l} & Total number of sets: 2447 \\ Expected output & Setwiththemostminifigures:Name:CommunityWorkers \\ ends with & Number:9247Theme:EducationPrice:$49.99Minifigures:31 \\ Piece count: 202 \end{tabular} 11:Buying 1 of everything from all files! Output differs. See highlights below. Input 48 Total number of sets: 2447 Your output ends If you bought one of everything... with It would cost: $96192.27 You would have 793617 pieces in your collection You would have an army of 7883 minifigures! Total number of sets: 2447 Expected output If you bought one of everything... ends with It would cost: \$96191.62 You would have 793617 pieces in your collection You would have an army of 7883 minifigures! 2:Buying everything from just 1 file Output differs. See highlights below. Input Total number of sets: 766 Your output ends If you bought one of everything... with It would cost: $25677.34 You would have 188980 pieces in your collection You would have an army of 2354 minifigures! Total number of sets: 766 Expectedoutput If you bought one of everything... ends with It would cost: \$25677.24 You would have 188980 pieces in your collection You would have an army of 2354 minifigures! 13:Buying everything from just 1 file A Output differs. See highlights below. Input 28 Total number of sets: 710 \( \begin{array}{l} \begin{array}{r}\text { Your output ends } \\ \text { with }\end{array} \begin{array}{l}\text { If you bought one of everything... } \\ \text { It would cost: } \$ 12807.24 \\ \text { You would have } 70255 \text { pieces in your collection } \\ \text { You would have an army of } 1414 \text { minifigures! }\end{array} \\ \)Totalnumberofsets:710\( \\ \begin{aligned} \text { Expected output } \\ \text { ends with }\end{aligned} \begin{array}{l}\text { If you bought one of everything... } \\ \text { It would cost: } \$ 12807.21 \\ \text { You would have } 70255 \text { pieces in your collection } \\ \text { You would have an army of } 1414 \text { minifigures! }\end{array}\end{array} \) 14:Buying everything from just 1 file N Output differs. See highlights below
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
