Write a subroutine that keeps prompting for a filename

Assignment Help Programming Languages
Reference no: EM131002814

 Exercise 1 &2 

1.   Write a subroutine to prompt the user for any message (like "what is your name?"). The sub will collect the user's answer and return it back to the call (in the main program above the subroutine). Print out the returned string from the sub.

 

2.Write a subroutine that keeps prompting for a filename until a valid file is entered by the user (print out "file found, thanks") or until five attempts have failed (print out "you did not enter a valid file name"). Call the subroutine from the main part of your program. The sub in this case does not return any value. Show the entire program (not just the sub).

Perl Programming Language

Verified Expert

Complete Solution includes Ex1.pl is the solution to Exercise1 question. Ex2.pl is the solution to Exercise2 question. output-screenshots.doc contains output screen shots for above 2 programs

Reference no: EM131002814

Questions Cloud

Approach to modeling multicomponent transport : In Kerkhof and Geboers, (2005)7 , the authors presented a new approach to modeling multicomponent transport that is purported to yield more accurate predictions than previously available models.
Discuss the average size and deviation : You work for an organization that is concerned about automotive technologies. Discuss the average size and deviation for the top 5 and bottom 5, Average Wt and deviation for Top 5 and Average Wt and deviation for Bottom 5
Determine the postretirement benefit expense : Prepare the appropriate journal entries to record the postretirement benefit expense, funding, and retiree benefits for 2011.
True values of the unknown parameters : First, con?rm that the true values of the unknown parameters are θ0 = 1 and θ1 = 2, by computing for each indicated value of xi, the theoretical responses ηi given by:
Write a subroutine that keeps prompting for a filename : Write a subroutine that keeps prompting for a filename until a valid file is entered by the user (print out "file found, thanks") or until five attempts have failed (print out "you did not enter a valid file name"). Call the subroutine from the main ..
Describe two devices incandescent lamps and diodes : What does it mean for two variables, such as current and potential, to have a linear relationship to each other? Describe two devices "incandescent lamps and diodes" in which current and potential do not follow Ohm's Law.
Weighted least squares estimates : Determine the maximum likelihood estimates of the parameters θ0 and θ1 in the two-parameter model, η = θ0 + θ1x Show that these are also similar to weighted least squares estimates. What are the weights in this case?
Determine the net loss or gain as of december 31 : Calculate any amortization of the net loss that should be included as a component of postretirement benefit expense for 2011.
What is the focal length of the concave lens : The image is formed on a screen 18 cm from the lens. You then place the concave lens halfway between the convex lens and the screen. To obtain a sharp image, you need to move the screen 15 cm further away from the lenses. What is the focal length ..

Reviews

Write a Review

Programming Languages Questions & Answers

  Why do we have both debug and release builds

When two or more functions have the same name, how does the compiler determine which one to use for a particular function call?

  Modify the inventory program by adding a button to the gui

modify the inventory program by adding a button to the gui that allows the user to move to the first item the previous

  What is the break -even point for upgrades

What is break -even point for the upgrades? that is , what price would we require to charge for CPU (or disk -change only one) so result was the same cost per 1% increase for both?

  Provide a brief description within comment tags at bottom

Provide a brief description within comment tags at the bottom

  Design and run a program that takes a numerical score

Design and run a program that takes a numerical score and outputs a letter grade. Precise numeral scores and letter grades are listed show.

  Display the total price of the cup of coffee

Create a UseTVShow.java file that prompts the user to input up to 5 TV shows and stores the data in an array of objects first, then displays them as a list.

  Implement functions using x86 assembly

Implement a procedure that mimics a logic unit

  Using a loop to perform operations multiple times

What I need help with is to get the dice to roll 100 times instead of just one. So the read file results will show the results of 100 rolls of the dice

  Create a database with a table called "tblprofiles"

Use a RegularExpressionValidator control on the start page that displays an error message if the user does not enter a properly formatted social security number.

  Communicate with a pc using the rs232c serial protocol

In this assignment we will use the UART0 peripheral to communicate with a PC using the RS232C serial protocol.

  Small game development

Small game development - the development has to be done in PROLOG LANGUAGE.

  Create a very abstract programming environment

Find these header files in the Visual Studio system and determine the smallest (i.e., most negative) and largest (i.e., most positive) values that can be represented as int, unsigned int, long, unsigned long, float and double.

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