Starting Out with Programming Logic and Design (4th Edition)
Starting Out with Programming Logic and Design (4th Edition)
4th Edition
ISBN: 9780133985078
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 2, Problem 8PE

Tip, Tax, and Total

Design a program that calculates the total amount of a meal purchased at a restaurant. The program should ask the user to enter the charge for the food, and then calculate the amount of a 15 percent tip and 7 percent sales tax. Display each of these amounts and the total.

Blurred answer
Students have asked these similar questions
Fat Gram Calculator   Design a program that asks for the number of fat grams and calories in a food item. Validate the input as follows:  Make sure the number of fat grams and calories is not less than 0.  According to nutritional formulas, the number of calories cannot exceed fat grams x 9. Make sure that the number of calories entered is not greater than fat grams x 9. Once corrected data has been entered, the program should calculate and display the percentage of calories that come from fat. Use the following formula: Percentage of calories from fat = (Fat grams x 9) / calories ANSWER IN PSEUDOCODE
The monthly payment for a given loan pays the principal and the interest. The monthly interest is computed by multiplying the monthly interest rate and the balance (the remaining principal). The principal paid for the month is therefore the monthly payment minus the monthly interest. Write a program that lets the user enter the loan amount, number of years, and interest rate and displays the amortization schedule for the loan in visual basic
Sales TaxWrite a program that will ask the user to enter the amount of a purchase. The program shouldthen compute the state and county sales tax. Assume the state sales tax is 5 percent and thecounty sales tax is 2.5 percent. The program should display the amount of the purchase, thestate sales tax, the county sales tax, the total sales tax, and the total of the sale (which is the sumof the amount of purchase plus the total sales tax). Hint: Use the value 0.025 to represent 2.5 percent, and 0.05 to represent 5 percent.

Chapter 2 Solutions

Starting Out with Programming Logic and Design (4th Edition)

Ch. 2.2 - Prob. 2.11CPCh. 2.2 - Prob. 2.12CPCh. 2.2 - Summarize three common rules for naming variables.Ch. 2.2 - Prob. 2.14CPCh. 2.2 - Look at the following pseudocode statement: Input...Ch. 2.2 - Prob. 2.16CPCh. 2.2 - Prob. 2.17CPCh. 2.2 - What two steps usually take place when a program...Ch. 2.2 - What does the term user-friendly mean?Ch. 2.3 - Prob. 2.20CPCh. 2.3 - When you assign a value to a variable, what...Ch. 2.3 - Summarize the mathematical order of operations, as...Ch. 2.3 - Prob. 2.23CPCh. 2.3 - Prob. 2.24CPCh. 2.4 - What two items do you usually specify with a...Ch. 2.4 - Does it matter where you write the variable...Ch. 2.4 - What is variable initialization?Ch. 2.4 - Prob. 2.28CPCh. 2.4 - What is an uninitialized variable?Ch. 2.7 - Prob. 2.30CPCh. 2.7 - Prob. 2.31CPCh. 2.7 - Prob. 2.32CPCh. 2 - A error does not prevent the program from running,...Ch. 2 - Prob. 2MCCh. 2 - A(n) _______ is a set of well-defined logical...Ch. 2 - An informal language that has no syntax rules, and...Ch. 2 - A ____ is a diagram that graphically depicts the...Ch. 2 - Prob. 6MCCh. 2 - Prob. 7MCCh. 2 - Prob. 8MCCh. 2 - Prob. 9MCCh. 2 - A(n) _____ is a message that tells (or asks) the...Ch. 2 - A(n) ________ sets a variable to a specified...Ch. 2 - In the expression 12 + 7, the values on the right...Ch. 2 - A(n) _____ operator raises a number to a power. a....Ch. 2 - A(n) _________ operator performs division, but...Ch. 2 - A(n) ____ specifies a variable's name and data...Ch. 2 - Assigning a value to a variable in a declaration...Ch. 2 - Prob. 17MCCh. 2 - Prob. 18MCCh. 2 - A debugging process in which you imagine that you...Ch. 2 - Prob. 20MCCh. 2 - Programmers must be careful not to make syntax...Ch. 2 - In a math expression, multiplication and division...Ch. 2 - Variable names can have spaces in them.Ch. 2 - In most languages, the first character of a...Ch. 2 - Prob. 5TFCh. 2 - In languages that require variable declarations, a...Ch. 2 - Uninitialized variables are a common cause of...Ch. 2 - The value of a named constant cannot be changed...Ch. 2 - Hand tracing is the process of translating a...Ch. 2 - Prob. 10TFCh. 2 - What does a professional programmer usually do...Ch. 2 - What is pseudocode?Ch. 2 - Computer programs typically perform what three...Ch. 2 - What does the term user-friendly mean?Ch. 2 - What two things must you normally specify in a...Ch. 2 - What value is stored in uninitialized variables?Ch. 2 - Design an algorithm that prompts the user to enter...Ch. 2 - Design an algorithm that prompts the user to enter...Ch. 2 - Write assignment statements that perform the...Ch. 2 - Assume the variables result, x, y, and z are all...Ch. 2 - Write a pseudocode statement that declares the...Ch. 2 - Write a pseudocode statement that declares the...Ch. 2 - Write a pseudocode statement that assigns the...Ch. 2 - Write a pseudocode statement that assigns the sum...Ch. 2 - Write a pseudocode statement that subtracts the...Ch. 2 - Write a pseudocode statement that multiplies the...Ch. 2 - If the following pseudocode were an actual...Ch. 2 - Prob. 12AWCh. 2 - If the following pseudocode were an actual...Ch. 2 - If the programmer translates the following...Ch. 2 - The following code will not display the results...Ch. 2 - Find the error in the following pseudocode....Ch. 2 - Find the error in the following pseudocode....Ch. 2 - Find the error in the following pseudocode....Ch. 2 - Find the error in the following pseudocode....Ch. 2 - Personal Information Design a program that...Ch. 2 - Sales Prediction A company has determined that its...Ch. 2 - Land Calculation One acre of land is equivalent to...Ch. 2 - Total Purchase A customer in a store is purchasing...Ch. 2 - Distance Traveled Assuming there are no accidents...Ch. 2 - Sales Tax Design a program that will ask the user...Ch. 2 - Miles-per-Gallon A cars miles-per-gallon (MPG) can...Ch. 2 - Tip, Tax, and Total Design a program that...Ch. 2 - Celsius to Fahrenheit Temperature Converter Design...Ch. 2 - Stock Transaction Program Last month Joe purchased...Ch. 2 - Cookie Calories A bag of cookies holds 40 cookies....Ch. 2 - Male and Female Percentages Design a program that...Ch. 2 - Ingredient Adjuster A cookie recipe calls for the...
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
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Expressions in C++ | C++ tutorial for beginners; Author: Tutorial Mart;https://www.youtube.com/watch?v=XHbsZGpmRc8;License: Standard YouTube License, CC-BY
expression in python # python expressions; Author: Abhishek Tripathi;https://www.youtube.com/watch?v=Cc-kJGRjH6k;License: Standard Youtube License