Ask Python Expert

PROGRAM: LOOPS AND IF CONDITIONS

prepare a program that requests a password after the author/program information is displayed. Make the password “hello”. The program should then ask the user for their name: if the name entered is the same as your name, the program should respond with

“What a great name!” if they enter “Madonna” or “Cher”, the program should respond

“May I have your autograph, please?” For any other input, the program should respond with “(input name), that’s a nice name”.

SAMPLE OUTPUT (including author/program information)

Program author: Barney Rubble

ID#: 1234567

Program: LOOPS AND IF CONDITIONS

Password? unicorn

Password? opus

Password? hello

Welcome to the second half of the program!

What is your name? Barney

What a great name!

Alternate Outputs

What is your name? Cher

May I have your autograph, please?

What is your name? Bill

Bill, that’s a nice name.

PROGRAM:FUNCTIONS

Reprepare the area.py program (shown below, or in the Creating Functions section of the tutorial) so that it has separate functions for the perimeter and area of a square, a rectangle, and a circle (3.14 * radius**2). This program should include a menu interface that has ‘exit the program’ as one of its choices.

SAMPLE PROGRAM EXECUTION:

Area.py

#This program find outs the perimeter and area of a rectangle

print “find out information about a rectangle”

length = input(“Length:”)

width = input(“Width:”)

print “Area”,length*width

print “Perimeter”,2*length+2*width

SAMPLE OUTPUT (not including author/program information)

CALCULATIONS MENU:

1) AREA (SQUARE)

2) AREA (RECTANGLE) 3) AREA (CIRCLE)

4) PERIMETER (SQUARE)

5) PERIMETER (RECTANGLE)

6) PERIMETER (CIRCLE)

7) EXIT

INPUT MENU CHOICE (1,2,3,4,5,6 OR 7)? 2

YOU HAVE CHOSEN AREA (RECTANGLE)

INPUT WIDTH? 8

INPUT LENGTH? 4

AREA IS 32

INPUT MENU CHOICE?

Python, Programming

  • Category:- Python
  • Reference No.:- M990

Have any Question?


Related Questions in Python

Foundations of programming assignment - feduni bankingthis

Foundations of Programming Assignment - FedUni Banking This assignment will test your skills in designing and programming applications to specification. Assignment Overview - You are tasked with creating an application t ...

Question why is software configuration management

Question : Why is software configuration management considered an umbrella activity in software engineering? Please include examples and supporting discussion. The response must be typed, single spaced, must be in times ...

Python programming assignment -you first need an abstract

Python Programming Assignment - You first need an abstract base class, called, Account which has the following attributes and methods: accountID: This attribute holds the ID assigned the account , if not provided set to ...

Show times in tmus and seconds1 an associate grasps an oven

Show times in TMUs and seconds. 1. An associate grasps an oven door within reach and pulls it open 18 inches with the left hand (he does not relinquish control of the door). With a pan in the right hand, he carefully pos ...

Below zero - ice cream storethe local ice-cream store needs

Below Zero - ice cream store The local ice-cream store needs a new ordering system to improve customer service by streamlining the ordering process. The manager of the store has found that many orders are incorrect and s ...

The second task in this assignment is to create a python

The second task in this assignment is to create a Python program called pancakes.py that will determine the final order of a stack of pancakes after a series of flips.(PYTHON 3) Problem Task In this problem, your input w ...

In this programming assignment you will write a client

In this programming assignment, you will write a client pingprogram in Python. Your client will send a simple ping message to a server, receive a correspondingpong message back from the server, and determine the delay be ...

Architecture and system integrationcase study queensland

Architecture and System Integration Case Study: Queensland Health - eHealth Investment Strategy After evaluating various platforms, Queensland Health finally decided to adopt a Service Oriented Architecture (SOA) for its ...

Simple python traffic lightswrite a program that simulates

Simple Python (Traffic lights) Write a program that simulates a traffic light. The program lets the user select one of three lights: red, yellow, or green. When a radio button is selected, the light is turned on, and onl ...

Part i the assignment filesone of the most important

Part I: The Assignment Files One of the most important outcomes of this assignment is that you understand the importance of testing. This assignment will follow an iterative development cycle. That means you will write a ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As