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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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