Starting Out with Programming Logic and Design (4th Edition)
4th Edition
ISBN: 9780133985078
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 3, Problem 4PE
Program Plan Intro
Automobile Costs
Program Plan:
- Declare a method named “automobile_cost ()”.
- Prompt the user to enter loan payment and store in a variable “loan_payment”.
- Prompt the user to enter insurance and store in a variable “insurance_amount”.
- Prompt the user to enter gas amount and store in a variable “gas_amount”.
- Prompt the user to enter the oil amount and store in a variable “oil_amount”.
- Prompt the user to enter tire amount and store in a variable “tires_amount”.
- Prompt the user to enter maintenance amount and store in a variable “maintenance_amount”.
- Call the method “tot_mon_cost()” to calculate the total monthly cost by passing “loan_payment”, “insurance_amount”, “gas_amount”, “oil_amount”, “tires_amount”, “maintenance_amount” as arguments.
- Define a method “tot_mon_cost()”.
- Calculate total monthly cost and store it in a variable “tot_cost”.
- Display the total monthly cost.
- Call the method “total_annual_cost ()” by passing “tot_cost” as the argument.
- Define a method “total_annual_cost()”.
- Calculate the total annual cost and store it in a variable “annaul_cost”.
- Display the total annual cost.
- Call “automobile_cost()” method.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Financial Assistance Application
Create the Financial Assistance Application. A non-governmental organization
needs your application to calculate the amount of financial assistance for needy
families. The formula is as follows:
• If the annual household income is between $30,000 and $40,000 and the house-
hold has at least three children, the amount is $1,000 per child.
• If the annual household income is between $20,000 and $30,000 and the house-
hold has at least two children, the amount is $1,500 per child.
• If the annual household income is less than $20,000, the amount is $2,000 per
child.
Implement a function for this computation. The program asks for the household
income and number of children for each applicant, printing the amount returned
by your function. Use -1 as a sentinel value for the input. The program output
should be formatted as shown in the Sample Run.
Note: You must use at least one function in your code.
Paint Job Estimator A painting company has determined that for every 115 square feet of wall space, 1 gallon of paint and 8 hours of labor will be required. The company charges $20.00 per hour for labor. Create an application that allows the user to enter the square feet of wall space to be painted and the price of the paint per gallon. The program should display the following data: • The number of gallons of paint required • The hours of labor required • The cost of the paint • The labor charges • The total cost of the paint job
ProgramName: Chapter3StadinumSeatingProgram
There are three seating categories at an athletic stadium. For a baseball
game, Class A seats cost $15 each, Class B seats cost $12 each, and Class
C seats cost $9 each. Create an application that allows the user to enter
the number of tickets sold for each class. The application should be able
to display the amount of income generated from each class of ticket sales
and the total revenue generated. The application's form should resemble
the one shown in below.
X
A Stadium Seating
Revenue Generated
Tickrts Sød
Enter the rumber of tickets sold
for coch dass of sects.
Cass A
Class B
Cass A:
lass C
Caes B:
Oless C
Total
Calculate
Revenue
Cear
Ext
Use the following sets of test data to determine if the application is
calculating properly:
Chapter 3 Solutions
Starting Out with Programming Logic and Design (4th Edition)
Ch. 3.1 - What is a module?Ch. 3.1 - Prob. 3.2CPCh. 3.1 - Prob. 3.3CPCh. 3.1 - Prob. 3.4CPCh. 3.1 - Prob. 3.5CPCh. 3.2 - In most languages, a module definition has what...Ch. 3.2 - Prob. 3.7CPCh. 3.2 - Prob. 3.8CPCh. 3.2 - Prob. 3.9CPCh. 3.3 - What is a local variable? How is access to a local...
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
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
- Additional Notes: USING C# You cannot add two flights with the same flight number When you select “View Flights”, a list containing the Flight number, origin and destination for each flight must be shown. When you select “View a particular flight”, a list of all flights should be displayed and the user must be allowed to enter a particular flight number. All the information on that selected flight must be displayed. All the customers who are booked on that flight must SPECIAL NOTE: A customer can only be deleted if there are no bookings for that customer. A flight can only be deleted if there are no customers booked on the flight. You must extend the core design and add the functionality to add customers and booking features to the system. The information that must be recorded on a customer is as follows: A customer ID must be assigned to each customer by the system. (NOT entered by the user) The customer’s first name The customer’s last name. The customer’s phone (a string type…arrow_forwardITP 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…arrow_forwardProgramming Problem 1 – Calculating a Number As part of the discussion forum for this unit, you will be solving a programming problem from the book. This assignment will have you calculating the chapter and the number of the programming problem that you will solve for the online discussion forum. To calculate the chapter from which you solve the programming exercise: • Divide the integer number representing your student ID by 3, consider the remainder and increment it by 3. The result you obtain represents the chapter number, and it should be either 2, 3, 4, or 5. Depending on the chapter number obtained above, consider the following rules in calculating the problem number to solve: • If the chapter number is 3, divide your student ID by 34, consider the remainder and increment it by 1. The result you obtain represents the number of the programming exercise you will solve for online discussions, which should be from chapter 3. • If the chapter number is 4 (you need to go to chapter 6),…arrow_forward
- C# onlyarrow_forwardInstructions You are working as a computer programmer for a mortgage company that provides loans to consumers for residential housing. Your task is to create an application to be used by the loan officers of the company when presenting loan options to its customers. The application will be a mortgage calculator that determines a monthly payment for loans and produces an amortization schedule for the life of the loan. The company offers 10-, 15-, and 30-year fixed loans. Inputs The program should initially prompt the user (the loan officer) for the principal of the loan (i.e. the amount that is being borrowed). It should then ask him or her to enter an annual interest rate for the loan. The final input should be the number of years that the loan will be outstanding. Because the company only offers three different terms (10-, 15-, and 30-year loans), the program should ensure that no other terms are entered. Payment Calculator The formula to calculate the monthly payment for a fixed…arrow_forwardGPA Calculator Students are concerned about their GPA. They need to calculate it accurately every semester to monitor their progress. Develop a GPA calculator that follows the AOU regulations (AOU-OU Grade Scale) using C# programming language. The application asks the student to enter his numeric grade of each course and the course's credit hours. Accordingly, the application calculates the student's GPA after converting the numeric grade to letter grade. The GPA calculation should produce floating-point results. Display the results rounded to the nearest hundredth. You should store the letter grades of all student's courses in an array. The final grade of the student should be also calculated. Sample I/O Enter the course grade (-1 to end): 93 Enter the course credit hours: 3 Enter the course grade (-1 to end): 74 Enter the course credit hours: 2 Enter the course grade (-1 to end): 60 Enter the course credit hours: 3 Enter the course grade (-1 to end): -1 The grades of your courses…arrow_forward
- c# code with formsarrow_forwardProblem Statement for Stock Transaction Program George uses the services of a brokerage firm to buy and sell stocks. Each time he buys or sells a block of stocks, he must pay the brokerage firm a commission of 1.5% per share.Design a program that allows George to enter the number of shares in the block, the price per share when he bought the block and the price per share when he sold the block. The program should display the amount of money he paid to buy the stock and the amount of the commission. The amount of money he made when he sold the stock and the amount of the commission, the amount of profit (or loss) he madeafter paying for the purchase cost and both commissions. There are three user inputs for this problem: the number of shares in the block, the price per share when the block was bought, the price per share when the block was sold. There is one constant: the percentage of the commission (1.5%) The amount to buy the stock is: number of shares in block * purchase price per…arrow_forwardChange the order of the numbered Use Case Definition steps to correspond to the following problem definition: A college provides every incoming freshman with a gift card for a choice of two specialty restaurants within the cafeteria. Students should select one specialty restaurant they want. A program opens a window that displays each specialty restaurant one picture at a time when a student clicks the corresponding button. After making a decision, the student should click the Select Restaurant button. After selecting a restaurant, the student should exit the application.arrow_forward
- Python programming language You will be creating an application to calculate the maximum amount of contribution a person can make to a Roth IRA based on their age and income. Over 50 years old and your contribution limit goes up from $6000 to $7000 dollars. However, if the person is married and the combined household income is over $206,000 a year, or a single person with income over $139,000, you are not allowed to contribute. Write an application that asks the user their age and their income. Using this information use a nested if statement to calculate the maximum allowable contribution.arrow_forwardC# program using the visual studio and create a custom classes and methods to complete the programarrow_forwardIn conclusion, it is important to define a variable by its data type, but this is not always enough. Data type, variable name, memory location, and initial value must all be specified when declaring a variable (if any). This guarantees that the variable is properly managed by the computer and is available for usage in the application.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:CengageC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning