What would be an algorithm for finding the average
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
What would be an algorithm for finding the average?

Transcribed Image Text:The flowchart shown represents a simple purchasing calculation program for a game store, "FrostBlade Games."
### Flowchart Steps:
1. **Start**: The process begins with a welcome message.
- Output: "Welcome to FrostBlade Games"
2. **Input New Games**: The user is prompted to enter the number of new games they wish to purchase.
- Output: "Enter the number of new games to be purchased."
- Input: `amtNew`
3. **Input Old Games**: The user is asked to enter the number of old games they wish to purchase.
- Output: "Enter the number of old games to be purchased."
- Input: `amtUsed`
4. **Calculate Total Cost**: The total cost is computed using the formula:
- `Total = amtNew * NEWCOST + amtUsed * USEDCOST`
5. **Calculate Average Cost**: The average cost of the games is also calculated:
- `Average = (amtNew * NEWCOST + amtUsed * USEDCOST) / 2`
6. **Output Total Cost**: The total cost is displayed to the user.
- Output: "The Total Cost is: $" & `Total`
7. **Output Average Cost**: The average cost is displayed to the user.
- Output: "The Average is: " & `average`
8. **End**: The process concludes.
### Diagram Explanation:
- The flowchart uses a mix of rectangles (processes) and parallelograms (inputs/outputs).
- It progresses linearly from top to bottom, guiding users through each step of the transaction calculation.
- Key operations like input, calculation, and output stages are clearly defined.
This flowchart effectively demonstrates a simple program to calculate and display the total and average cost of purchasing new and used games.
Expert Solution

Introduction
Algorithm is a step by step procedure for solving a problem
Step by step
Solved in 2 steps

Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education