Starting Out with Python (4th Edition)
4th Edition
ISBN: 9780134444321
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 2, Problem 4MC
An Informal language that has no syntax rules and is not meant to be compiled or executed is called _________.
a faux code
b. pseudocode
c. Python
d. a flowchart
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
First, 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…
Forgetting 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. workstation
Exercise 1: Oreo cookies
PYTHON
Check out the nutritional values of an Oreo cookie (Koppelingen naar een externe site.).
Write code that does the following:
calculate how much one Oreo cookie is concerning: calories, sodium, carbohydrate, fat
create a user input that asks how much cookies you ate
calculate how much calories, etc. you consumed
warn the user that if he/she surpasses 2000kcal he/she should stop eating these darn delicious cookies
use variables!
Chapter 2 Solutions
Starting Out with Python (4th 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.8 - How do you suppress the print functions ending...Ch. 2.8 - How can you change the character that is...Ch. 2.8 - Prob. 24CPCh. 2.8 - Prob. 25CPCh. 2.8 - What does the statement print (format (65.4321,...Ch. 2.8 - What does the statement print (format (987654.129,...Ch. 2.9 - What are three advantages of using named...Ch. 2.9 - Write a Python statement that defines a named...Ch. 2.10 - Prob. 30CPCh. 2.10 - Prob. 31CPCh. 2.10 - Prob. 32CPCh. 2.10 - Prob. 33CPCh. 2.10 - Prob. 34CPCh. 2.10 - Prob. 35CPCh. 2.10 - Prob. 36CPCh. 2.10 - Prob. 37CPCh. 2.10 - Prob. 38CPCh. 2.10 - Prob. 39CPCh. 2.10 - Prob. 40CPCh. 2.10 - Prob. 41CPCh. 2.10 - Prob. 42CPCh. 2.10 - Prob. 43CPCh. 2.10 - Prob. 44CPCh. 2.10 - Prob. 45CPCh. 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 - A magic number is _______. a. a number that is...Ch. 2 - A _______ is a name that represents a value that...Ch. 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 - What is a magic number? Why are magic numbers...Ch. 2 - Assume a program uses the named constant PI to...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 - Write a turtle graphics statement that draws a...Ch. 2 - Write the turtle graphics statements to draw a...Ch. 2 - Write the turtle graphics statements to draw a...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...Ch. 2 - Planting Grapevines A vineyard owner is planting...Ch. 2 - Compound Interest When a bank account pays...Ch. 2 - Turtle Graphics Drawings Use the turtle graphics...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Practice Problem 2.37 solution page 155 You are given the task of patching the vulnerability in the XDR code sh...
Computer Systems: A Programmer's Perspective (3rd Edition)
What is the output produced by the following (when embedded in a correct program with x declared to be of type ...
Problem Solving with C++ (10th Edition)
How do you get the byte number of a files current read position? How do you get the byte number of a files curr...
Starting Out with C++ from Control Structures to Objects (9th Edition)
What output is produced by the following code? int[][] testArray = new int[3][4]; for (int row = 0; row testAr...
Java: An Introduction to Problem Solving and Programming (8th Edition)
Payroll Class Write a Payroll class that uses the following arrays as fields: employeeId. An array of seven int...
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
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
- Hello 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_forwardWhich one of a, b, c, d correct? During the writing of a program, you are confronted with a coding problem very similar to one you've already solved in another part of the program. One way to take advantage of this is by copying and pasting the a)comments b)code c) import statements you wrote previously. The problem is that any changes made to the copied code will then need to be applied to a) the original code b)all the javadoc comments c)the program’s API. A more effective strategy is to construct a a)try/catch block b)a method c)a ternary operator that is used in both situationsarrow_forwardVisual 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:arrow_forward
- At the end of the exercise, the students should be able to: Create a simple game that handles Software Requirements: Latest version of NetBeans IDE Java Development Kit (JDK) 8 Procedure: Create a folder named LastName_FirstName(please write Dahanyoon (ex. Reyes_Mark) in your local Create a new project named LabExer5A. Set the project location to your own The program shall: generate a random number from 1 to 50 for a player to guess; display a message that indicates whether the player’s guess is correct, too low, or too high; and prompt the user to keep on guessing until the correct value is entered Create a try-catch structure that will handle two (2) exceptions. These are when the user inputs the following: a number that is out of range (1 – 50) a letter or any non-numeric character Prompt the user so that he can guess again if an exception is Display the number of total Note: An invalid input (when an exception is thrown) is not considered a valid guess or attempt.arrow_forwardWrite, compile, and test a program named Lyrics that displays at least four lines of your favorite song using C++ programming language. Please make sure to utilize code " (\s*WriteLine\(".*"\);\s*){4,} " in your solution. Please use the code provided below as the base code for your solution. Code: using static System.Console; class Lyrics { staticvoidMain() { // Write your main here } }arrow_forwardI have recruited you in my software house and assign you a task to create a GUI based calculator application that has only 0-9 numbers and supports four arithmetic operation i.e. +, -, x, and / using java. Write the steps that you will follow to create that application?arrow_forward
- ##The uploaded pictures show the best question of the C Programing problem. Please check the pictures before answering. Thank you *Build a C program file* Design a Banking System with the following output ---------Welcome to BRAC Bank Banking Service--------Please choose one of the options below1. Current Account Information2. Deposit3. Withdraw4. Exit=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-Your Selection: 1You Choose to See your Current Account Information****Your Available Balance is:10500.67 TakaWould you like to do another transaction?YesNo(If yes Display the main menu again) (If no)-----Thank you for using BRAC Bank ATM Service----- ----Welcome to BRAC Bank Banking Service--------Please choose one of the options below1. Current Account Information2. Deposit3. Withdraw4. Exit=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-Your Selection: 2You choose to Deposit money. Your Balance is: 10500.67 Taka****Enter your amount to Deposit: 3525****Your New Balance is: 14,025.67…arrow_forwardHello, please may you write a piece of programming about anything of your choice in Python. You can pick anything, but the programming must include all of the following Python features below. Radio buttons Messages Menus Listbox Scrollbar Canvas Basic GUI elements using Tkinter Events Please then write a description explaining the programming code's design and functionality, very detailed.arrow_forwardProgramming Language= Python REVISED Joe's Automotive Joe's Automotive performs the following routine maintenance services: Computer Diagnostics - $30.00 Oil Change - $40.00 Lube Job - $30.00 Radiator Flush - $50.00 Transmission Flush - $110.00 FREE Visual Inspection - $0.00 Muffler Replacement - $210.00 Tire Rotation and Balance - $30.00 Wheel Alignment - $50.00 Write a GUI program with check buttons that allow the user to select any or all of these services. When the user clicks a button the total charges should be displayed.arrow_forward
- Create a program that calculates the amount of federal tax you will have to pay depending on a given salary. Hint: The second tax bracket does not mean you pay 20.5% on ALL of your income! https://www.moneysense.ca/save/tax-brackets-canada-provinces-2020/ need the answer in pythonarrow_forwardQ [An Introduction to Programming using Visual Basic Ed 11, Ch 6.2 Q# 26]- When $1,000 is invested at 5% simple interest, the amount grows by $50 each year. When money is invested at 5% interest compounded annually, the amount at the end of the year is 1.05 times the amount at the beginning of that year. Display the amounts for 9 years for a $1,000 investment at 5% simple and compound interest. My Answer: Private Sub btnComputeGrowthMoney_Click(sender As Object, e As EventArgs) Handles btnComputeGrowthMoney.Click 'Display simple interest and compound interest from 1 to 9 Dim simple, compound, principal As Decimal Dim rate As Double Dim year As Integer lstInterest.Items.Clear() principal = 1000 rate = 0.05 simple = principal * (1 + rate * year) compound = principal * (1 + rate) ^ year For year = 1 To 9 lstInterest.Items.Add("YEAR" & " " & "SIMPLE INTEREST" & " " & "COMPOUND…arrow_forwardPlease show me how to make a multiple line comment in Python. I know how to do a single line comment but unable to do it for multiple lines as a whole. Thanks in advance.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
Structured Chart; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=vdUO-sGA1DA;License: Standard YouTube License, CC-BY
Introduction to Structure Charts; Author: Christopher Kalodikis;https://www.youtube.com/watch?v=QN2bjNplGlQ;License: Standard Youtube License