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

Write a program that examines two numbers and exchanges their position using only the else clause


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 countup that expects a negative argument and counts “up” from that number. Output from running the function should look something like this:
>>> countup(-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 countup. Choose for yourself which function to call (countdown or countup) 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.
2. Write your own unique Python program that has a runtime error.

Create a class "House", with an attribute "area", a constructor that sets its value and a method

"ShowData" to display "I am a house, my area is 200 m2" (instead of 200, it will show the real

surface). Include getters an setters for the area, too.

• The "House" will contain a door. Each door will have an attribute "color" (a string), and a method

"ShowData" wich will display "I am a door, my color is brown" (or whatever color it really is).

Include a getter and a setter. Also, create a "GetDoor" in the house.

• A "SmallApartment" is a subclass of House, with a preset area of 50 m2.

• Also create a class Person, with a name (string). Each person will have a house. The method

"ShowData" for a person will display his/her name, show the data of his/her house and the data

of the door of that house.



Deeply nested conditionals can become difficult to read. Describe strategy for avoiding nested conditionals. Give your own example of a nested conditional that can be modified to become a single conditional and show the equipment single conditional.
Q#2: Write code Print Statement) that generates the following SMS: Murali (9566171366) is on the way to your location in a Silver Indica AP14F4434. 1.8 times peak time charge is applicable on this booking.
delivery by +orderDate + You can
manage your order at +OrderLink +". Thankyou!"

Q#2: Write code (Print Statement) that generates the following SMS: Murali
(9566171366) is on the way to your location in a Silver Indica AP14F4434. 1.8 times
peak time charge is applicable on this booking.

Create a Java program that simply outputs the text "Hello World" when you run it. Call your main class

"Application". In the same file as your main "Application" class, define a new class called "Person". You

don't need to put anything in the class. Now, right below where you output "Hello World" in your main

method, create an object from that (Person) class. Modify your "Person" class to add a constructor.

Make the constructor output the text "Constructor running!". Add another constructor in addition to

the constructor it's already got. Make this second constructor accept a parameter called name of type

String. Make this second constructor print the name parameter using System.out.println(). Finally,

change your "main" method, create two objects of Person class and call both constructors.


When the application starts, it must display the following menu structure:

Sample Menu Screenshot
BRIGHT FUTURE TECHNOLOGIES APPLICATION
*************************************************
Enter (1) to launch menu or any other key to exit
Please select one of following menu items:
(1) Capture a new product
(2) Search for a product
(3) Update a product
(4) Delete a product
(5) Print report
(6) Exit application

Write a program that allows a secretary to store the names, total student population and

programmes available of all universities in Zimbabwe and sorts them in ascending order

according to student pop. The program should allow a searching facility by name and

updating of population. Make use of functions and data structures

Write a program which allows an admissions personnel to enter the names of potential

students, points obtained and contact number in selected data structures. Based on the points

obtained apply the following the conditions:

 Sciences combination 5-8 allocate AS

 Sciences combination 9-11 allocate CS

 Sciences combination 12-15 allocate GS or MED

 Commercial combination 9-15 allocate IS

 Arts combination 5-9 allocate Media

 Arts combination 10-15 allocate Law

 All points below 5 for Sciences recommend bridging

 All points below 9 for commercials reject

 All points below 5 for Arts reject

N.B. Maximum number of students enrolled per programme should not exceed 40.


LATEST TUTORIALS
APPROVED BY CLIENTS