subject

Critical Thinking QuestionsIn this unit, you used this code to ensure that the user would enter a number and not letters:while True: try: num = int(input("Enter your age: ")) break except ValueError: print("That's not a number!")How could you modify this code to be sure that the user enters a positive number?You are writing a program in JavaScript that asks users to input their grade level. You want to check for errors and give the users an error message if they 1) enter a blank, 2) enter letters instead of numbers, or 3) enter a number greater than 12. What would the pseudocode look like for a function that would check these things?In this lesson, you learned that the five most common Python errors are incorrect indentation, count errors in loops, confusion of single and double equal signs, punctuation errors, and spelling errors. Based on your own programming experience, what are some other common errors? What are some things that you can do to avoid or easily catch those errors?You are creating a function that will test whether a number is greater than 10 using these lines of code:if a < 10: print(a "is greater than 10")Can you identify one syntax error and one logic error in these lines? Why do you think a programmer might have made the logic error?You are creating a program in which the user will input his or her age. The program will calculate the year that the user was born and will then tell the user which decade he or she was born in. Here is part of the code:if year > 1989 and year < 2000 print("You were born in the 1980s")Can you identify one syntax error and one logic error in these lines? How do you think you could avoid making logic errors like the one in this code?

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:00
For all machines-not just hammers- the user applies force force to the machine to the machine over a certain distance. a. input b. output c. duo d. none of the above
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
Respond to the following in three to five sentences. select the workplace skill, habit, or attitude described in this chapter that you believe is most important for being a successful employee.
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
Write pseudocode to represent the logic of a program that allows the user to enter a value. the program multiplies the value by 10 and outputs the result.
Answers: 1
question
Computers and Technology, 24.06.2019 07:20
3pointsyou've found an image you want to insert into your slide presentation. youwant to make the image look more gray so that it looks like an older imagewhat would you need to adjust? 0.00o a. sizeo b. hueo c. contrasto d. tones
Answers: 2
You know the right answer?
Critical Thinking QuestionsIn this unit, you used this code to ensure that the user would enter a nu...
Questions
question
Advanced Placement (AP), 19.11.2020 18:50
question
Mathematics, 19.11.2020 18:50
question
English, 19.11.2020 19:00
question
Biology, 19.11.2020 19:00
Questions on the website: 13722363