1. Engineering
  2. Computer Science
  3. write a c program that compares two sizes of pizza...

Question: write a c program that compares two sizes of pizza...

Question details

Write a C program that compares two sizes of pizza to determine which is the better buy. The program prompts the user to enter the diameter in inches and the price for each of two sizes of pizza then prints out the cost per square inch for each of the two sizes of pizza and will tell which is the better buy, that is, which has the lowest cost per square inch. (If they are the same cost per square inch, we will consider the smaller one to be the better buy.). Here is a sample output: Welcome to the Pizza Consumers: Enter diameter of small pizza (in inches): 10 Enter the Price of small pizza: $7.5 Enter diameter of small pizza (in inches): 13 Enter the Price of small pizza: $14.75 Small Pizza: Diameter 10 inches Price $7.5 per square inch $0.10 Large Pizza: Diameter 13 inches Price $14.75 per square inch $0.11 The small one is the better buy. Program Requirements: The code should be neatly indented, use meaningfu variable names and named constants and have appropriate, succinct comments. Your program must not use any loop statements. Grading Scheme: are as follows: This homework is worth 50 points. The specifications and points for each component 1. User Documentation (15 points) A neatly formatted document that addresses all of the following points in an itemized manner: () The purpose of the program (ii) Where the program is located, and how it is to be compiled and executed.i) Any particular issues that the user should be aware of. This includes any peculiarities of the program, and things the user should be careful about. The user document must be written such that a non- programmer can understand it. 2. Script file showing the source, compilation and test runs. (25 points) Using the script command start a script session, (see closed lab for details). Within this session, do the following a. Display the program (i.e, source code)... This is done using the command: cat filename> b. Compile the program. c. Test the program. Testing is a critical part of software development. Test cases are usually carefully designed to make sure that all aspects of the program are verified. You should carry out multiple tests to check various aspects of the behavior of the program. d. Exit the script session. 3. Test report. (10 points) Report the test results. 4. Items to submit. Create a folder Homework1. Place the source code (the cppfile), the script file, user document and test report in this folder; upload the folder to your CourseFiles folder for the course.
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution