Program loops and if conditions write a program that

Assignment Help C/C++ Programming
Reference no: EM13347148

PROGRAM LOOPS AND IF CONDITIONS

Write 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 aother 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 3-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 4-FUNCTIONS
Rewrite 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 calculates the perimeter and area of a rectangle
print "Calculate 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?

Reference no: EM13347148

Questions Cloud

You will be required to prepare a portfolio of 4 stocks : you will be required to prepare a portfolio of 4 stocks with an initial investment of 100000 and track the weekly
Nbsp1briefly trace the development and growth of walmart : nbsp1.briefly trace the development and growth of walmart from 1969 to the present through the application of corporate
Task - you have been asked to prepare a discussion paper : task - you have been asked to prepare a discussion paper essay on the changing role of the human resource department.the
The research paper includes title page abstract body and : the research paper includes title page abstract body and reference page. the paper will culminate the content of the
Program loops and if conditions write a program that : program loops and if conditions write a program that requests a password after the authorprogram information is
Part a - use cases perform a requirements analysis for the : part a - use cases perform a requirements analysis for the case study. express the results using the following
Topic using net resources to teach netthis project will use : topic using .net resources to teach .netthis project will use the .net framework to produce a set of materials to
A consumer products company wants to calculate the : a consumer products company wants to calculate the effectiveness of different types of advertising media in the
Write a report on a new photocopier which the accounting : write a report on a new photocopier which the accounting firm can purchase. in addition to information about its

Reviews

Write a Review

C/C++ Programming Questions & Answers

  The factorial of a positive integer n, denoted by n!

Write a program that computes the sequence of factorial values: 1! = 1, 2! = 2, 3! = 6, 4! = 24, 5! = 120, 6! = 720, ....

  Write a function that computes length of a character string

Write a function that computes the length of a character string (i.e. write your own implementation of the strlen function.

  Write a program code to compute and build a table of reynold

Write a program code to compute and build a table of Reynolds numbers at flow velocities varying from 100 to 1000 ft/sec (at increments of 100)

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Inventory items stored in Sudbury

Give the details of all suppliers in the Sault Ste Marie, list all inventory items with a quantity less than 100 units and list all the inventory items stored in Sudbury

  What is a cell reference

What is a cell reference (also called a cell address) and what is the significance of being able to use them in spreadsheet formulas?

  Random permutations

Write a program in C++ that gives a prompt to the users, asking for an integer M.It then prints out a M different random permutations, one on each of M lines, of the numbers 1, 2, ... , 10, separated by spaces or tabs.

  Program that asks the user to enter up to 100 integer score

Write a C program that asks the user to enter up to 100 integer scores, which are to be stored in an array. (You should allow the user to terminate input prior to entering all 100 scores.) The program should then display all the scores, ten per line,..

  Create a program that contains 4 methods

Create a program that contains 4 methods / functions... main(), getTestScores(), calcAverage(), and displayAverage(). The main() method should call the getTestScores() method to get and return each of 3 test scores.

  Analyze a basic set of requirements for a problem

Create the main bank program. Note that you can create the main bank program in the main function or you can try to create another class for the main bank program.

  Matching program that takes input from a text file

need to make a string matching program that takes input from a text file and outputs that match (if there is one) asked from the user. i have done this part , the only problem is that , with the output match , i also need to print some words before a..

  Object-oriented systems is the concept of object

At the heart of all object-oriented systems is the concept of an object. Simply stated, an object is a set of related characteristics and their associated actions.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd