Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

hello here is my assigment CS 161A: Programming and Problem Solving I Assignment 6: Pizza Party Statistics Academic Integrity You may NOT, under any circumstances,

hello here is my assigment

CS 161A: Programming and Problem Solving I

Assignment 6: Pizza Party Statistics

Academic Integrity

You may NOT, under any circumstances, begin a programming assignment by looking for completed code on StackOverflow or Chegg or any such website, which you can claim as your own. Please check out the Student Code of Conduct at PCC.

The only way to learn to code is to do it yourself. The assignments will be built from examples during the lectures, so ask for clarification during class if something seems confusing. If you start with code from another source and just change the variable names or other content to make it look original, you will receive a zero on the assignment.

I may ask you to explain your assignment verbally. If you cannot satisfactorily explain what your code does, and answer questions about why you wrote it in a particular way, then you should also expect a zero.

Introduction

Whats Americas favorite meal? If youre like most people, pizza was probably the first thing that came to mind. Pizza is one of the few meals that almost everyone loves. Heres a fun fact - About 350 slices of pizza are consumed every second in the US. You are going to write a program to perform statistical analysis for a Pizza Party.

Purpose

In this assignment you will be entering the number of people attending, the average number of slices per person and the cost of one pizza and you will continue asking the user for the number of people attending, the average number of slices per person and the cost of one pizza until they are done. While the user wants to add more input, you will add the data to accumulators (an accumulator is a variable the program uses to calculate a sum or product of a series of values) to perform statistical analysis after they are done.

After completing this assignment you will be able to:

Use a do-while loop to prompt the user for at least one set of data for a pizza party.

Use an accumulator to keep track of the total number of pizzas, the total cost, and then the number of party entries entered by the user

Use a min/max algorithm to determine the party with the maximum number of people.

Calculate the average number of pizzas for the parties.

Task

Before you get started:

Check out Sample Assignment A06 - Algorithmic Design document

Check out Sample Assignment A06 - sampleA06.cpp

Open the Algorithmic Design Document, make a copy, and follow the steps to create your algorithm.

You must express your algorithm as pseudocode.

Print a welcome message for your program.

When the program runs, you must read the number of people attending, the average number of slices per person and the cost of one pizza, separated by space exactly as shown in the sample run below. This is part of the required coding construct.

Assume there are 8 slices per pizza.

Calculate the number of whole pizzas needed.

Hint: Use the ceil() function found in the cmath library to round up to the nearest whole number and convert to an integer.

Calculate and output the cost for all pizzas.

Calculate and output the sales tax (7%). Calculate and output the delivery charge (20% of cost including tax).

Calculate and output the total including pizza, tax and delivery.

Prompt the user if they want to run the program again.

When the user is finished entering the pizza and people information:

Display the number of party entries entered.

Calculate and display the average number of pizzas for the number of party entries entered. (must be a double displayed with one decimal)

Display the maximum number of people entered for a party.

Display the maximum cost of pizzas (total including tax and delivery) calculated for a party.

Print a goodbye message.

Do not use any return or break statements inside your while loop.

Use only the concepts we have learned so far.

Criteria for Success

Look at the sample run below. Determine the variables you will need for the various calculations (your list may include other variables):

Number of people per party

Average number of slices per party

Cost of one pizza for a party

Total number of party entries by user

Total number of pizzas for all parties entered (accumulator)

Average number of pizzas for all the parties entered

Maximum number of people entered (use max algorithm, see additional resources section below)

Maximum cost of pizzas calculated for a party (use max algorithm)

Test your program using the following sample runs, making sure you get the same output when using the given inputs (in blue):

Welcome to my Pizza Party Statistics program!

Enter the number of people, average number of slices per person, and the cost of a pizza separated by a space: 10 2.6 10.50

Number of pizzas: 4

Cost of pizzas: $42.00

Tax: $2.94

Delivery: $8.99

Total Cost: $53.93

Do you want to enter more (y/n): y

Enter the number of people, average number of slices per person, and the cost of a pizza separated by a space: 9 2.5 10.95

Number of pizzas: 3

Cost of pizzas: $32.85

Tax: $2.30

Delivery: $7.03

Total Cost: $42.18

Do you want to enter more (y/n): y

Enter the number of people, average number of slices per person, and the cost of a pizza separated by a space: 14 3.2 14.95

Number of pizzas: 6

Cost of pizzas: $89.70

Tax: $6.28

Delivery: $19.20

Total Cost: $115.17

Do you want to enter more (y/n): n

Number of entries: 3

Total number of pizzas: 13

Average number of pizzas: 4.3

Maximum number of people: 14

Maximum cost of pizzas: $115.17

Thank you for using my program!

Check out Sample Assignment A06 - Algorithmic Design document

Check out Sample Assignment A06 - sampleA06.cpp

Complete zyBooks section CS161A 6. Loops Part I activities.

Complete all sections of your Algorithmic Design Document.

Include pseudocode in part d of the design document.

Follow these Coding Construct Requirements:

Use a do-while loop to prompt the user for at least one set of data for a pizza party.

When the program runs, you must read the number of people attending, the average number of slices per person and the cost of one pizza, separated by space exactly as shown in the sample run.

Display all statistics exactly as shown in the sample run.

Output all amounts formatted to 2 decimal places with proper money formatting.

Print a welcome and goodbye message.

Please open and compare your work with the grading rubric before submitting.

Remember to follow all style guidelines.

Download your Algorithmic Design Document as a PDF (File -> Download -> PDF), rename it to a06.pdf, and upload it to the D2L assignment by Wednesday.

Upload your a06.cpp C++ source file to the D2L assignment by Sunday.

Do your own work. Consult the syllabus for more information about academic integrity.

Additional Support

Check out Sample Assignment A06 - Algorithmic Design document

Check out Sample Assignment A06 - sampleA06.cpp

Finding the maximum and minimum from user input video.

Section 6.1 Loops (general) in zyBooks has information on finding the maximum number.

Post a question for the instructor in the Ask Questions! area of the Course Lobby.

i am stuck where i need to increment and the number of entries> can you write this code detailly so i can see how you did it bellow is my code and where i am stock

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

Advanced Database Systems For Integration Of Media And User Environments 98

Authors: Yahiko Kambayashi, Akifumi Makinouchi, Shunsuke Uemura, Katsumi Tanaka, Yoshifumi Masunaga

1st Edition

9810234368, 978-9810234362

More Books

Students also viewed these Databases questions

Question

Describe barriers to effective listening.

Answered: 1 week ago

Question

How will the members be held accountable?

Answered: 1 week ago

Question

a. Do team members trust each other?

Answered: 1 week ago