Starting Out with Python plus MyProgrammingLab with Pearson eText -- Access Card Package (3rd Edition)
3rd Edition
ISBN: 9780133862256
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
Chapter 2, Problem 10MC
Program Description Answer
The highlighted part represents the comments placed in a
Hence, the correct answer is option “A”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Visual Studio C++
Define a problem with user input, user output, mathematical computation and something else from review lecture 4. If no output explain the reason why and what you are going to do make sure it does not happen again aka learning from your mistakes.Problem Statement:Design:Code:Output:
Hello my name is Carlos and I am having trouble with getting my code assignment errors to be solved in visual studio like I have been tasked. Hever is my exercise and I am having a hard time fixing the errors to run through debug:
Program Exercise:
int main (void)
{
// Local Declarations
a int;
b float, double;
c, d char;
//Statements
printf("The end of the program.");
return 0;
} //main
Need assistance in determining what went wrong with my code and why I cannot seem to fix all of the issues. I am using visual studio code. I need to have my python code corrected as soon as possible and learn where my errors are.
#The main function
def main():
endProgram = "no"
endOrder = "no"
totalBurger = 0.0
totalFry = 0.0
totalSoda = 0.0
total = 0.0
tax = 0.0
subtotal = 0.0
option = 0
burgerCount = 0
fryCount = 0
sodaCount = 0
# Reset Variables
while ("endProgram" == "no"):
# reset variables totalburger, totalFry, totalSoda, total, tax, subtotal
totalBurger = 0.0
totalFry = 0.0
totalSOda = 0.0
total = 0.0
tax = 0.0
subtotal = 0.0
endOrder = "no"
# Loop that takes meal order
while ("endOrder" == "no"):
print ("Enter 1 for Yum Yum Burger")
print ("Enter 2 for Grease Yum Fries")
print ("Enter 3 for Soda Yum")
option = int(input("Enter options: "))
if (option == 1):
totalBurger =…
Chapter 2 Solutions
Starting Out with Python plus MyProgrammingLab with Pearson eText -- Access Card Package (3rd Edition)
Ch. 2.1 - Who is a programmers customer?Ch. 2.1 - What is a software requirement?Ch. 2.1 - What is an algorithm?Ch. 2.1 - What is pseudocode?Ch. 2.1 - Prob. 5CPCh. 2.1 - Prob. 6CPCh. 2.3 - Write a statement that displays your name.Ch. 2.3 - Write a statement that displays the following...Ch. 2.3 - Write a statement that displays the following...Ch. 2.5 - Prob. 10CP
Ch. 2.5 - Which of the following are illegal variable names...Ch. 2.5 - Prob. 12CPCh. 2.5 - Is the following assignment statement valid or...Ch. 2.5 - Prob. 14CPCh. 2.5 - Look at the following assignment statements:...Ch. 2.5 - What will be displayed by the following program?...Ch. 2.6 - You need the user of a program to enter a...Ch. 2.6 - Prob. 18CPCh. 2.7 - Prob. 19CPCh. 2.7 - Prob. 20CPCh. 2.7 - Prob. 21CPCh. 2 - A ______ error does not prevent the program from...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...Ch. 2 - A ______ is a sequence of characters. a. char...Ch. 2 - Prob. 7MCCh. 2 - Prob. 8MCCh. 2 - A string literal in Python must be enclosed in...Ch. 2 - Prob. 10MCCh. 2 - A(n) __________ makes a variable reference a value...Ch. 2 - This symbol marks the beginning of a comment in...Ch. 2 - Which of the following statements will cause an...Ch. 2 - In the expression 12 + 7, the values on the right...Ch. 2 - This operator performs integer division. a. // b....Ch. 2 - This is an operator that raises a number to a...Ch. 2 - This operator performs division, but instead of...Ch. 2 - Prob. 18MCCh. 2 - Which built-in function can be used to read input...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 Python, the first character of a variable name...Ch. 2 - If you print a variable that has not been assigned...Ch. 2 - What does a professional programmer usually do...Ch. 2 - What is pseudocode?Ch. 2 - Computer programs typically perform what three...Ch. 2 - If a math expression adds a float to an int, what...Ch. 2 - What is the difference between floating-point...Ch. 2 - Write Python code that prompts the user to enter...Ch. 2 - Write Python code that prompts the user to enter...Ch. 2 - Write assignment statements that perform the...Ch. 2 - Assume the variables result, w, x, y, and z are...Ch. 2 - Write a Python statement that assigns the sum of...Ch. 2 - Write a Python statement that subtracts the...Ch. 2 - Write a Python statement that multiplies the...Ch. 2 - Prob. 8AWCh. 2 - What would the following display? num = 99 num = 5...Ch. 2 - Assume the variable sales references a float...Ch. 2 - Assume the following statement has been executed:...Ch. 2 - What will the following statement display?...Ch. 2 - Personal Information Write a program that displays...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 Write a program that will ask the user...Ch. 2 - Miles-per-Gallon A car's miles-per-gallon (MPG)...Ch. 2 - Tip, Tax, and Total Write a program that...Ch. 2 - Celsius to Fahrenheit Temperature Converter Write...Ch. 2 - Ingredient Adjuster A cookie recipe calls for the...Ch. 2 - Male and Female Percentages Write a program that...Ch. 2 - Stock Transaction Program Last month, Joe...
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
- Short notes placed in different parts of a program, explaining how those parts of the programwork, are called .a. commentsb. reference manualsc. tutorialsd. external documentationarrow_forwardCreate a C++ console project in Visual Studio or another tool. Create an application that converts a student’s grade percentage to a letter grade following the rules below: Grade Percentage A 100-90 B 89-80 C 79-70 D 69-60 F 59-0 Your code should prompt for and get the student’s percentage as input, and output an error message or a letter grade. Note: Your code should test these cases: Percentages less than 0 – error message. Percentages greater than 100 – error message. Percentages in the range 0-100 – letter grade. Please make sure your code can handle these cases. Tips: Use operator and ‘||’ for the conditional control statement. Use instruction ‘if’ for conditional control. Make the following edits to the code file: Complete the header comment. 2) Declare two double variables: grade and percentage. 3) Assign the value of percentage from input. 4) End program if percentage is smaller than 0 and…arrow_forward(c program only) 2. Jack `N Poyby CodeChum Admin Jack `N Poy is a very common game since our childhood days. Just thinking about it makes me reminisce how I crushed my cousin in this game until he cried ? I want to feel the glory again of being very good at something. Could you help me recreate the game? It's really simple. In Jack `N Poy, there are two players who both select either one of the following options: RockPaperScissors The winner is selected depending on the following rules: Rock beats ScissorsScissors beats PaperPaper beats RockIf both players chose the same option, then it's a tie Instructions: In the code editor, you are provided with an enum called option which contains three possible named values:ROCK - 'r'PAPER - 'p'SCISSORS - 's'Your task is to ask two users for there chosen options. And then based on their options, determine the winner.Input 1. Option selected by Player 1 2. Option selected by Player 2 Output If Player 1 wins, print the message "Player 1…arrow_forward
- Please complete this program in C++ Please enusre that there is plenty of comments. PLENTY even if unessessary. Please include screenshots of actual code, screenshots of output, and code in the browser so I can copy and paste. Thank you.arrow_forwardFirst, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==> Close All Projects). Then create a new Java application called "IncomeTax" (without the quotation marks) that prompts a user for his or her marital status (single or married) and annual income (a double value), and then uses nested if statements to compute that person's tax, based on the simplified tax-rate table below. Output of your program should look close to the following and should be constructed using both String literals and variables for income, tax rate, and income tax. Based on a status of "single" and an annual income of $10000.00,the income tax is 15.00% of $10000.00, which equals $1500.00.Simplified Tax-Rate Table Income Marital Status - Single Marital Status - Married <= $30,000 15% 12% > $30,000 25% 20% Thoughts Note the requirement for this program to use nested if statements. This requirement is intended to help you build some…arrow_forwardThis will need to be a C PROGRAM BUILT IN 2019 VISUAL STUDIO For this Exercise you will need to write a program that converts and prints a user input measurement in inches into the following 4 categories. foot yard centimeter meter You will need to do the calculations to find each of the categories. You will need to have the output variables set to float with 3 decimal places. Thank youarrow_forward
- I needed help writing the code using visual basic not jave thank you. An Internet service provider has three different subscription packages for its customers: Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour. Package B: For $13.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour. Package C: For $19.95 per month unlimited access is provided. Write a program that calculates a customer’s monthly bill. It should ask the user to enter the letter of the package the customer has purchased (A, B, or C) and the number of hours that were used. It should then display the total charges.arrow_forwardForgetting a semi-colon at the end of a statement or misspelling a certain command is an example of Select one: a. compile error b. logical error c. runtime error d. computer error It is an extremely fast computer, which can execute hundreds of millions of instructions per second. Select one: a. all of the choices b. minicomputer c. supercomputer d. mainframe computer Refers to a single user computer system having moderately powerful processor. Select one: a. mainframe computer b. PC c. minicomputer d. workstationarrow_forwardWhich of the following correctly describes the process of writing a computer program? writing instructions that are syntactically correct testing the program with a variety of inputs debugging the program when it doesn’t work as expected all the abovearrow_forward
- Use Raptor to answer the following questions The manager of the Super Supermarket would like to be able to computethe unit price for products sold there. To do this, the program should inputthe name and price of an item per pound and its weight in pounds andounces. Then it should determine and display the unit price (the price perounce) of that item and the total cost of the amount purchased. You willneed the following variables:ItemName Pounds OuncesPoundPrice TotalPrice UnitPriceYou will need the following formulas:UnitPrice = PoundPrice/16TotalPrice = PoundPrice * (Pounds + Ounces/16)arrow_forwardHello All, Need help with his homework question and how to code it properly into a module. Question is as follows: Question 3.) Financial experts advise home/property owners to insure their homes to at least 80% of the amount it would cost to replace that home. Design a modular program that asks the user to enter the replacement cost of their home, and then displays the minimum amount of insurance required the owner should buy for their home. All coding is in Python. Thank you.arrow_forward(Using Visual Basic language) Marketing Terms? The markup of an item is the difference between its selling price and its purchase price. Two other marketing terms are percentage markup=makeup/(purchase price) and profit margin= makeup/(selling price) where the quotients are expressed as percentages. Write a program that computes the markup, percentage markup, and profit margin of an item. Note: The output format of your program should be exactly the same as given below One possible outcome: Enter purchase price: 215 Enter selling price: 645 Markup: $430.0 Percentage markup: 200.0% Profit margin: 66.67%arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage