Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
5th Edition
ISBN: 9780134801155
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Concept explainers

Question
Book Icon
Chapter 3, Problem 8PE
Program Plan Intro

Stadium Seating

Program Plan:

  • Declare a “main()” function. Inside this function,
    • Get the number of tickets sold for Class A from the user and store it in a variable “numberOfTicketsA”.
    • Get the number of tickets sold for Class B from the user and store it in a variable “numberOfTicketsB”.
    • Get the number of tickets sold for Class C from the user and store it in a variable “numberOfTicketsC”.
    • Calculate cost generated for Class A and store it in a variable “costA”.
    • Calculate cost generated for Class B and store it in a variable “costB”.
    • Calculate cost generated for Class C and store it in a variable “costC”.
    • Call the function “calculateIncome ()” by passing “costA”, “costB”, and “costC” as arguments.
  • Give function definition for “calculateIncome ()”. This function accepts three arguments and store those arguments in the corresponding parameter variables named “A”, “B”, and “C”. Inside this function,
    • Calculate total income generated and store it in a variable “incomeGenerated”.
    • Finally print the amount on the screen.
  • Call the main() function.

Blurred answer
Students have asked these similar questions
GreenLawn a local lawn care company has different pricing policies for its customers. GreenLawn sends out monthly invoices and will give discounts if payments are made within 5 days. The discounting policy is as follow: If the amount of the monthly bill is greater than $300, subtract 4 percent from the invoice; if the amount is between $300 and $100, subtract a 2-percent discount; if the amount is less than $100, do not apply any discount. All bills made via the web automatically receive an extra 3-percent discount. Develop a decision for GreenLawn discounting decisions. Decision Table submission: Include the initial table with all rules, and the most simplified table. Use different colors in the columns to easily show how columns are collapsed/simplified.   please do not provideo solution in image format thank you!
Automobile Costs Problem:Design a modular program that asks the user to enter the monthly costs for the following expenses incurred from operating his or her automobile: loan payment, insurance, gas, oil, tires, and maintenance. The program should then display the total monthly cost of these expenses, and the total annual cost of these expenses.
ITP 100 Programming Logic & Design Project In this project, you will design a program to perform the following task:  Design a program, the STAR Movie Rating App, which can be installed in a kiosk in theaters and patrons can immediately give their rating of a movie they’ve just seen. Each theater patron enters a value of 0, 1, 2, 3, or 4 indicating the number of stars that the patron awards to the App’s featured movie of the week.  If a user enters a star value that does not fall in the correct range, the program will prompt the user continuously until a correct value is entered. The program executes continuously until a negative number is entered to quit. At the end of the program display: the number of ratings given the average star rating for the movie of the week the following message depending on the average rating. 3 or better – “Great movie choice!” 2 up to 3 – “Good movie choice!” 1 up to 2 – “Not a Good movie choice.” 0 up to 1 – “Bowling would have been a better…

Chapter 3 Solutions

Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)

Ch. 3.3 - What is a variables scope?Ch. 3.3 - Prob. 3.12CPCh. 3.3 - Prob. 3.13CPCh. 3.4 - Prob. 3.14CPCh. 3.4 - What are the variables that receive pieces of data...Ch. 3.4 - Prob. 3.16CPCh. 3.4 - Prob. 3.17CPCh. 3.4 - Prob. 3.18CPCh. 3.5 - What is the scope of a global variable?Ch. 3.5 - Give one good reason that you should not use...Ch. 3.5 - Prob. 3.21CPCh. 3 - A group of statements that exist within a program...Ch. 3 - Prob. 2MCCh. 3 - The first line of a module definition is known as...Ch. 3 - Prob. 4MCCh. 3 - Prob. 5MCCh. 3 - A design technique that programmers use to break...Ch. 3 - Prob. 7MCCh. 3 - A _____ is a variable that is declared inside a...Ch. 3 - A(n) ____ is the part of a program in which a...Ch. 3 - A(n) ____ is a piece of data that is sent into a...Ch. 3 - A(n) ____ is a special variable that receives a...Ch. 3 - When _____, only a copy of the argument's value is...Ch. 3 - When ____, the module can modify the argument in...Ch. 3 - A variable that is visible to every module in the...Ch. 3 - When possible, you should avoid using _____...Ch. 3 - The phrase divide and conquer means that all of...Ch. 3 - Prob. 2TFCh. 3 - Module names should be as short as possible.Ch. 3 - Prob. 4TFCh. 3 - A flowchart shows the hierarchical relationships...Ch. 3 - Prob. 6TFCh. 3 - A statement in one module can access a local...Ch. 3 - In most programming languages, you cannot have two...Ch. 3 - Programming languages typically require that...Ch. 3 - Most languages do not allow you to write modules...Ch. 3 - When an argument is passed by reference, the...Ch. 3 - Prob. 12TFCh. 3 - Prob. 1SACh. 3 - Prob. 2SACh. 3 - Prob. 3SACh. 3 - What is a local variable? What statements are able...Ch. 3 - In most languages, where does a local variables...Ch. 3 - What is the difference between passing an argument...Ch. 3 - Prob. 7SACh. 3 - Design a module named timesTen. The module should...Ch. 3 - Examine the following pseudocode module header,...Ch. 3 - Look at the following pseudocode module header:...Ch. 3 - Assume that a pseudocode program contains the...Ch. 3 - Design a module named getNumber, which uses a...Ch. 3 - What will the following pseudocode program...Ch. 3 - What will the following pseudocode program...Ch. 3 - Find the error in the following pseudocode. Module...Ch. 3 - Find the error in the following pseudocode. Module...Ch. 3 - Find the potential error in the following...Ch. 3 - Prob. 4DECh. 3 - Kilometer Converter Design a modular program that...Ch. 3 - Prob. 2PECh. 3 - How Much Insurance? Many financial experts advise...Ch. 3 - Prob. 4PECh. 3 - Prob. 5PECh. 3 - Prob. 6PECh. 3 - Calories from Fat and Carbohydrates A nutritionist...Ch. 3 - Prob. 8PECh. 3 - Prob. 9PECh. 3 - Monthly Sales Tax A retail company must file a...Ch. 3 - Prob. 11PE
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr