Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

2. Write your own unique Python program that has a runtime error. Do not copy the program from your textbook or the Internet. Provide the following.

  • The code of your program.
  • Output demonstrating the runtime error, including the error message.
  • An explanation of the error message.
  • An explanation of how to fix the error.

1. Copy the countdown function from Section 5.8 of your textbook.


def countdown(n):

   if n <= 0:

     print('Blastoff!')

   else:

     print(n)

     countdown(n-1)

Write a new recursive function count up that expects a negative argument and counts “up” from that number. Output from running the function should look something like this:

>>> count up(-3)

-3

-2

-1

Blastoff!

Write a Python program that gets a number using keyboard input. (Remember to use input for Python 3 but raw_input for Python 2.)

If the number is positive, the program should call countdown. If the number is negative, the program should call count up. Choose for yourself which function to call (countdown or count up) for input of zero.

Provide the following.

  • The code of your program.
  • Output for the following input: a positive number, a negative number, and zero.
  • An explanation of your choice for what to call for input of zero.

Write a java program that declares and displays a named constant that holds the number of seconds in a minute and a variable to represent the number of your subject. Name the class as DataStore and save the file. Debug syntax and logical errors if there any in the program.

Compare and use various data types in a java program, declare and use constant and variables and cast and value of one data type to another data type. Write a java program that initialize the following:



"Data Type"


double


short


double


int




"Variable Name"


size


grade


final_grade


final_length




"Value"


125.83d


87


grade


side




Name the class as Data and save the file. Debug syntax and logical errors if there is any in the program. Save the file.




Write a java program that initialize tge diplays values based on the table below. Print all the numbers as whole numbers. Name the class DisplayWholeNumbers.java





"Variable Name"




examScore




averageGrade




seconds_per_minute




length




referenceNumber






"Value"




87




84.67




60




29.7




998883723193101

2. Write your own unique Python program that has a runtime error


  • The code of your program.
  • Output for the following input: a positive number, a negative number, and zero.
  • An explanation of your choice for what to call for input of zero.

Write a Python program that gets a number using keyboard input. (Remember to use input for Python 3 but raw_input for Python 2.)


Write a new recursive function count up that expects a negative argument and counts “up” from that number.


Writing a function that calculates the occurrence of an integer A in an integer array T of size N.


LATEST TUTORIALS
APPROVED BY CLIENTS